Skip to content

feat(desktop): auto-replace ASCII emoticons in the composer#2762

Open
laleshii wants to merge 1 commit into
block:mainfrom
laleshii:feat/composer-emoticon-autoreplace
Open

feat(desktop): auto-replace ASCII emoticons in the composer#2762
laleshii wants to merge 1 commit into
block:mainfrom
laleshii:feat/composer-emoticon-autoreplace

Conversation

@laleshii

Copy link
Copy Markdown

Summary

  • Typing a standalone ASCII emoticon (:), :(, :D, ;), :P, :O, :|, :*, B), XD, <3, </3, and :--prefixed variants) in the message composer now auto-converts it to the matching unicode emoji the instant the pattern completes — the same "convert on completion" behavior the composer already uses for known :shortcode: custom emoji.
  • Requires the emoticon to be preceded by a space (or be the very start of the message) so it only fires on a standalone emoticon, not mid-word (hi:) stays literal, hi :) and a message starting with :) both convert).
  • No-op inside code blocks and inline code (Tiptap's input-rule plugin already excludes both) and on pasted text (paste never goes through the input-rule keystroke path), so code samples and pasted content are never mangled.

Test plan

  • Unit tests for the emoticon map and word-boundary pattern (emoticonMap.test.mjs)
  • Playwright e2e spec (composer-emoticon-autoreplace.spec.ts) covering: basic conversion, multiple emoticons in one message, incomplete patterns, mid-word non-conversion, message-starts-with-emoticon, space-triggered conversion, continued typing after conversion, paste non-conversion, and inline-code non-conversion — all passing
  • Full regression sweep across messaging/mentions/spoiler/custom-emoji specs (115 tests) — all passing
  • tsc --noEmit and biome check clean

@laleshii
laleshii requested a review from a team as a code owner July 24, 2026 21:08
@laleshii
laleshii force-pushed the feat/composer-emoticon-autoreplace branch from 36cac61 to 9c2b8ff Compare July 24, 2026 21:33
Typing standalone smileys like :) :P ;) <3 now converts them to the
matching unicode emoji as soon as the pattern completes, the same way
:shortcode: custom emoji already do. Requires a preceding space/start
so it doesn't fire mid-word, and is a no-op inside code blocks/inline
code and on pasted text (Tiptap's input-rule plugin only hooks live
keystrokes).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Rares S <rrr.junior@gmail.com>
@laleshii
laleshii force-pushed the feat/composer-emoticon-autoreplace branch from 9c2b8ff to 9341706 Compare July 24, 2026 21:55
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.

1 participant