When opening the emoji selector with no history, the 'Recent' tab will be inaccessible despite clicking emojis – until closing and reopening the selector.
STEPS TO REPRODUCE
1. Open the emoji selector with no history
2. Click some emojis
3. Try to access the 'Recent' tab
The tab is still greyed out and can't be clicked
As soon as there is history to display, you can access 'Recent'
OS: KDE neon 5.23
KDE Plasma Version: 5.23.0
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.3
It has this:
enabled: recentEmojiModel.count > 0
Which means recentEmojiModel isn't getting updated immediately after something is added to or removed from it.
I see that the config file is updated immediately though.
Basically `count` on the QML side isn't getting notifications of changes made on the C++ side.
Oh I see, `count` isn't actually a property at all and we're implicitly invoking it as a function. That explains it.
Giving up for now, too annoying
Sounds very strange from what you're explaining. Either way, I appreciate the updates here, that give a sense of what's going on. It really makes reporting and triaging bugs quite enjoyable. Thanks for the good work!
In a nutshell, the app enables and disables the recents entry based on there being at least one emoji in the "recent emojis model" backend code, but it only checks once, when the app is launched. It doesn't know how to monitor that value in real-time as it's updated based on user action.
So as you the user use emojis, they get added to the "recent emojis model" in real time, which syncs them to the config file in real time, but the number of emojis in it isn't sent to the sidebar code, so as far as it's concerned, the number of recent emojis remains what it was when it first checked at launch.
This would probably be trivial to fix for someone smarter than me.
I hope it's not blasphemy to ask, but does it actually need to be disabled when empty? Couldn't there simply be some text saying "No recent history"?
I do see the value in not starting on that entry if there is nothing to show, but maybe that can be done without having to disable it. Essentially: if recentEmojiModel.count > 0, start on the recents entry, otherwise, start on the first normal entry.
I admit that I don't have a good understanding of how the code here works. I'm just assuming that specifying which entry to start on is simpler than getting enable/disable to work properly.
lol that would work too
Brilliant bit of out-of-the-box thinking. I'll do that. Thanks a lot!
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/611
Wow that was quick! :^D
I already had the files open. :)
Git commit f78bd646d225580cff136e5fe648e897f31c4279 by Nate Graham.
Committed on 19/10/2021 at 17:48.
Pushed by ngraham into branch 'master'.
emojier: Show placeholder message instead of disabling recents when empty
Right now we disable the recents view when it's empty, but this relies
on querying recentEmojiModel.count, which is not a property, so it
doesn't update as the model fills up with recents. Making it a property
is annoying, and a better UX is simply to show a placeholder message on
the page when it's empty as we do in other places. The code already
skips showing the view on launch if it's empty, so everything still
M +8 -1 applets/kimpanel/backend/ibus/emojier/app/ui/CategoryPage.qml
M +0 -1 applets/kimpanel/backend/ibus/emojier/app/ui/emojier.qml