Repository navigation
Composer draws emoji with OpenEmoji while you type (0.2.2) - #277
Merged
Merged
Conversation
A textarea can only draw characters, so a picked emoji showed in the system font. The composer is now a contenteditable EmojiEditor: emoji are OpenEmoji <img>s (alt = the character), the value stays plain Unicode (what is encrypted is unchanged), typed/OS-keyboard/pasted emoji are swapped in place with the caret kept, Enter sends, Shift+Enter is a new line, paste is plain text only. A chunked web font (unicode-range WOFF2, CBDT/sbix/SVG) was tried first and dropped: ZWJ/VS16 sequences broke or fell back to the system font, any text with VS16 pulled every chunk (~16 MB), and Firefox renders neither CBDT nor sbix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThreatCrush Security Scan13 finding(s) MEDIUM: 9 | LOW: 4
Snippets are redacted; ThreatCrush never prints matched credential material. |
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.
Problem: the picker inserted our emoji, but the composer was a
<textarea>. A textarea can only draw characters, so what you saw while typing was the system emoji font.Fix:
EmojiEditor, a contenteditable field that draws emoji as OpenEmoji<img>tags with the character asalt.Code:
src/lib/emoji/editor-dom.jsholds the pure DOM model: render, serialize, value↔DOM offsets and caret restore.src/lib/components/chat/EmojiEditor.jsxis the component.Tried first and dropped: a chunked colour web font (WOFF2 split by
unicode-range, in CBDT, sbix and SVG flavours, built from the 72px art). I rendered it in Chromium:Tests: 7 new DOM-model tests, plus the picker test rewritten to insert into the editor at the caret.
test:ci: 622/622.next buildpasses.🤖 Generated with Claude Code