Repository navigation
Notes: Add filters to customize emoji reactions - #84043
adamsilverstein wants to merge 18 commits into
Conversation
Let sites shape note reactions through two filters: - `gutenberg_note_reaction_emoji_settings` sets the named emoji that seed "Frequently used" and are always accepted, and limits or excludes every other emoji with `allow_unlisted` and `exclude`. The picker only offers what the REST API accepts. - `gutenberg_emoji_picker_label_overrides` labels emoji for locales Emojibase does not translate, seeded with the named list. Named emoji are identified by their Emojibase hexcode, matching how every reaction is stored, so no UTF-8 decoding is needed server-side. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VZXqJi4dn3qcNsYZHa579m
The server sets noteReactionEmojiRules, but the block editor settings allowlist dropped it, so the picker always saw the default rules and offered emoji the REST API rejects, such as one a site excluded. Add it to the allowlist, with an e2e test that an excluded emoji is no longer offered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VZXqJi4dn3qcNsYZHa579m
The new editor settings are part of the package's public surface, so note them for consumers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VZXqJi4dn3qcNsYZHa579m
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 🏷️ LabelsThis pull request needs exactly one label indicating its type, and has 0.
Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you. 📦 Bundle sizeSize Change: +507 B (+0.01%) Total Size: 8.74 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Navigates the list via UP/DOWN arrow keys from action buttons in
|
…ete-grid' into pr-84043 # Conflicts: # packages/editor/src/components/collab-sidebar/reactions/add-reaction-button.tsx # packages/editor/src/components/collab-sidebar/reactions/emoji-picker.tsx
Pick up the parent's trunk merge and changelog fixes. Claude-Session: https://claude.ai/code/session_01RmMwj4CN9cF8b1Sx58Pvik
The server-side labels seed the picker's label overrides, which take
precedence over the client's curated labels. Capitalized "Heart" broke
the exact-name lookups in the emoji reaction e2e tests and mismatched
the lowercase Emojibase names around it, which also read mid-sentence
("reacted with heart").
Claude-Session: https://claude.ai/code/session_01RmMwj4CN9cF8b1Sx58Pvik
…eaction-filters Bring in the emoji search result count announcement from #83538. Claude-Session: https://claude.ai/code/session_01RmMwj4CN9cF8b1Sx58Pvik
The picker test merged in from #83538 mocks `useEmojibaseConfig` with only `baseUrl`, but this branch adds `labelOverrides` to the config, so the mock no longer type checks. Claude-Session: https://claude.ai/code/session_01RmMwj4CN9cF8b1Sx58Pvik
…s-emoji-reaction-filters
Trunk capitalized the reaction labels, and the server's named list seeds the picker's label overrides, so lowercase defaults renamed every default emoji in the picker.
WordPress 7.2 ships the fixed list of reactions, so the filters move to the 7.3 compat directory. Named emoji entries now use `hex_key`, the same shape as the `wp_note_reaction_emojis` filter in #84200, and the key normalizer matches the one that PR adds: it rejects values that are not code points and handles over-padded ones. Functions gain return types and full array shapes, following the review of #84200. Claude-Session: https://claude.ai/code/session_018vwYjSFEhWEs8GA798tZbi
Covers the `hex_key` entries the server sends and the rules that must agree with the REST API's check. Claude-Session: https://claude.ai/code/session_018vwYjSFEhWEs8GA798tZbi
The exclusion only matched a whole key, so a direct REST request could append a code point that does not change how the emoji renders, such as U+FE0E, and get an excluded emoji accepted. The picker applies the same check so it keeps offering only what the REST API accepts. Claude-Session: https://claude.ai/code/session_018vwYjSFEhWEs8GA798tZbi
…ete-grid' into try/notes-emoji-reaction-filters
…s-emoji-reaction-filters # Conflicts: # lib/load.php # packages/editor/src/components/collab-sidebar/reactions/emoji-picker.tsx # packages/editor/src/components/collab-sidebar/reactions/frequent-emojis.ts
…ete-grid' into HEAD # Conflicts: # packages/editor/CHANGELOG.md # packages/editor/src/components/collab-sidebar/reactions/emoji-picker.tsx
…s-emoji-reaction-filters
Split out of #83538 to keep that PR reviewable - this adds the filters for customizing emoji reactions on top of it, to review once the core picker lands. Updated to pick up the review feedback from the smaller filter in #84200.
Claude carried the #84200 feedback over and refreshed this write-up:
AI Use
Code and description both came out of a few rounds with 🤖 Claude Code, including this update. I will review and test.
🤖 Generated with Claude Code
https://claude.ai/code/session_018vwYjSFEhWEs8GA798tZbi