Skip to content
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

Unicode絵文字のとカスタム絵文字の名前が重複すると、カスタム絵文字側がサジェストされなくなる #13815

Open
1 task
Sayamame-beans opened this issue May 10, 2024 · 1 comment · May be fixed by #13817
Labels
⚠️bug? This might be a bug

Comments

@Sayamame-beans
Copy link
Contributor

💡 Summary

タイトル通りです。
例えば、:vs:というカスタム絵文字がある場合、これは🆚と被っているため、サジェストでは:vs:が表示されず、🆚のみになります。
入力後のテキストにおいて、:vs:と🆚は別物であるため、両方サジェストされて欲しいと思います。

絵文字ピッカーの場合は、Unicode絵文字とカスタム絵文字のサジェストがそれぞれ独立して存在するためか、両方とも表示されるようです

🥰 Expected Behavior

Unicode絵文字と被っている場合でも両方サジェストされる

🤬 Actual Behavior

Unicode絵文字の方しかサジェストされない

📝 Steps to Reproduce

  1. Unicode絵文字と名前が被っている絵文字を登録する
  2. その絵文字を入力しようとし、サジェストを出す
  3. Unicode絵文字のみサジェストされる

💻 Frontend Environment

* Model and OS of the device(s): any
* Browser: any
* Server URL: https://misskey.niri.la/
* Misskey: 2024.3.1-kinel.4

🛰 Backend Environment (for server admin)

* Installation Method or Hosting Service:
* Misskey:
* Node:
* PostgreSQL:
* Redis:
* OS and Architecture:

Do you want to address this bug yourself?

  • Yes, I will patch the bug myself and send a pull request
@Sayamame-beans Sayamame-beans added the ⚠️bug? This might be a bug label May 10, 2024
@takaion
Copy link

takaion commented May 10, 2024

オートコンプリートでの絵文字の検索結果 matchedMap<string, EmojiStore> で管理されているのですが、Unicode絵文字もカスタム絵文字も同じキー (文字列) で扱われているので同一の絵文字と判定されるようです。
クエリに一致する絵文字を検索する過程で上書きされてしまっているようですね。

const matched = new Map<string, EmojiScore>();

Unicode絵文字の場合 namevsnew などになります:

カスタム絵文字も前後のコロンがない vsnew などになります:

検索に使用される emojiDb ではUnicode絵文字のほうが後の要素となるので、カスタム絵文字が一致してsetされる→Unicode絵文字も一致して上書きされるといった流れのようです。

return markRaw([...customEmojiDB, ...unicodeEmojiDB]);

EmojiDef['aliasOf']EmojiDef['name']の代わりにEmojiDef['emoji']をキーとして使うように変更してみたところいい感じに動きました。
EmojiDef['emoji']にはUnicode絵文字の場合は絵文字がそのまま、カスタム絵文字の場合は:emoji_name:のようにコロンで囲まれた文字列が入るので区別できます。

(1番上の候補がカスタム絵文字の :new:、2番目が🆕です)
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️bug? This might be a bug
Projects
None yet
2 participants