Repository navigation
feat: pick emoji from a button in the commit and reply composers - #252
hbenabdallah wants to merge 1 commit into
Conversation
2cba01e to
9da9b13
Compare
9da9b13 to
f506de6
Compare
|
Please fix the conflicts :) |
f506de6 to
7fdec7f
Compare
Done 👌 |
9e77a19 to
aec20f9
Compare
|
Hi @hbenabdallah, thanks for this. I'd started on an emoji button for the commit composer before I saw your PR, so I'd rather help get this one in than open a second one.
Here's how mine behaves, for comparison (commit composer, desktop, light theme, local dev data): It reuses the reactions picker, inserts where the caret was, stays open for several picks, puts your most-used emoji first, and opens with ⌘/Ctrl+Shift+E. A few things from my version that might be useful here, if you and the maintainers want them:
Two more that are probably product decisions, so they could be a follow-up rather than part of this PR:
My branch has these with unit tests if any of it helps: . I'm happy to open a PR against your branch, or leave it for a follow-up after this merges. Whatever's easiest for you and the maintainers. |
825a397 to
3afd77c
Compare
3afd77c to
7efdc89
Compare

Summary
Adding emoji meant typing a
:shortcode:from memory. The commit and reply composers now have an emoji button: search, a popular row and every emoji, inserted at the caret. The picker stays open after a click so several emoji can be added; Enter on a search picks the first result and closes it, returning to the text.Changes
EmojiPickerButton(Headless UI popover, 8px radius, capped at 22rem and to the viewport) in both composers. Pressing it keeps the caret in the textarea.useEmojiInsertioninserts over the selection and restores the caret in a layout effect once the body is committed, so long bodies keep the caret after the emoji.maxRawBodyLength,maxBodyLengthin issue mode), so long links don't block a pick.emoji-shortcodes.json, aliases deduplicated. No new dependency.Validation
Local checks on
7efdc89:bun run test:lint— passed with existing warnings.bun run test:types— passed.bun run test:unit— 132 passed.bunx vp test --run --config tests/draft-images.config.ts— 305 passed.bun run build— passed.git diff --check— passed.🔥hello. Layout shift while opening, picking and closing: 0.Hosted CI is separate from these local results.
Visual evidence
Local app, seeded data, base
productionvs this branch, two emoji clicked.Commit composer, light
Commit composer, dark
Reply composer
Device verification
Emulation only: Playwright Chromium at 390×844 with touch and mobile mode. The picker fits the width and ends above the bottom navigation. No physical device or simulator; the on-screen keyboard and safe areas are not covered.
Independent review
Fresh read-only Claude review of base
053bb3099b486442d62f0dfdb41d1166839152b9and head7efdc89ec6f2f44871ab9d426c311d34932cc9fdwith the captures above: CODE: PASS · VISUAL: PASS · OVERALL: PASS, no blockers. The first pass failed on picking before closing (a restored draft with the caret at 0 got the emoji at the end) and on the popover radius; both were fixed and re-reviewed.Limitations
insertAtSelectionhas unit tests; the hook and component are covered by the browser runs above.issue.change(slash-command detection), which an emoji can't trigger.