FelipeFTN/Emoji-Copy

Emoji search returns wrong or no emojis

illtellyoulater opened this issue ยท 5 comments

Bug Report

Current Behavior
Searching returns wrong emojis, or no emoji, for example searching "happy" shows: ๐Ÿ˜’๐Ÿ™‹

Expected behavior/code
I think it should return these ones ๐Ÿ˜Š๐Ÿ˜„๐Ÿ˜€๐Ÿ˜ƒ๐Ÿ˜, perhaps even this one ๐Ÿ’ฉ (๐Ÿ˜‰)

Environment

  • emoji-copy version(s): [9]
  • npm version: [not sure this applies? I don't have it installed though]
  • OS: [e.g. GNOME 42.5, Pop!_OS 22.04]

Possible Solution
I think your extension uses Gnome emoji system under the hood (which can be run by default with this sequence CTRL-SHIFT-e-SPACE), because it seems that when I search "happy" there, the same ๐Ÿ™‹ is shown (and the wrong one ๐Ÿ˜’ is not shown).
This little bug apart, it would be cool if we could do something to make the Gnome emoji system itself respond to more words, as your extension would benefit from this too.

Additional context/Screenshots
n/a

Hello, friend!
Thanks for reporting this bug! ๐Ÿ’ฏ
Sorry for taking too long to reply ๐Ÿ˜“

Looks like it's true! I just tested it and "happy" is returning: ๐Ÿ˜’๐Ÿ™‹ - Nice catch!
I tested other words like: "sad", "smile" and even "surprise", they seem to work just fine!
I highly agree that we should build a better searching system. The current one is pretty simple and archaic!
I will keep this issue on track! Thank you so much for reporting!

Feel free to contribute or share, if you get any solution! โค๏ธ

Will be more than glad to collaborate if I can! Your good vibes and kind words are highly appreciated! Keep up the great work! ๐Ÿš€๐Ÿฆ€

Thanks buddy! ๐ŸŽ‰
Looks like the file we need to change is this one: emoji-copy@felipeftn/data/emojisKeywords.js.
Take a look at the word: "happy".
You may see two emojis using this word: person raising hand (Line 270) and unamused face (Line 54).
Looks like the best way to make a better emoji search filter, is by adding and changing the words in this file. maybe GPT can help too ๐Ÿ˜†
Do you want to work on this improvement? It seems to be a simple task, updating the keywords for each emoji on the emojisKeywords.js file.
I will be working on the Gnome 45 migration before this.
Feel free to open an PR to contribute!

Maybe one can also contact and reuse others work, e.g. https://github.com/github/gemoji (see field tags in db/emoji.json) (MIT License)

This problem was fixed both on #23 #18 Thanks to @helena-dev and @NatVIII ๐Ÿ’™