Repository navigation
feat: replace Emoji Mart with Frimousse in the emoji picker - #30526
Merged
Merged
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Rebuild the IconField emoji picker on Frimousse, a headless picker styled with Tailwind, and give keyboard users a visible focus indicator on every control and on the emoji reached with the arrow keys (DEQ-67). Emoji data is bundled from emojibase-data, so the picker makes no CDN requests. Custom icons from icons.json join the Unicode emoji as a final Icons category in the same list and search. Emoji map to the existing Apple PNGs through a generated list of shipped files, so stored values keep the /emojis/<file>.png and /icon/<file> formats. Remove emoji-mart, its data, types and the unused spritesheet.
Replace the generated emojiFiles.json (3,787 lines) with emoji-datasource's naming rule: file names keep FE0F only after characters that default to text presentation. A test checks every emoji and skin tone against static/emojis. Also commit the Vite chunk rename for frimousse and emojibase-data, which the previous commit missed.
aqandrew
force-pushed
the
aqandrew/deq-67-focus-indicator-is-missing
branch
from
October 30, 2026 23:09
8cb7bf6 to
4b6ce6f
Compare
Frimousse virtualizes the grid, so each tile fetched its own PNG as it scrolled into view and tiles popped in one request at a time. Draw emoji from the emoji-datasource-apple 15.1.2 sheet instead, preloaded with the picker chunk, as Emoji Mart did. The sheet has a versioned name because /emojis is served with immutable caching and its layout differs from the old spritesheet.png.
typos reads hex code points such as 1f9ba as misspelled words.
Frimousse 0.4.0 emits 0-based aria-rowindex and aria-colindex, which axe reports as aria-valid-attr-value. Patch both bundles so the attributes start at 1, and shift the row lookup its keyboard scroll-into-view uses by the same amount.
The viewport is a named tab stop, but aria-label is not supported on a div with no role.
…-indicator-is-missing # Conflicts: # site/src/components/IconField/IconField.test.tsx
The Frimousse patch diffs a minified bundle, whose short identifiers such as Ot and ue read as misspellings.
Copy Frimousse 0.4.0's source into site/src/vendor/frimousse, following the message-scroller pattern, and make the 1-based aria-rowindex and aria-colindex fix there as three LOCAL CHANGE lines. The index exports only what IconField uses. This removes the pnpm patch of the minified bundle and the frimousse dependency.
The directory no longer exists.
…pos" This reverts commit c91f3cf.
This reverts commit 0b71d7d.
…-indicator-is-missing # Conflicts: # site/package.json # site/pnpm-lock.yaml
…is-missing' into aqandrew/deq-67-focus-indicator-is-missing # Conflicts: # site/pnpm-lock.yaml
jeremyruppel
reviewed
Nov 4, 2026
jeremyruppel
reviewed
Nov 4, 2026
jeremyruppel
reviewed
Nov 4, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
An alternative to #30361 for DEQ-67 ("Focus indicator is missing" on the template builder Customizations step). Instead of patching focus handling into Emoji Mart's shadow DOM, this replaces Emoji Mart (last released April 2024) with Frimousse, a headless picker that we style with Tailwind and our theme tokens.
Fixes DEQ-67
Fixes DEQ-303
Fixes DEQ-201
Fixes DEQ-83
Also fixes 181
aria-allowed-attrtickets from Emoji Mart: 180 foraria-posinset/aria-setsizeon its emoji buttons, and DEQ-370 foraria-selectedon its category buttons. Frimousse renders agridofgridcells instead, and the category buttons usearia-current.scrollable-region-focusable): the emoji grid is now a tab stop.aria-current.aria-allowed-attr tickets (181)
Fixes DEQ-7
Fixes DEQ-8
Fixes DEQ-9
Fixes DEQ-11
Fixes DEQ-17
Fixes DEQ-18
Fixes DEQ-19
Fixes DEQ-26
Fixes DEQ-27
Fixes DEQ-30
Fixes DEQ-31
Fixes DEQ-33
Fixes DEQ-34
Fixes DEQ-41
Fixes DEQ-44
Fixes DEQ-47
Fixes DEQ-53
Fixes DEQ-57
Fixes DEQ-58
Fixes DEQ-65
Fixes DEQ-69
Fixes DEQ-71
Fixes DEQ-72
Fixes DEQ-73
Fixes DEQ-75
Fixes DEQ-77
Fixes DEQ-78
Fixes DEQ-80
Fixes DEQ-84
Fixes DEQ-85
Fixes DEQ-87
Fixes DEQ-89
Fixes DEQ-90
Fixes DEQ-96
Fixes DEQ-97
Fixes DEQ-98
Fixes DEQ-103
Fixes DEQ-109
Fixes DEQ-110
Fixes DEQ-113
Fixes DEQ-114
Fixes DEQ-116
Fixes DEQ-117
Fixes DEQ-119
Fixes DEQ-120
Fixes DEQ-123
Fixes DEQ-126
Fixes DEQ-129
Fixes DEQ-131
Fixes DEQ-135
Fixes DEQ-136
Fixes DEQ-153
Fixes DEQ-154
Fixes DEQ-157
Fixes DEQ-158
Fixes DEQ-160
Fixes DEQ-165
Fixes DEQ-170
Fixes DEQ-171
Fixes DEQ-173
Fixes DEQ-175
Fixes DEQ-179
Fixes DEQ-181
Fixes DEQ-185
Fixes DEQ-187
Fixes DEQ-188
Fixes DEQ-189
Fixes DEQ-192
Fixes DEQ-200
Fixes DEQ-202
Fixes DEQ-206
Fixes DEQ-212
Fixes DEQ-217
Fixes DEQ-220
Fixes DEQ-227
Fixes DEQ-229
Fixes DEQ-239
Fixes DEQ-240
Fixes DEQ-241
Fixes DEQ-245
Fixes DEQ-246
Fixes DEQ-247
Fixes DEQ-249
Fixes DEQ-251
Fixes DEQ-258
Fixes DEQ-262
Fixes DEQ-265
Fixes DEQ-270
Fixes DEQ-280
Fixes DEQ-282
Fixes DEQ-286
Fixes DEQ-296
Fixes DEQ-314
Fixes DEQ-315
Fixes DEQ-320
Fixes DEQ-322
Fixes DEQ-325
Fixes DEQ-326
Fixes DEQ-327
Fixes DEQ-334
Fixes DEQ-335
Fixes DEQ-343
Fixes DEQ-345
Fixes DEQ-347
Fixes DEQ-349
Fixes DEQ-353
Fixes DEQ-359
Fixes DEQ-360
Fixes DEQ-362
Fixes DEQ-367
Fixes DEQ-368
Fixes DEQ-369
Fixes DEQ-370
Fixes DEQ-372
Fixes DEQ-373
Fixes DEQ-375
Fixes DEQ-377
Fixes DEQ-380
Fixes DEQ-382
Fixes DEQ-389
Fixes DEQ-404
Fixes DEQ-405
Fixes DEQ-410
Fixes DEQ-413
Fixes DEQ-414
Fixes DEQ-415
Fixes DEQ-416
Fixes DEQ-421
Fixes DEQ-422
Fixes DEQ-423
Fixes DEQ-425
Fixes DEQ-429
Fixes DEQ-432
Fixes DEQ-435
Fixes DEQ-439
Fixes DEQ-442
Fixes DEQ-444
Fixes DEQ-448
Fixes DEQ-450
Fixes DEQ-451
Fixes DEQ-457
Fixes DEQ-460
Fixes DEQ-464
Fixes DEQ-465
Fixes DEQ-466
Fixes DEQ-468
Fixes DEQ-472
Fixes DEQ-475
Fixes DEQ-478
Fixes DEQ-485
Fixes DEQ-488
Fixes DEQ-490
Fixes DEQ-491
Fixes DEQ-501
Fixes DEQ-506
Fixes DEQ-507
Fixes DEQ-510
Fixes DEQ-513
Fixes DEQ-515
Fixes DEQ-518
Fixes DEQ-521
Fixes DEQ-523
Fixes DEQ-527
Fixes DEQ-528
Fixes DEQ-529
Fixes DEQ-530
Fixes DEQ-534
Fixes DEQ-538
Fixes DEQ-544
Fixes DEQ-547
Fixes DEQ-549
Fixes DEQ-551
Fixes DEQ-553
Fixes DEQ-561
Fixes DEQ-562
Fixes DEQ-571
Fixes DEQ-580
Fixes DEQ-582
Fixes DEQ-584
Fixes DEQ-593
Fixes DEQ-595
ring-content-linkfocus ring: the category buttons, search field, clear and skin-tone buttons, and the emoji grid. In the grid, DOM focus stays in the search field or grid while the arrow keys move the active emoji, the same model as Emoji Mart. The active emoji gets the same ring, measured atrgb(97,166,250)onrgb(9,9,11)in dark mode andrgb(36,99,235)on white in light mode. Frimousse announces the active emoji through a live region.icons.jsonicons. The skin-tone selector stays./emojis/<file>.png(the existing Apple PNGs) and icons as/icon/<file>. The file names instatic/emojisfollow emoji-datasource's rule: they keep U+FE0F only after characters that default to text style (263a-fe0f), while Emojibase adds it after every character.emojiToValuedrops it after characters that are already emoji-style. Emoji newer than the shipped Apple set (15.1) are left out, as are 3 symbols the set has no image for.emojibase-datainstead of Frimousse's default jsDelivr fetch, which matters for air-gapped deployments.static/emojis/sheet-15.1.2.png(4.5 MB, from emoji-datasource-apple 15.1.2, the same release as the PNGs), preloaded with the picker chunk as Emoji Mart did. Frimousse virtualizes the grid, so with one PNG per tile every category jump cost about 100 requests (2.7 s at 150 ms latency); with the sheet it costs none. The sheet has a versioned name because/emojisis served with immutable caching and its layout differs from the oldspritesheet.png.pnpm update-emojisregenerates the sheet and its cell map (emojiSheet.ts) withscripts/generate-emoji-sheet.mjs. Custom icons still render as images.emoji-mart,@emoji-mart/*, their type shim, and the oldstatic/emojis/spritesheet.png(emoji-datasource 15.0.1 layout).aria-rowindexandaria-colindexfrom 0, which axe reports asaria-valid-attr-value(ARIA requires 1 or more).site/patches/[email protected](a pnpm patch) makes both start at 1 indist/index.jsanddist/index.cjs, and shifts the[aria-rowindex=...]lookup that keyboard scroll-into-view uses by the same amount. Renumbering in ourRowcomponent alone would break that lookup. The bundles are minified to one line, so the patch file is large, but it changes three expressions per file:"aria-rowindex":t?void 0:etoe+1,"aria-colindex":ttot+1, and[aria-rowindex="${R}"]to${R+1}. The source-level fix and regression coverage are submitted upstream in liveblocks/frimousse#39. Remove the patch only after upgrading to a Frimousse release containing the fix.site/src/vendor(as withmessage-scroller) was considered and would have made the same fix as three readable lines, but was rejected because we would own about 3,900 copied lines and re-sync them by hand on every upgrade.Lazy chunks (gzip):
EmojiPicker16 KB (including the 13 KB sheet cell map) +emoji-picker107 KB, versus about 134 KB for Emoji Mart and its data.Known differences and risks:
emojiis the icon path, rendered as images by ourEmojicomponent. This works in 0.4.0 because Frimousse only filters out unsupported emoji in its built-in data loader.frimousseis pinned, and tests fail if icons stop appearing in search or stop returning/icon/...values.Verification
pnpm install --frozen-lockfile, all 14 IconField and emoji-data tests,pnpm check,pnpm lint,pnpm format:check, andmake lint/emdashpass. Only the patch preamble and generated lockfile hashes changed; the installed ESM and CommonJS bundles are byte-for-byte unchanged.pnpm check,lint:oxlint,lint:types,lint:knip,lint:circular-deps, andlint:compilerpass, andvite buildsucceeds.IconField.test.tsxcovers picking an icon, picking an emoji that keeps U+FE0F in its file name, picking with the keyboard, clearing the search, and marking a category as current.emojiData.test.tschecks that every emoji and skin tone maps to a PNG instatic/emojis, the FE0F rule, and that deprecated icons are left out. Removing an entry from the list of unshipped symbols makes the first test fail, naming the emoji.--project=storybook) forIconField.stories.tsxpasses.OpenPickerandKeyboardActiveEmoji, in dark and light themes and at 1280px and 320px widths: the picker has no violations. The remaining results are outside it:aria-dialog-nameon the sharedPopoverContent, plus the page-levelregionandbypass. With the patch, 150 ArrowDown and 150 ArrowUp presses through the full list, and 40 of each in the "face" results, kept the active emoji fully in view on every step. The grid viewport is nowrole="group", because axe flaggedaria-labelon a div with no role.emojiData.test.tschecks that every emoji and skin tone has a sheet cell and spot-checks coordinates. A Playwright script compared all 3,775 sheet cells with their PNGs, and swapped 72 rendered tiles in place for their PNGs; every tile matched its own cell better than any neighbor. With 150 ms emulated latency, switching between Flags, Smileys, and Objects made no emoji requests (before: about 100 per category).Implementation plan and decision log
Why Frimousse. It's a headless set of React parts styled with Tailwind, with a virtualized grid, keyboard navigation, and a live-region announcer. Prototypes compared it with emoji-picker-react 4.22.3, which also met the requirements but can only be restyled through its own CSS variables. @ferrucc-io/emoji-picker was ruled out over doubts about long-term maintenance.
Plan as built:
Dependencies: add pinned
frimousse0.4.0 andemojibase-data17.0.0, plusemojibase17.0.0 as a dev dependency for its types; remove Emoji Mart and its type shim; rename the Vite chunk group.Data (
emojiData.ts): build FrimousseEmojiDatafromemojibase-data/en/data.jsonandmessages.json. Drop the "component" group, emoji newer than 15.1, and the 3 symbols the Apple set lacks. Map each emoji to its PNG by emoji-datasource's U+FE0F naming rule, and offer skin tones only when all five single-tone variants are shipped. Append the non-deprecatedicons.jsonentries as a final "Icons" category, with the same keywords as Emoji Mart.Picker (
EmojiPicker.tsx): categorynavbuttons witharia-current. Clicking one clears the search and scrolls to the category; scrolling updates the current button. The search uses the sharedInputGroupwith our own clear button, and the native one is hidden. The grid renders images throughExternalImage, without lazy loading, and the icons are preloaded when the chunk loads, because a cold cache showed empty tiles for about 0.5 s. The skin-tone button cycles tones withuseSkinTone. The grid is a tab stop.IconField.tsx:onEmojiSelectnow passes the stored value directly. The hidden pre-warm picker is unchanged.Tests and stories as listed under Verification.
Spritesheet (added after hands-on testing showed tiles popping in): draw emoji from emoji-datasource-apple 15.1.2's
sheets-256/64.pngwith a generated cell map, sized with percentages so one cell fills the tile. Native emoji glyphs were ruled out because they would not match the stored Apple PNGs; preloading individual PNGs would still miss on category jumps.Changes from the original plan: replaced the planned generated list of shipped files (3,787 lines of JSON) with emoji-datasource's U+FE0F naming rule, which a test checks against
static/emojis. Usednavbuttons witharia-currentinstead ofrole="tab", since there are no tab panels. Added a tab stop on the grid. Accepted substring search.