-
-
Notifications
You must be signed in to change notification settings - Fork 195
Display emoji descriptions in popups #1542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hm. Yes and no?
Popups are... weird. I understand they were made the way they are for performance reasons, but dealing with them can be awful.
I tend towards the keybord language, but no strong opinion here.
Currently my only idea would be displaying the text in a separate line. But that would look rather awful, and you'd run into the "all popups are same size" problem. |
|
Thanks for the feedback.
I think most people don't know it's possible, because they haven't seen it anywhere. I certainly didn't know it was possible until I found CLDR.
So is this feature feasible? Maybe bundle descriptions with dictionaries? |
I don't know how they could be resonably bundled with the dictionaries without throwing overboard the idea of making dicitonaries for all AOSP keyboards.
Actually if such a TextView is positioned properly, it could be made to appear above the popups, so you simply display both. |
Based on this, I don't see how. Do you have an idea for doing that?
So either one or both of these would show up on long tap? Should I make any changes to the hint? |
Currently my only idea would be trying to mis-use the shortcut, like
I'd say both, so on top you have the view with the description, and below the usual popup keyboard.
If this is added via setting, I think the users should be aware and a hint might not be necessary. |
Either one of these may not be available for any given emoji.
The thing is not all emojis have descriptions available. |
Is this still valid with the CLDR descriptions? I'm considering packaging at least the English dictionary with Heliboard, which could be used as fallback. (or do users actually expect descriptions for the "emoticons" section?)
When there are no popups the description text could just be placed lower? |
# Conflicts: # app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java # app/src/main/java/helium314/keyboard/keyboard/internal/keyboard_parser/EmojiParser.kt
…sing a new popup text view. Add a setting.
Yes, not all emojis have CLDR entries, and not all entries have tts .
Done. |
|
Just committed a new implementation, which takes descriptions from a dictionary, and displays them using a new popup text view. It also adds a setting. Questions:
|
|
What's the alternative?
I did notice some weird cases with rapid successive lookups, where one lookup seemed to 'bleed' into another. Where do I get info about how many sessions I should have?
I guess all, as I didn't see a way to limit it. But the matches seem to all come from the emoji dictionary - they seem to be manufactured from other entries. |
I haven't properly looked through the code yet, but my idea way getting some kind of offset from the popup keyboard (maybe whether popups are displayed or not is already enough). The offset could be added to the view.
Sorry, I don't have any experience on this. You will need to test and find something that works.
It should really only be the emoji dictionary. I think at some other place I told you of my (halfway done) plan to have some kind of DictionaryFacilitator (or at least something similar) that works with a single dictionary. This would be ideal for what you need. |
What can I use for the
Please let me know when it's ready, or if I can help with that. |
|
Is it a bug that adding/removing/replacing a dictionary requires an app restart? |
That would be a bug.
It's added in e034065 (original intention was the thing that will be using the
|
|
Thanks. How do I get a |
You can use |
Consistently insert emoji after long press.
I fixed this inconsistency - now the emoji always gets inserted after a long press.
This is still a (rare) problem. An example: if I long-press judge, then man judge, the popup will show judge. If I long-press a second time, the popup is correct, but then it will bleed to the next popup. In other cases, no description is shown on the first long press after seeing a description of a different emoji. Before switching to
Thanks. Done. I refactored
This is done on startup, right? |
It's rare, and I heavily doubt the change can a relevant impact on performance at all.
Dictionaries are extracted only when they are needed, i.e. we have a dictionary in assets with a type that is not available in the cached dictionaries (
I'll have a look at this, but I also have no experience with session ids and will need to investigate. |
Am I guarantied that this has been done by the time the emoji keyboard is shown, or do I have to trigger it? How? |
Well, the file is extracted after |
|
Not sure I follow. You mean that if we add an emoji dictionary to assets, and the user doesn't add it to their list of dictionaries, I'll have to do that? |
Done. |
Would appreciate your comments about these. |
|
I remember noticing the inconsistent behavior quite a while ago, but never found the time to investigate (I guess I still have it on some list). |
|
2 minor things left:
(I'll go though whatever came up in the last 2 days and hope to merge this tomorrow at latest) |
Fixed.
Fixed. Before releasing this, the dictionaries have to be made available and added to |
Definitely, and the dictionary screen needs to be adapted so users can disable the emoji dictionary for normal suggestions (or maybe set the weight, with 0 just disabling the dictionary). |
|
Are you planning all of that for a separate PR? Which part can I start working on? |
|
So all you can start working on is the dictionary screen update, as you're already working on the rest. |
|
🎉🎉🎉🥳 |
|
Dictionary loading will not work for all languages. Should I add this change in a separate PR? |
Should this be done in a separate PR or in the emoji search one? |
I don't think locales should be mixed that way. If a dictionary gets added to an incorrect directory, then I think it's better to fix adding dictionaries than trying to deal with this issue.
In a separate PR, because it's not only for emoji dictionaries but for any dictionary.
You mean instead of setting a weight, or additional? With additional allowing users to disable emoji suggestions in 2 different ways can be confusing. Though we could make the globar switch change the weight, so things should be clear enough. |
What do you mean by mixed? Isn't this normal locale fallback logic? What's the fix you're referring to?
I meant instead, as a simplification. If you prefer the general weight approach, I'd be happy to implement, but would need some guidance about the details you're planning. |
Dictionaries should always be in the cached folder of the locale they were added to. This is how it already works when extracting assets dictionaries, and I think it should stay that way. The fallback logic is a bit more more exhaustive (using the bestMatch) and decides which assets dictionary is extracted into the cache folder for the current locale.
I don't know the bug, so I can't tell you. But you imply that dictionaries are added to the wrong locale for some reason, and that should not happen.
Weight has the advantage that people can adjust how many emojis they get with the normal dictionary, instead of being stuck with f <= 20. Might also be useful for some other addon dictionaries. |
As I described here, the Lao (Laos) language's locale in HeliBoard is
What's the better approach - when the new setting is off:
Either way, the logic for determining if the dictionary group has to be reloaded, and managing the reloading, becomes more complex. Do you have any tips for that? |
Then the fix is not auto-selecting a dictionary locale when it's not available in the select locale dropdown when adding a dictionary. (done in 77a728e)
My idea with using weight was to not add a dictionary to the collection when the weight is 0. Since we'll start without weight anyway, the first approach would be the way to go.
Without having considered everything: my first idea would be just skipping dictionaries of type
I'm not sure what exactky you are referring to? When to reload the collection? |
|
The main issue with dictionary reloading is that it relies on |
|
I don't really understand. Is this something for the current state of Heliboard, or for the emoji search PR? |
This is a summary of our discussion. When the user changes the new setting, we have to reload the dictionary group. In order to detect that, we have to check if the group contains an emoji dict. |
|
We can just reload the dictionaries anyway, it's not like the user will change settings every few minutes. |
This is a draft for discussion.
Using descriptions downloaded from CLDR, an asset file per supported locale is created.
The script that creates these descriptions files depends on #1515 for the lists of supported emojis.
The descriptions files are bundled with the app. Should they be made into separate download(s)?
Using modified popups, these descriptions are then shown for emoji keys.
Some of the adaptations I made to popups seem a little hacky to me, so I'd appreciate advice for improving this.
This feature should probably be controlled by a setting.
Descriptions are shown in the current keyboard language. Should we use the main system language instead? I can see reasons to do either.
Emojis with flavors don't show descriptions, since the popups are taken. I'd appreciate ideas for fixing this.
Saving and restoring recent emojis loses the descriptions. To be fixed.
A
?artifact shows in the popups, which is weird. To be fixed.Fixes #1532.