Skip to content

feat(text-editor): suggest emojis while typing :shortcode - #11145

Open
MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:feat/emoji-colon-autocomplete
Open

MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:feat/emoji-colon-autocomplete

Conversation

@MichaelUray

Copy link
Copy Markdown
Contributor

Fixes #6925

Problem and change

Typing ':' followed by a shortcode in the chat or any text editor showed nothing; the emoji extension only converted complete :shortcode: input or pasted text, so users had to know the exact shortcode.

The emoji extension now registers a ':' suggestion based on the existing suggestion plugin used for @ mentions and / commands. Once at least two shortcode characters follow a ':' that starts a word (so times like 10:30, URLs and emoticons do not trigger it), a popup lists matching emojis, including custom ones. Arrow keys or the mouse move the selection, Enter or Tab insert the emoji, Escape or a click outside close the list. Code blocks, inline code and links are excluded.

Emoticons ending with a letter or digit (:p, :D, :o, :3, ...) were converted as soon as their last character was typed, which turned the start of most shortcode searches (:joy, :smile, :ok, :pizza) into an emoji. They are now converted only when a whitespace follows; other emoticons such as :) are still converted immediately.

Matching reuses the emoji picker rules, extracted into a pure helper in emoji-resources (search.ts) together with the suggestion ranking (exact and prefix shortcode matches first). It is exposed as the new emoji function SearchEmojis, which applies the user's skin tone. Unit tests cover the search helper and the emoticon trigger rule.

Tests

New unit tests plugins/emoji-resources/src/__tests__/search.test.ts and plugins/text-editor-resources/src/components/extension/emoticon.test.ts; test scripts added to emoji-resources. Checked manually on a self-hosted instance: typing :jo opens the suggestion list, arrow keys and hover move the highlight, Enter/Tab insert the highlighted emoji without sending the message, Esc closes only the list; :) and :p still convert; 10:30 and URLs don't open the list.

Notes

Emoticons that end with a letter or digit (:p, :D, :3 …) are now converted when a space follows instead of immediately, so they don't swallow shortcode searches like :pizza.

Typing ':' followed by a shortcode in the chat or any text editor showed nothing; the emoji extension only converted complete :shortcode: input or pasted text, so users had to know the exact shortcode.

The emoji extension now registers a ':' suggestion based on the existing suggestion plugin used for @ mentions and / commands. Once at least two shortcode characters follow a ':' that starts a word (so times like 10:30, URLs and emoticons do not trigger it), a popup lists matching emojis, including custom ones. Arrow keys or the mouse move the selection, Enter or Tab insert the emoji, Escape or a click outside close the list. Code blocks, inline code and links are excluded.

Emoticons ending with a letter or digit (:p, :D, :o, :3, ...) were converted as soon as their last character was typed, which turned the start of most shortcode searches (:joy, :smile, :ok, :pizza) into an emoji. They are now converted only when a whitespace follows; other emoticons such as :) are still converted immediately.

Matching reuses the emoji picker rules, extracted into a pure helper in emoji-resources (search.ts) together with the suggestion ranking (exact and prefix shortcode matches first). It is exposed as the new emoji function SearchEmojis, which applies the user's skin tone. Unit tests cover the search helper and the emoticon trigger rule.

Fixes hcengineering#6925

Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
@MichaelUray
MichaelUray force-pushed the feat/emoji-colon-autocomplete branch from 9d6092c to 649b486 Compare October 19, 2026 06:42

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Emoji selection when typing : (colon) symbol in the chat box

1 participant