Skip to content

Add emoji picker with Autocomplete grid - #83538

Open
adamsilverstein wants to merge 463 commits into
trunkfrom
try/notes-emoji-picker-autocomplete-grid
Open

adamsilverstein wants to merge 463 commits into
trunkfrom
try/notes-emoji-picker-autocomplete-grid

Conversation

@adamsilverstein

@adamsilverstein adamsilverstein commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Test in WordPress Playground

Follows #76767, which shipped the fixed set of seven reactions in WordPress 7.2. This swaps that menu for a full searchable emoji picker and is aimed at 7.3. It started as an alternate take on #78176, so the comparison with that approach is kept below.

Fixes #80122

To keep this one reviewable, the filters for customizing the emoji set, exclusions, and labels moved to a stacked follow-up, #84043.

This round addresses the feedback from @mirka and @fcoveram. The picker now follows the documented Autocomplete patterns without patching the component's behavior, and the rough edges we hit are collected below under "Autocomplete notes" to pass back.

Claude reworked the picker and keeps this write-up current:

Latest update

  • Merged trunk, which also brings in the fix for the router-html-server e2e test that was failing on this branch.
  • The Emojibase setting moved to lib/compat/wordpress-7.3/ and is tagged @since 7.3.0, since 7.2 ships the fixed list.
  • The frequently used emoji selector returned a new array on every call, so the picker rebuilt its items on every store update. It now returns the stored value and derives the list with useMemo.
  • Small cleanups: the unused disabled prop is gone, the user's own reactions are looked up through a Set, and the stylesheet derives the grid width and row template from one column count.
  • Still to sort out: this PR is listed under backport-changelog/7.2/10930.md, but that Core PR has landed without the picker. A 7.3 entry needs a Core PR to point at.

What?

Rebuilds the Notes full emoji picker from #78176 on the Design System Autocomplete primitive from @wordpress/ui, in its grid mode (inline, always open), instead of the Composite grid plus SearchControl from @wordpress/components.

Why?

Addresses @fcoveram's keyboard feedback on #78176: getting from the search field to the grid took several Tab presses. With Autocomplete the search field is a combobox that drives the grid through aria-activedescendant, which is the macOS behavior from the review:

  • focus stays in the search field
  • the arrow keys move a highlight through the grid, crossing category boundaries
  • Enter picks the highlighted emoji
  • after typing, the top result is highlighted, so type + Enter picks it
  • one Tab reaches the skin-tone button

How?

  • Every reaction, including the seven curated ones, is stored as its Emojibase hex key (2764, 1f680), and reaction_summary is keyed the same way. The server accepts a valid hex key and nothing else.
  • If the Emojibase data cannot load, the picker shows "Couldn't load emojis." instead of falling back to the quick reactions.
  • Composed like the documented async items story (https://wordpress.github.io/gutenberg/?path=/docs/design-system-components-form-primitives-autocomplete--docs#async-items): the results go to Autocomplete.Root through items, and Autocomplete.Status and Autocomplete.Empty handle the loading state, a one-time announcement when the dataset finishes loading, and the empty state. The list stays mounted.
  • filter={ null } instead of mode="none", so aria-autocomplete stays accurate. Filtering is still ours (curated labels, Emojibase labels and tags): items holds the already-filtered results, as category groups while browsing and a flat list while searching.
  • The speak() count announcements, the item-press guard on onValueChange, and the scroll reset on each query are gone. The component's own behavior applies: Status announces, and autoHighlight scrolls the top hit into view.
  • Autocomplete.Group / GroupLabel / Row / Item render grid, rowgroup (labelled by the heading), row, and gridcell.
  • The input is the Design System Input with a search icon prefix and an Autocomplete.Clear suffix.
  • Spacing per @fcoveram's review: gap-sm between the search field and the skin-tone toggle, no extra space below each row or around the list, and group labels keep the Autocomplete inline padding.
  • The popover no longer jumps when it opens or collapses when a search has no results (@mirka's video). The grid's width is held on the list and on the loading state, so the popover keeps one size throughout.

Autocomplete notes

@mirka asked to hear about styling difficulties with the current Autocomplete. These are the places where the picker still has to add its own styles, plus a couple of behaviors worth documenting. None of them patch the component; they are listed here so they can go back into Autocomplete or its docs if that makes sense.

  1. Inline mode has no width when empty. With inline, nothing gives the list an intrinsic width, so when Empty shows (or while loading) the container collapses to the padding and a surrounding popover resizes and repositions. Popup has width variants; inline has nothing comparable. The picker sets min-inline-size on the List.
  2. Sticky group labels. Long grouped lists read better with the heading pinned while its section scrolls. GroupLabel has no background, so making it sticky means adding position: sticky, a z-index, and a background that matches whatever surface it sits on (here the @wordpress/components popover's $white, which is not a token).
  3. Item styles assume a list row. Item brings margin-inline, asymmetric inline padding for a leading icon, left alignment, and a size-md min height. A grid cell wants a centered square with no padding, so the picker overrides justify-content, height, padding, and font-size. The Grid story does the same with inline styles, so a cell size or variant for grid mode might be worth having.
  4. Row layout is left to the consumer. Row has no layout styles, so the column template and gap are the picker's. Probably intended, but a line in the docs (or a columns option) would help the next grid.
  5. Inline scroll container. The List styles are built for Popup's grid areas (scrollable / footer, and Empty uses grid-area: main). Inline, the consumer brings its own scroll container, so scrollbar-gutter and the scroll-padding that keeps a highlighted cell clear of a sticky heading are ours. Documenting ListBody as the inline scroll container might cover this.
  6. Status and synchronous filtering. Resolved: per @mirka's review the picker no longer announces a result count while typing, since filtering is synchronous. Status announces once when the dataset finishes loading, and Empty owns the no-results message.
  7. Pressing an item writes its value into the input. onValueChange fires with reason item-press and the item's string value. Harmless here, since picking closes the popover (in testing the field kept the query until it unmounted), but a picker that stays open would need to filter on reason. Worth a note in the docs.
  8. Performance with ~1,900 items. All 1,919 cells mount; rows use content-visibility: auto. In headless Chromium on a Mac: open 165-190ms, first keystroke ~40ms, later keystrokes under 20ms, clearing the search ~55ms. No virtualization needed at this size; it was not tried with grid.

Comparison with #78176

Measured before this round, in headless Chromium against the same wp-env, same Emojibase data (1,919 gridcells), dataset already cached, median of 7 opens, two runs each. Open time is from the click to the painted grid.

#78176 (Composite) This PR (Autocomplete grid)
Search field to grid Several Tabs, then roving tabindex Arrow keys from the field, focus stays in the field
Enter on a search result Tab into the grid first Picks the highlighted (top) result
Crosses categories with arrows Yes Yes
Input semantics searchbox + separate grid combobox with aria-haspopup="grid", aria-controls, aria-activedescendant
Open, median 329-344ms 210-274ms
Longest task on open 245-262ms 78-112ms
Type one letter ("h") ~124ms 67-76ms
Clear the search 95-98ms 105-121ms

Timings move by a few tens of ms between runs, so read them as "not slower" more than as a precise speedup. The numbers after switching to items are in note 8 above; they were taken with a different harness, so they are not directly comparable to the table.

Risks and open questions

  • The search field is a combobox, not a searchbox. Screen reader testing would be good, especially VoiceOver's reading of the active cell and the load announcement.
  • Escape closes the whole picker on the first press, even with a query typed.
  • Group headings use the Design System label style (per @mirka) rather than Heading/md from the design spec.

Testing Instructions

  1. Enable Notes, add a note to a block, and click the "Add reaction" button on it. The popover should open at its final size and position, without a jump (easiest to see with scrollbars set to "Always" in macOS settings).
  2. Without leaving the search field, press ArrowDown, then move around with the arrow keys; the highlight should cross from "Frequently used" into "Smileys & Emotion" and beyond.
  3. Press Enter; the highlighted emoji is added as a reaction.
  4. Reopen the picker and type "heart"; the top result is highlighted. Press Enter to add it.
  5. Type a query with no matches, eg. "zzzq". "No emoji found." shows and the popover keeps its width.
  6. Tab from the search field; focus moves to the skin-tone button.

Tested for the latest update: the collab sidebar unit tests (197 pass), ESLint, Stylelint and the typecheck. The block-notes.spec.js e2e spec last passed locally in Chromium, Firefox, and WebKit before this update and was not rerun locally since, so it is left to CI.

Screenshots

Captured with classic (always visible) scrollbars.

Open Arrow key highlight Search No results
Picker open Highlight moved with the arrow keys Search for heart, top result highlighted No emoji found, popover keeps its width

Screencast

Opening the picker, arrow keys across categories, searching, the empty state, and picking with Enter (keys shown bottom left):

pr83538-autocomplete-screencast-v3.mp4

AI Use

Code and description came out of a few rounds of back and forth with 🤖 Claude Code. I will review and test.

🤖 Generated with Claude Code

https://claude.ai/code/session_018vwYjSFEhWEs8GA798tZbi

adamsilverstein and others added 30 commits June 30, 2026 13:07
The prepare_links override repointed a note's _links.children from its
replies (type=note) to reactions (type=reaction), breaking core's
reply-embedding contract for clients relying on _embed. Reactions reach
the client through the reaction_summary field and an on-hover fetch, so
the override served nothing. Remove it and inherit core's behavior.

Addresses review feedback on PR #76767.
The reaction picker fetched the curated emoji list via OPTIONS
/wp/v2/comments, reading it from a reaction_emojis schema default.
OPTIONS is for discovering allowed operations, not data retrieval, and
the curated set is a fixed five-emoji row. Use the hardcoded
REACTION_EMOJIS list directly, drop the useReactionEmojis hook and the
client request, and remove the read-only reaction_emojis schema
property. The gutenberg_note_reaction_emojis filter still drives
server-side validation.

Addresses review feedback on PR #76767.
…plugin class

The reaction controller extended Gutenberg_REST_Comment_Controller_6_9,
but that plugin class was deleted when the minimum WordPress version was
bumped to 6.9 (notes graduated to core). Loading the plugin therefore
fataled with 'Class not found', which cascaded into every PHP, Playwright
and performance CI job.

Extend the core WP_REST_Comments_Controller directly, add a local
check_post_type_supports_notes() (core declares it private, so it cannot
be reused from a subclass), and drop the now-dead remove_action() for the
deleted 6.9 registration function.
Replace the .editor-collab-sidebar-panel__reaction-button CSS-class
locators with getByRole( 'button', { name: /<emoji>/ } ), following the
Playwright guidance to prefer user-facing attributes over CSS selectors.
The reaction pill's accessible label always contains the emoji name, so
the regex match is stable across the count and tooltip label variants.
Addresses review feedback from @manzoorwanijk.
The numbered-step comments were removed from the build script because
they get unwieldy when steps are inserted between existing ones. Drop the
lone leftover marker. Addresses review feedback from @manzoorwanijk.
Core's check_read_permission() only excludes the 'note' comment type from
the public read path, where an approved comment on a readable post is
world-readable. Reactions are an internal comment type too, so a direct
GET /wp/v2/comments/{reaction_id} fell through to that public path and
exposed reaction rows - including the reacting user's identity - to any
reader of a published post. The collection endpoint already blocks
non-editors from querying type=note|reaction, but the single-item-by-ID
path did not.

Override check_read_permission() to give reactions the same restriction
core gives notes: never public, readable only by the reacting user or a
user who can edit the comment. This also closes the direct-ID read path
flagged for internal types. Add coverage asserting logged-out and
subscriber reads are denied while the author and an editor are allowed.

Addresses review feedback from @scruffian.
The comment-count query filter bailed entirely whenever the query already
contained the note-only exclusion (comment_type != 'note'), which core and
older revisions of the filter inject. In that case the 'reaction' type was
never excluded, so reactions inflated the post comment count.

Iterate the internal comment types and append an exclusion clause for each
one not already present, instead of skipping when any exclusion exists.
This guarantees reactions are excluded too and keeps the filter idempotent
across multiple runs.

Addresses review feedback from @scruffian.
Store the validated reaction slug as the comment content instead of the
raw request value, so input like '<b>heart</b>' is persisted as 'heart'
and stays consistent for reaction grouping and counts.

Also reject hex-codepoint slugs that are not assignable Unicode code
points (above U+10FFFF or in the UTF-16 surrogate range), which the
shape-only regex previously accepted.

Addresses CodeRabbit review (M2, m6).
The cached tooltip user-name list was only cleared when toggling an
existing reaction pill. Adding the same slug through the picker updated
the count but left a stale tooltip. Thread noteId into AddReactionButton
and clear the cache entry on the picker path too.

Addresses CodeRabbit review (m8).
Wrap the reaction-emoji filter test in try/finally so a failed assertion
cannot leak the gutenberg_note_reaction_emojis filter into later tests.

Replace the flaky cumulative toHaveCount( 2 ) snackbar assertion in the
re-add e2e with per-add checks: assert and dismiss the first success
snackbar, then assert the re-add surfaces its own, instead of requiring
both auto-dismissing snackbars to be present simultaneously.

Addresses CodeRabbit review (m9, m10).
The pre-insert uniqueness check for reactions is not atomic: two
near-simultaneous requests for the same user, note, and emoji can both
pass the check and insert an approved row, since reactions deliberately
bypass core's wp_allow_comment() duplicate detection.

After a successful reaction insert, re-query the user's approved
reactions for the note and, when more than one matches the slug, keep the
earliest (lowest comment ID) and delete the rest. Every concurrent
request applies the same deterministic rule, so they all converge on the
same surviving row; a request whose own row lost the race repoints its
response to the survivor.

Add a test that injects a competing reaction via rest_pre_insert_comment
(after the pre-insert check, before the insert) and asserts a single row
survives and the response references it.

Addresses CodeRabbit review (M3).
…dditional-comment-type' into add-notes-emoji-reactions-full-picker

# Conflicts:
#	lib/compat/wordpress-7.1/block-comments.php
#	lib/compat/wordpress-7.1/class-gutenberg-rest-comment-controller-7-1.php
#	lib/load.php
#	package-lock.json
#	packages/editor/src/components/collab-sidebar/hooks.js
#	packages/editor/src/components/collab-sidebar/note.js
#	packages/editor/src/components/collab-sidebar/reaction-display.js
#	packages/editor/src/components/collab-sidebar/reaction-emoji-picker.js
#	packages/editor/src/components/collab-sidebar/style.scss
#	phpunit/experimental/class-wp-rest-comments-controller-gutenberg-test.php
#	test/e2e/specs/editor/various/block-notes.spec.js
Dismissing the 'Reaction added.' snackbar moves focus and selection
away from the note thread, which collapses the thread and unmounts
the reaction pill. The subsequent click on the pill then timed out
because the button was no longer rendered. Re-select the thread
after dismissing the snackbar so the pill is visible again, matching
how a user would remove a reaction from a collapsed thread.
Cover the client-side reaction components that previously had no unit
coverage: pill rendering (counts, pressed state, label pluralization,
unknown-slug fallback), toggle callback wiring, focus hand-off to the
parent thread when removing the last reaction, GitHub-style tooltip
name formatting with lazy loading and error fallback, the curated
picker's listbox semantics, slug-based selection, and the disabled
state of the add-reaction button.
The comment-count query filter rewrites wp_update_comment_count_now()'s
SQL to exclude internal comment types, but had no test pinning that
behavior. Recount a post holding a regular comment, a note, and a
reaction, and assert only the regular comment is counted.
…dditional-comment-type' into add-notes-emoji-reactions-try-addditional-comment-type
Use _x() with an 'emoji reaction' context so translators know
bare names like Heart or Eyes refer to emoji in the reaction
picker, not other UI concepts.
…dditional-comment-type' into add-notes-emoji-reactions-full-picker
Address design feedback from fcoveram on the stacked PR (#78176):
- Render the reaction icon at the default 24px like other icon
  buttons instead of a scaled-down 20px glyph.
- Drop the custom circular border and focus outline on the
  add-reaction trigger so it matches other small icon buttons and
  inherits the standard focus ring thickness.
- Make reaction pills small secondary Buttons instead of custom
  gray pills, and render the emoji glyph at 16px so it balances
  visually with the 24px trigger icon.
…dditional-comment-type' into add-notes-emoji-reactions-full-picker
- Make the '+' More emojis trigger a standard small icon Button like
  the smiley trigger, dropping the custom 28px circle and thick
  focus outline so both triggers match other editor icon buttons.
- Resolve emoji names for full-picker (hex-key) reactions from the
  Emojibase dataset so pill tooltips and accessible names read
  'thumbs up' instead of echoing the emoji character, matching the
  curated reactions.
- Prefetch the lazy picker chunk and the Emojibase dataset on
  hover/focus of the trigger, and show a sized 'Loading…' state
  while the popover populates, so opening the picker no longer
  feels slow.
- Extract Emojibase data loading into emojibase-data.js, shared by
  the lazy picker and the (eager) reaction pills without pulling
  the picker UI into the main bundle.
The component's default is-pressed style fills the pill with the dark
foreground color, which overpowers the emoji glyph. Use a light
admin-theme-color tint with an accent border instead, the familiar
'you reacted' treatment from other reaction UIs, while keeping the
standard secondary Button base and aria-pressed semantics.
…dditional-comment-type' into add-notes-emoji-reactions-full-picker
Serve the English Emojibase dataset from a Storybook static dir
mapping that mirrors the plugin's build/emojibase-data/<locale>/
layout, and pin the document language in the story so locale
detection is deterministic. Makes the full picker easy to review
and interact with without a WordPress environment.
The Editor/EmojiPicker story only shows the searchable grid in
isolation. Add an Editor/Notes Reactions story that composes the row
exactly as note.js renders it - the smiley trigger opening the curated
quick row, the plus trigger opening the full picker, and the reaction
count pills - with local state so picking an emoji from either popover
toggles pills interactively.
Two side-by-side triggers (smiley for the curated quick row, + for the
full picker) made it unclear which to click. Move the + inside the
quick-row popover as its trailing option: clicking it swaps the popover
content to the full searchable picker. The + stays outside the listbox
so the listbox only contains selectable options, prefetches the picker
chunk and dataset on hover/focus, and only renders when an Emojibase
URL is configured. The full picker now focuses its search field on
mount since the swap unmounts the previously focused + button.

Suggested by @jeffpaul in PR review.
adamsilverstein and others added 5 commits October 20, 2026 11:58
#76767 landed on trunk with Mamaduka's reactions refactor (NoteReactions
and useNoteReactions replace ReactionDisplay, AddReactionButton and
useReaction), so this keeps trunk's structure and moves the picker onto it:

- NoteReactions opens EmojiPicker instead of the curated Menu, and pills
  name non-curated emoji through Emojibase.
- reaction-emojis keeps trunk's label/sentenceLabel entries and regains the
  hex key helpers the picker needs.
- The comment controller accepts any valid emoji hex key again instead of
  the five curated keys, with PHPUnit cases for both.
- Picker styles, e2e tests and changelog entries move onto trunk's
  versions; changelog entries go under Unreleased.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01335F6jiRhAVVxJxKHsLxgW
…er-autocomplete-grid

# Conflicts:
#	packages/editor/src/components/collab-sidebar/reactions/note-reactions.tsx
Trunk now requires use-recommended-components suppressions to sit on a single import specifier, and new tool scripts to be TypeScript, so scope the skin tone picker's Menu suppression and rename the emojibase copy script to .mts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LvpAdxaahosj8kTQtm3NXW
Trunk now publishes @wordpress/block-editor type declarations, so the directive is unused and fails the typecheck.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LvpAdxaahosj8kTQtm3NXW
Reverts c153d3a. Filtering is synchronous, so a live count announces on every keystroke; mirka asked for it to be removed in review and Autocomplete.Empty already covers no results. The test now guards against the count coming back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LvpAdxaahosj8kTQtm3NXW
@jasmussen

Copy link
Copy Markdown
Contributor

I just wanted to reiterate something I suggested in the past, I can dig up my old comment if you like. Two things:

  • I would like us to omit thumbs-down from the suggested set, at least in these early days. The decision to include "dislike" features I find to be a pattern of negativity in web-apps that implicitly encourages such behaviour by being included as a default option. It's a personal opinion, and a strong one, but not a blocking one: when you feel like downvoting, write an explanatory comment instead, it's better discourse. And the thumbs-down can land one day when we open up the full emoji set.
  • If we include faces and bodies, let's prioritise the addition of skintone-pickers in a followup release.

@jeffpaul

Copy link
Copy Markdown
Member

Fully agree with @jasmussen on indexing towards positive sentiment reactions here! 👍🏼 (thumbs up emoji used very purposely here)

@adamsilverstein

Copy link
Copy Markdown
Member Author

I want to bring back a suggestion from the past which maybe deserves more consideration: instead of immediately opening the full emoji search experience, we could start with a limited subset that ends in a (+) (plus/more) button that brings up the full picker. the initial list could be dynamic gaining items you select from the full picker automatically like the current favorites section.

Discussed here: #78176 (comment) and if you expand the thread there is some discussion on the approach.

@fcoveram

Copy link
Copy Markdown
Contributor

I second @jasmussen thoughts around emojis conveying negative reactions.

…instead of immediately opening the full emoji search experience, we could start with a limited subset that ends in a (+) (plus/more) button that brings up the full picker.

Before adding that interaction layer, I'd first investigate and get feedback on whether this is really needed. If the need is there, then I would continue with the idea shared in #82324

annezazu added a commit to annezazu/gutenberg that referenced this pull request Nov 5, 2026
Adds a "Special characters" item to the rich text "More" menu. It opens
a searchable grid of about 200 characters in headed sections (currency,
punctuation, math, arrows, Latin and Greek letters, symbols), led by a
"Frequently used" section stored per user in preferences. The character
is inserted as plain text at the caret.

The picker is built on the Design System Autocomplete in grid mode, so
focus stays in the search field while the arrow keys move through the
grid, following the pattern reviewed in WordPress#83538.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adamsilverstein added a commit that referenced this pull request Nov 11, 2026
Keys drop U+FE0F, and it only went back after a single code point, so a keycap or flag added through the filter rendered unqualified, and emoji that already default to emoji presentation gained a stray selector. Restore it after each code point that defaults to text, matching the picker in #83538.
WordPress 7.2 ships the fixed list of reactions, so the full picker is
7.3 material. Also add the return type to the settings callback and
cast the hexdec() result the reaction key check compares.

Claude-Session: https://claude.ai/code/session_018vwYjSFEhWEs8GA798tZbi
The selector built a new array on every call, so useSelect saw a new
value on every store update and the picker rebuilt its items each time.

Claude-Session: https://claude.ai/code/session_018vwYjSFEhWEs8GA798tZbi
Drop the unused `disabled` prop, look up the user's own reactions
through a Set keyed by the value each cell already carries, and derive
the grid width and row template from one column count.

Claude-Session: https://claude.ai/code/session_018vwYjSFEhWEs8GA798tZbi
@adamsilverstein

Copy link
Copy Markdown
Member Author

It would be cool (even 🆒 or 😎) if any emoji could be selected. But this seems excessive maybe, and is shying away from decisions not options. A simple picker of the fixed set would greatly simplify this. Maybe it could be extensible so a plugin could add a full emoji picker for sites that want it.

@westonruter one alternative to providing a full searchable emoji picker would be to make the emoji list extensible with a filter which is what I am proposing in

This works well picking from a handful of options or even dozens, but doesn't include any of the niceties of this PR: searchability, castegories, skin tones, improved accessibility etc.

One other option discussed is having the display show the short list as we have it now, with a (+) sumpol at the end that lets you launch the full emoji picker experience.

Localizing emoji properly and making sure they render correctly everywhere are both large and complex problems. Introducing our own emoji infrastructure just for Notes reactions feels risky to me.

Good point @t-hamano - localization is a challenge here and Emojibase only gives us names and keywords - the glyphs are OS dependent.

I think we could address this though, I'm going to have Claude look into it and post the results here.

@adamsilverstein

adamsilverstein commented Nov 12, 2026 •

Copy link
Copy Markdown
Member Author

Claude looked into the rendering and localization questions, here is the strategy it came back with:

Both of @t-hamano's points hold up: the picker draws emoji as native text, the block editor screen removes core's emoji detection script (wp-admin/edit-form-blocks.php), and Emojibase only translates labels for 28 locales.

Rendering

  • Hide what the system can't draw. Each Emojibase entry carries the Emoji version that introduced it, so the picker can test-draw one emoji per version on a canvas and filter the grid to what is supported, with a separate check for flags like wp-emoji does. No images, no extra requests.
  • Possible follow-up: Twemoji images for reaction pills only, so a reaction added on a newer system doesn't show as an empty box on an older one.

Localization

  • Generate the label data from Unicode CLDR, which Emojibase is derived from and which covers many more languages.
  • Host it outside core on s.w.org like the font collections, as @t-hamano suggested. That also answers the 22MB question.
  • Fall back to English names and search for a locale with no data.

The rendering filter is a contained change to this PR. The data and hosting need a decision first, so a separate issue makes sense. Not yet tested: the canvas detection on Windows, and how many WordPress locales CLDR covers.

The picker draws emoji with the system font, which can be older than
the Emojibase dataset, so newer emoji and, on Windows, country flags
showed as empty boxes. Test-draw one emoji per Emoji version and one
flag of each kind on a canvas, and leave out what fails. When support
can't be detected, nothing is hidden.

Claude-Session: https://claude.ai/code/session_018vwYjVVM6w8AaTNGChMrze
A package release on trunk left the entry under the published 0.27.0
heading, which fails the changelog structure and presence checks.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Notes Phase 3 of the Gutenberg roadmap around block commenting Needs Design Needs design efforts. [Package] Editor /packages/editor [Package] UI /packages/ui [Type] Feature New feature to highlight in changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a full searchable emoji picker for note reactions