Add emoji search
Added a search key to the emoji bottom row. When pressed, if an emoji dictionary for the current language is found, the emoji search activity is launched; otherwise, the settings screen is opened. This is a placeholder for taking the user to the dictionary settings screen, for them to add a dictionary. Should we hide the search button if there's no dictionary instead?
The emoji search activity is displayed in a gap created for it above the keyboard and below the host app using privateImeOptions, and partly obscures the host app. The suggestion/toolbar strip is hidden in this mode.
If the user presses an emoji, the search is finished, in order to insert that emoji into the host app's edit box.
If the user presses the done action button and autocorrect is on, the first suggested emoji is inserted the same way.
As a follow-up, we can change the action button to search, which when pressed, will close the activity, and open a special emoji keyboard containing the search results, which will allow the user to insert multiple emojis.
If the user switches to emoji view or clipboard view during search, the search is aborted. Should we hide these buttons instead?
If the user switches to an unsupported language during search, the search is aborted.
When the activity is stopped, it passes its results to LatinIME.
Fixed emoji descriptions on the emoji keyboard in the case of a Default emoji skin tone setting.
Styling of the title bar and edit box is not done, and I'm not sure how to do it. Heliboard's color system seems to be incompatible with Compose.
Moved the emoji row count -> max key count calculation into DynamicGridKeyboard. As a side effect, also changed config_emoji_keyboard_max_recents_key_count to config_emoji_keyboard_max_recents_row_count. Wasn't sure what values to use there though. If this part is not desired, I'll revert.
Had to use a Compose beta version, in order to get this fix.
Copied SingleDictionaryFacilitator & SuggestionResults changes from #1660.
Displaying the right emojis in the case of a Default emoji skin tone setting should probably be applied to #1660 and to normal emoji suggestions as well.
I used CloseIcon & SearchIcon from the settings package. Should generic compose code like Icons.kt be moved?
Fixes #259.
Thank you very much for this feature! If I may, I'd like to suggest a few changes.
- The search shouldn't close after selecting an emoji. The user may want to select more emojis or the same one multiple times.
- After closing, the search should reset. It could display the emojis selected via search, rather than the last search result.
- It would be ideal if a suggestion bar was displayed just like in Gboard.
- Animations should be smoother. Keyboard reloading (which sometimes happens) should be eliminated.
Added some colors.
@maruuk, thanks for your feedback!
- The search shouldn't close after selecting an emoji. The user may want to select more emojis or the same one multiple times.
I agree that this is a limitation of this implementation, but I couldn't find a good way around it, given that we have to close the activity in order to insert the emoji into the host app. This is why I suggested a follow-up improvement. Other ideas I considered and dropped:
- automatically reopening the search activity after entering an emoji - this seems too confusing
- adding another view for showing the selected emojis during search - seems like overkill
- After closing, the search should reset. It could display the emojis selected via search, rather than the last search result.
This is a workaround for the above limitation. I wanted to make it as easy as possible to insert multiple emojis of the same search without retyping it.
- It would be ideal if a suggestion bar was displayed just like in Gboard.
What do you mean by suggestion bar?
- Animations should be smoother. Keyboard reloading (which sometimes happens) should be eliminated.
This is another consequence of the fact that I used an activity for the search.
Excited for this feature, thank you for your work! Do you have a screenshot of how it looks?
@eranl I see. I hope you can figure this out with Helium's help. The ability to select multiple emojis is important to me, and certainly not only me. It would be best if we could quickly select emojis from search like in Gboard and FUTO.
What do you mean by suggestion bar?
The toolbar/word suggestion bar you mentioned is invisible in searches. I think it should be available, as it makes entering emoji names easier.
@balintbarna I have it. Out of curiosity I checked what it looks like.
As you can see, the search bar color doesn't quite match the accent color. In my opinion, the entire search appearance should match the keyboard background color, in my case gray. It would be nicer, and the search text would be more visible.
It works quite well, but it needs tweaking. The whole thing should definitely be smoother. Sometimes the search opens but then closes.
The dictionaries also need to be adjusted, as they're currently suggesting strange emojis, but Helium said he could look into that.
The ability to select multiple emojis is important to me, and certainly not only me. It would be best if we could quickly select emojis from search like in Gboard and FUTO.
Totally agreed. Some technical background: putting a search box inside the keyboard has potential issues that we're concerned about. Even Gboard seems to have such issues. So the activity approach seems safer. And the follow-up improvement I proposed may fill the gap.
The toolbar/word suggestion bar you mentioned is invisible in searches. I think it should be available, as it makes entering emoji names easier.
I think that might be confusing, and not that helpful, as search input would likely be short. But I don't have a strong opinion here.
As you can see, the search bar color doesn't quite match the accent color. In my opinion, the entire search appearance should match the keyboard background color, in my case gray. It would be nicer, and the "search" text would be more visible.
I don't have an opinion about which colors to use. I chose the functional key colors just to make the search box noticeable, but I'm happy to change to anything else. Was your screenshot taken with latest code? For some reason it looks different from the functional keys.
Sometimes the search opens but then closes.
I would love to get more details, so I can fix it. I did encounter such bugs, and fixed them. Did you try the latest code?
The dictionaries also need to be adjusted, as they're currently suggesting strange emojis, but Helium said he could look into that.
Are you using a new dictionary? Again, I would love to hear about specific issues, so I can fix them. We've iterated quite a bit on these dictionaries, but issues are certainly possible.
Thank you again for your work. I just tried gboard for comparison and it seems like it does everything quite well: search doesn't disappear, can insert multiple emojis, word suggestions are visible. And many other nice features. The design also fits together quite well.
As a follow-up, we can change the action button to search, which when pressed, will close the activity, and open a special emoji keyboard containing the search results, which will allow the user to insert multiple emojis.
You mean this workaround?
I think that might be confusing, and not that helpful, as search input would likely be short. But I don't have a strong opinion here.
In my opinion, it might be useful. Today, while testing, I typed "keyvoard" instead of "keyboard" and didn't get the correct emoji. The suggestion bar will let me choose the correct word, which will improve emoji suggestions. I remember this bar in Gboard speeding up typing emoji names.
Was your screenshot taken with latest code? For some reason it looks different from the functional keys.
Yes. I checked again more carefully, and it seems that this color doesn't adapt only to the "dynamic colors" theme. It adapts to built-in and custom themes and looks really nice.
I would love to get more details, so I can fix it. I did encounter such bugs, and fixed them. Did you try the latest code?
Yes. I only noticed this in a browser, e.g. Brave search or Google Translate. Sometimes it works, but after a few tries. In general, I have noticed that searching is most problematic in browser input fields, e.g. it opens slowly.
In the other apps, it doesn't close, but I noticed that sometimes it works faster and displays the search and keyboard at once, and other times you have to wait for one or the other. I know it's just a moment, but it would be visually nicer if the search and keyboard were displayed at the same time.
Are you using a new dictionary?
Ah, I was using the old one, I didn't know there was a new one. I checked and it's better, but it still suggests unrelated emojis, e.g. for "whale" it displays đĩđđšđđ.
You mean this workaround?
It's not a workaround. It's a feature Gboard has too. I just think that adding it could alleviate the single-emoji issue.
Yes. I only noticed this in a browser, e.g. Brave search or Google Translate. Sometimes it works, but after a few tries. In general, I have noticed that searching is most problematic in browser input fields, e.g. it opens slowly.
Which browser do you use? I can't reproduce with FF or Chrome.
In the other apps, it doesn't close, but I noticed that sometimes it works faster and displays the search and keyboard at once, and other times you have to wait for one or the other.
You mean in all apps? What's your device/OS?
it still suggests unrelated emojis, e.g. for "whale" it displays đĩđđšđđ.
The word whale has only two emojis linked to it, but the dictionary library is very "creative" in how it comes up with additional matches. Maybe we should set a score threshold.
Now the search activity sets hintLocales based on locales with emoji dictionaries, and emoji search is enabled regardless of the user's current locale, as long as they have any emoji dictionary.
It's not a workaround. It's a feature Gboard has too. I just think that adding it could alleviate the single-emoji issue.
Got it. This will definitely be helpful, but users will probably ask why they can't select more emojis directly from search.
Which browser do you use?
Kiwi Browser, but I'll also check in IronFox.
What's your device/OS?
Motorola One Vision and Android 15 (LineageOS 22.2).
You mean in all apps?
I think so. Maybe it's because I'm using the debug version. It runs much slower than the release version.
The word whale has only two emojis linked to it, but the dictionary library is very "creative" in how it comes up with additional matches. Maybe we should set a score threshold.
In my opinion, only emojis whose name matches the search word should be displayed, like in Gboard. FUTO also suggests strange, unrelated emojis.
I think so. Maybe it's because I'm using the debug version. It runs much slower than the release version.
I also use the debug version, and haven't seen this.
In my opinion, only emojis whose name matches the search word should be displayed, like in Gboard.
The nice aspects of it are that it suggests emojis even when you partially type or mistype a word. BTW, have you tried searching with multiple words?
I also use the debug version, and haven't seen this.
Hmm, I don't know what's wrong. If I close and reopen the search a few times, the animation sometimes speeds up.
BTW, have you tried searching with multiple words?
I checked and the suggested emojis are usually for the second word.
I checked and the suggested emojis are usually for the second word.
The order doesn't matter. It uses the average score against all words.
The order doesn't matter. It uses the average score against all words.
Sorry, but I don't know anything about this đĢŖ I'm a simple user and expect only emoji suggestions that I type and that are related to them. Right now, even when I'm typing (not searching), the keyboard suggests strange emojis. For example, when I type "I," the correction changes it to đ, and when I type "ze," I get đŠ.
I tested the search more thoroughly, and it's better in Chrome and IronFox. However, I also noticed that the emoji search took longer to load in Google Translate and the search bar (in IronFox). The animation flickered, and the search even stopped. Do you think this can be fixed?
The search works in other apps. The only thing I noticed is that the keyboard doesn't open automatically after selecting an emoji, but that only happens in Rain and NewPipe.
Sorry, but I don't know anything about this
What I meant is that the order of the words you type in emoji search doesn't matter, so every word has exactly the same weight in choosing the emoji results.
when I type "I," the correction changes it to đ, and when I type "ze," I get đŠ.
I can't reproduce this. You're using the new English emoji dictionary?
the emoji search took longer to load in Google Translate
Works fine for me. I wonder what causes these differences.
The animation flickered, and the search even stopped.
Can you please try to reproduce and send a log?
What I meant is that the order of the words you type in emoji search doesn't matter, so every word has exactly the same weight in choosing the emoji results.
Okay, now I get it. I've never searched for many emojis in Gboard.
You're using the new English emoji dictionary?
I should have checked it more carefully. The problem is with the Polish emoji dictionary. The English one seems fine.
Works fine for me. I wonder what causes these differences.
I have no idea. It's better than in Kiwi Browser, but it happens sometimes, especially after opening the browser. Opening the search function a few times seems to fix the problem. I can record it.
Can you please try to reproduce and send a log?
Sure.
when I type "I," the correction changes it to đ, and when I type "ze," I get đŠ.
For Polish, these seem reasonable, as the names of these emojis contain these words.
Okay, now I get it. I've never searched for many emojis in Gboard.
I was referring to this emoji search. I don't know how the Gboard search works.
I have no idea. It's better than in Kiwi Browser, but it happens sometimes, especially after opening the browser. Opening the search function a few times seems to fix the problem. I can record it.
That would be helpful. I also added some timing logging, so I would appreciate it if you could build with the latest code and send a log of the slow cases.
Thanks. No clues in this log, and no crash.
For Polish, these seem reasonable, as the names of these emojis contain these words.
Yeah, but it causes weird autocorrection that makes typing difficult. In my language, "i" and "ze" are used very often, and such corrections to emoji would be very irritating. It's possible that similar things will happen with other languages.
I recorded it. This time it worked on the second try, but sometimes I have to try multiple times.
https://github.com/user-attachments/assets/6f840ecb-ae74-478b-8dce-2fbfc7d70006
Yeah, but it causes weird autocorrection that makes typing difficult. In my language, "i" and "ze" are used very often, and such corrections to emoji would be very irritating.
You're referring to emoji autocorrect with normal typing, regardless of this emoji search, right? Can you please open an issue about that?
I recorded it. This time it worked on the second try, but sometimes I have to try multiple times.
Thank you. That was very helpful. Please check out my fix.
So when you referred to the emoji search as being slow, you were talking about this flickering and needing to open it several times?
You're referring to emoji autocorrect with normal typing, regardless of this emoji search, right? Can you please open an issue about that?
Yes. Done #1826
Please check out my fix.
I tested it and it's better. So far, I haven't seen any search crashes, just this flickering animation.
So when you referred to the emoji search as being slow, you were talking about this flickering and needing to open it several times?
Yes, and I've noticed that this only happens in browsers. In other apps, there's only a slight delay. I mean, search appears first, then the keyboard. It also happens the other way around.
After the recent changes, crashes occur again when opening emoji search in browsers. HeliBoard_debug_log_2025-08-13_23-15-57.txt
Would it be possible to create a workaround in the future so that more emojis can be selected during activity? I really miss it âšī¸ The suggestion of displaying search results after pressing enter will be helpful, but it's insufficient when you need to quickly select several emojis.
Closing a search should only be done by pressing the close button or tapping outside the search and keyboard. Currently, the search can be closed even if no emojis have been searched and you simply tap the search area, which is confusing.
After the recent changes, crashes occur again when opening emoji search in browsers.
By crash you mean emoji search opening and immediately closing? Would it be possible for you to provide a recording and a matching log again?
Would it be possible to create a workaround in the future so that more emojis can be selected during activity?
I hope so, but I can't think of a good way to do that.
the search can be closed even if no emojis have been searched and you simply tap the search area, which is confusing.
Thanks. Fixed.
By crash you mean emoji search opening and immediately closing? Would it be possible for you to provide a recording and a matching log again?
Yes, and as before, this only happens in browsers.
https://github.com/user-attachments/assets/a2db5061-d1af-4479-8eef-22fb9e154213
HeliBoard_debug_log_2025-08-15_20-35-36.txt
Thanks. Fixed.
Great. And could you remove that blinking when tapping the empty search area? It's not serious, but I think it would look better without it.
this only happens in browsers.
Thanks. I was able to reproduce on Chrome. Should be fixed now. BTW, emoji search doesn't work in Chrome's search bar, since it completely disconnects when stopping editing. Even opening HB settings erases all input.
And could you remove that blinking when tapping the empty search area?
Fixed.
Should be fixed now.
Unfortunately, when I try to enable emoji search, the entire keyboard crashes. It happens everywhere. crash_reports.zip HeliBoard_debug_log_2025-08-16_10-10-18.txt
emoji search doesn't work in Chrome's search bar, since it completely disconnects when stopping editing
You mean the emoji isn't being typed? If so, I've noticed that too. It happens to my entire browser, but only in Kiwi. In Firefox and Chrome (I'll have to check the search bar) it worked fine. And it also happens on Discord, usually on the first search. It's better here because if I reopen the search and select the emoji a second time, it's typed. After that, it doesn't happen again until I switch keyboards, but I'll have to test it further.
Unfortunately, when I try to enable emoji search, the entire keyboard crashes.
Are you using this branch as is, or did you merge it with others? Maybe you had a merge issue with InputLogic? Looks like you're missing the case KeyCode.SEARCH: entry in handleFunctionalEvent.
You mean the emoji isn't being typed?
Yes, and the whole input being deleted.
I must have done something wrong. I deleted everything, downloaded the code again, and now it's fine. So far, I've only noticed 2-3 crashes when opening the emoji search only after installing the app. I'm not currently experiencing any. I'll let you know if I see any.
Yes, and the whole input being deleted.
For me it only happens in Kiwi browser, it works in other browsers. Interesting. And on Discord, but here it seems random and I can't reproduce it.
I had crashes (opening and immediately closing search) yesterday and today. Only two. I saved the logs after each. HeliBoard_debug_log_2025-08-19_12-51-09.txt HeliBoard_debug_log_2025-08-20_22-03-57.txt
Btw, could you try improving the search bar color for the dynamic colors theme? Only this theme doesn't use the functional keys color đ̤
Oh, and what do you think about adding a circular background to the close search button? Something like the toolbar expand button, also in the functional keys color. In my opinion it would look cool. But you'd probably have to enlarge the entire area a bit to prevent the button from looking like it's been shoved in there.
I had crashes (opening and immediately closing search) yesterday and today. Only two. I saved the logs after each.
Thanks. Applied another fix.
Btw, could you try improving the search bar color for the dynamic colors theme? Only this theme doesn't use the functional keys color đ̤
Fixed.
Oh, and what do you think about adding a circular background to the close search button? Something like the toolbar expand button, also in the functional keys color. In my opinion it would look cool. But you'd probably have to enlarge the entire area a bit to prevent the button from looking like it's been shoved in there.
I followed the settings search look.