Skip to content

fix(builder): keep U+FE0F in flow editor emoji - #1698

Merged
realcodesiman merged 2 commits into
ChatbotXIO:mainfrom
rqms40:fix/flow-builder-emoji-fe0f-1686
Nov 11, 2026
Merged

realcodesiman merged 2 commits into
ChatbotXIO:mainfrom
rqms40:fix/flow-builder-emoji-fe0f-1686

Conversation

@rqms40

@rqms40 rqms40 commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Closes #1686

What changed

Both flow builder TipTap editors (tiptap-editor.tsx and plain-text-tiptap-editor.tsx) now use one shared emoji extension from apps/builder/src/components/tiptap/fully-qualified-github-emojis.ts. It is Emoji.extend() with the stock gitHubEmojis catalogue, and only renderText and renderHTML are overridden to emit the fully-qualified character (with U+FE0F). That character is read from the emoji's Apple fallback image name, for example 0031-fe0f-20e3.png for 1️⃣.

Why

gitHubEmojis stores keycaps, hearts, warnings and arrows without the variation selector (1⃣, ❤, ⚠, ➡). The extension's renderText returns that catalogue character, so getText(), which the flow editors save, dropped U+FE0F. A message typed as 1️⃣ ❤️ ⚠️ was saved as 1⃣ ❤ ⚠.

The catalogue itself is left unqualified on purpose. emojiToShortcode strips the variation selector from the input and compares the result to item.emoji, so qualifying the catalogue would stop both ❤ and ❤️ from becoming emoji nodes. Lookup, suggestions, emoticons and fallback images therefore behave exactly as before; only the text and HTML output change. Names and shortcodes resolve to the first catalogue row that owns them, the same rule as shortcodeToEmoji, so sunglasses stays 😎 even though a later row also uses that shortcode. Emoji that are fully qualified without U+FE0F (😀, 👍) are untouched, and ZWJ sequences such as ❤️‍🔥 keep their other code points. The emitted spans keep data-type="emoji" and data-name, so saved content and pasted HTML still parse.

Screenshots

Isolated TipTap editor with the flow editor emoji setup: 1️⃣ ❤️ ⚠️ ➡️ loaded, then read back with getText(). The code-point line shows the difference.

Before (0031 20e3 0020 2764 0020 26a0 0020 27a1):
before

After (0031 fe0f 20e3 0020 2764 fe0f 0020 26a0 fe0f 0020 27a1 fe0f):
after

Validation

  • New test apps/builder/__tests__/flow-editor-emoji-fe0f.test.ts (21 tests, with a small canvas shim in __tests__/helpers/emoji-canvas-shim.ts for emoji support detection in jsdom). It checks for emoji nodes and names after loading, typing and pasting both the qualified and unqualified forms of 1️⃣ ❤️ ⚠️ ➡️, and for U+FE0F in getText(). It also covers the typed shortcodes :one: :red_heart: :warning: :arrow_right:, the emoticons <3 and :(, the real suggestion items function, setEmoji serialization, and emoji that must not gain U+FE0F.
  • Against stock gitHubEmojis, 19 of the 21 fail (U+FE0F is dropped on save). All 21 pass with this change.
  • pnpm lint: passes
  • builder check-types: passes
  • Not run: a live channel send.

emojiToShortcode in @tiptap/extension-emoji 3.26.0 strips one variation
selector and compares it with item.emoji. Qualifying the catalogue
character made both heart forms miss, so they stayed plain text.
Lookup keeps the catalogue character. renderText and renderHTML emit
the fully-qualified form.
@github-actions github-actions Bot added the bug Something isn't working as expected label Nov 11, 2026
@realcodesiman
realcodesiman merged commit 5185abc into ChatbotXIO:main Nov 11, 2026
14 checks passed
hello-jackytruong referenced this pull request in hello-jackytruong/ChatWorkAI Nov 22, 2026
* fix(builder): keep U+FE0F in flow editor emoji

* fix(builder): qualify emoji text without breaking lookup

emojiToShortcode in @tiptap/extension-emoji 3.26.0 strips one variation
selector and compares it with item.emoji. Qualifying the catalogue
character made both heart forms miss, so they stayed plain text.
Lookup keeps the catalogue character. renderText and renderHTML emit
the fully-qualified form.

---------

Co-authored-by: Mark David Prado <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flow builder strips U+FE0F from emoji (keycaps show as boxes; text likely saved without FE0F) — @tiptap/extension-emoji gitHubEmojis

2 participants