Repository navigation
feat(text-editor): suggest emojis while typing :shortcode - #11145
Open
MichaelUray wants to merge 1 commit into
Open
MichaelUray wants to merge 1 commit into
MichaelUray wants to merge 1 commit into
Conversation
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
force-pushed
the
feat/emoji-colon-autocomplete
branch
from
October 19, 2026 06:42
9d6092c to
649b486
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsandplugins/text-editor-resources/src/components/extension/emoticon.test.ts;testscripts added to emoji-resources. Checked manually on a self-hosted instance: typing:joopens 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:pstill convert;10:30and 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.