Skip to content

Notes: Add filters to customize emoji reactions - #84043

Open
adamsilverstein wants to merge 8 commits into
try/notes-emoji-picker-autocomplete-gridfrom
try/notes-emoji-reaction-filters
Open

adamsilverstein wants to merge 8 commits into
try/notes-emoji-picker-autocomplete-gridfrom
try/notes-emoji-reaction-filters

Conversation

@adamsilverstein

@adamsilverstein adamsilverstein commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

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.

Claude moved the filters over and wrote this up:

What?

Stacked on #83538. Adds two filters that let a site shape emoji reactions on Notes:

  • gutenberg_note_reaction_emoji_settings - the named emoji that seed "Frequently used", carry their own labels, and are always accepted, plus allow_unlisted (false limits reactions to the named list) and exclude (Emojibase hexcodes to reject, skin-tone variants included).
  • gutenberg_emoji_picker_label_overrides - labels for emoji in locales Emojibase does not translate, seeded with the named list.

The picker only offers what the REST API accepts, so both sides read the same settings.

Why?

These were part of #83538, where they made up a large share of the diff while being an optional extension point. Moving them here lets #83538 focus on the picker and the reaction storage.

How?

  • Named emoji are identified by their Emojibase hexcode (array( 'hexcode' => '1F984', 'label' => 'Unicorn' )), matching Add emoji picker with Autocomplete grid  #83538 where every reaction is now stored as its hex key. That also means the hand-written UTF-8 decoder from the earlier version is not needed.
  • The server passes noteReactionEmojis, noteReactionEmojiRules, and noteEmojiLabelOverrides through the block editor settings; the editor reads them for the "Frequently used" seeds, the grid filter, and labels in the picker and the reaction pills.
  • The controller runs a valid hex key through gutenberg_is_note_reaction_hex_key_allowed() before accepting it.
  • Bug fix: noteReactionEmojiRules was set server-side but missing from the BLOCK_EDITOR_SETTINGS allowlist in use-block-editor-settings.js, so the editor never received the rules and the picker offered emoji the REST API then rejected. That fix is its own commit, with an e2e test that an excluded emoji is not offered (fails without the allowlist entry, passes with it).

Testing Instructions

  1. Add a filter, eg. in a mu-plugin:
    add_filter( 'gutenberg_note_reaction_emoji_settings', function ( $settings ) {
        $settings['emojis'][]  = array( 'hexcode' => '1F984', 'label' => 'Unicorn' );
        $settings['exclude'][] = '1F44E';
        return $settings;
    } );
  2. Add a note to a block and open the "Add reaction" picker. "Unicorn" shows in "Frequently used" next to the five defaults.
  3. Search "thumbs down"; nothing is offered. Search "thumbs up"; it is still there.
  4. React with the unicorn; the pill shows 🦄 and its tooltip says "Unicorn".
  5. Change the filter to set allow_unlisted to false; the picker only offers the named emoji.

Tested locally: PHPUnit (Emoji_Picker_Data_Test, Tests_Note_Reactions_Feed, WP_Test_REST_Comments_Controller_Gutenberg) 92 pass, and the "Emoji Reactions" e2e tests in Chromium 16 pass.

Testing Instructions

Test in WordPress Playground

AI Use

Claude Code wrote both the code and this description, moving the filters over from #83538. I will review and test.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VZXqJi4dn3qcNsYZHa579m

adamsilverstein and others added 2 commits October 2, 2026 17:07
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
@github-actions github-actions Bot added [Package] Editor /packages/editor [Package] E2E Tests /packages/e2e-tests labels Oct 3, 2026
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
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

📦 Bundle size

Size Change: +438 B (+0.01%)

Total Size: 8.53 MB

📦 View Changed
Filename Size Change
build/scripts/editor/index.min.js 650 kB +438 B (+0.07%)

9b0cc37 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 2bf38ed try/notes-emoji-picker-autocomplete-grid % Change
timeToFirstByte 42 ms +5.36% -2.98% 41.8 ms +5.5% -4.31% 0.48%
largestContentfulPaint 72 ms +5.56% -5.56% 68 ms +8.82% -0% 5.88%
lcpMinusTtfb 28.2 ms +24.65% -3.37% 27.15 ms +6.08% -4.42% 3.87%
wpBeforeTemplate 21.27 ms +9.17% -2.68% 21.09 ms +11.19% -2.28% 0.85%
wpTemplate 17.37 ms +6.39% -5.81% 16.85 ms +4.04% -5.1% 3.09%
wpTotal 38.78 ms +5.78% -3.53% 38.58 ms +5.7% -4.77% 0.52%
wpMemoryUsage 7.62 MB +0% -0% 7.62 MB +0% -0% 0.01%
wpDbQueries 17 +0% -0% 17 +0% -0% 0%

front-end-classic-theme

Metric 2bf38ed try/notes-emoji-picker-autocomplete-grid % Change
timeToFirstByte 30.8 ms +9.9% -3.41% 34.8 ms +4.89% -2.01% -11.49%
largestContentfulPaint 68 ms +5.88% -0% 80 ms +0% -5% -15%
lcpMinusTtfb 38.25 ms +1.31% -1.96% 43.5 ms +4.14% -3.56% -12.07%
wpBeforeTemplate 18.16 ms +10.41% -1.43% 18.44 ms +8.62% -1.74% -1.52%
wpTemplate 9.69 ms +4.33% -2.99% 13.61 ms +1.69% -1.98% -28.8%
wpTotal 28.32 ms +9.46% -3.53% 31.98 ms +5.47% -1.69% -11.44%
wpMemoryUsage 6.15 MB +0% -0% 6.26 MB +0% -0% -1.76%
wpDbQueries 10 +0% -0% 14 +0% -0% -28.57%

media-processing

Metric 2bf38ed try/notes-emoji-picker-autocomplete-grid % Change
mediaProcessingJpeg 335.88 ms +1.55% -2.75% 328.14 ms +1.02% -0.35% 2.36%
mediaProcessingAvif 4827.85 ms +0.21% -0.34% 4843.59 ms +0.37% -0.43% -0.32%
mediaProcessingJpegToAvif 3298.75 ms +0.28% -0.33% 3302.23 ms +0.71% -0.25% -0.11%

media-upload

Metric 2bf38ed try/notes-emoji-picker-autocomplete-grid % Change
jpegUploadProcessing 1389.89 ms +1.18% -0.59% 1391.51 ms +0.94% -1.06% -0.12%
pngUploadProcessing 174.84 ms +7.38% -2.45% 175.24 ms +2.68% -1.17% -0.23%
largeJpegUploadProcessing 1392.05 ms +0.43% -0.71% 1388.37 ms +0.2% -0.11% 0.27%
multipleImageUploadProcessing 1446.9 ms +1.59% -0.23% 1476.21 ms +0.41% -2.31% -1.99%

post-editor

Metric 2bf38ed try/notes-emoji-picker-autocomplete-grid % Change
serverResponse 530.67 ms +4.35% -4.79% 517.87 ms +6.36% -4.52% 2.47%
firstPaint 254.32 ms +21.04% -16.55% 214.86 ms +24.33% -5.91% 18.37%
domContentLoaded 1231.44 ms +2.43% -2.37% 1173.97 ms +1.97% -1.34% 4.9%
loaded 1232.82 ms +2.45% -2.33% 1175.26 ms +1.97% -1.34% 4.9%
firstContentfulPaint 508.67 ms +2.38% -1.39% 484.41 ms +4.15% -3.87% 5.01%
firstBlock 3615.57 ms +1.92% -0.37% 3449.99 ms +1.53% -1.32% 4.8%
type 19.24 ms +5.67% -2.13% 18.52 ms +4.86% -5.62% 3.89%
typeWithoutInspector 20.37 ms +3.49% -3.09% 18.77 ms +5.11% -4% 8.52%
typeWithTopToolbar 27.12 ms +3.54% -5.97% 25.34 ms +5.8% -4.5% 7.02%
typeContainer 9.74 ms +9.96% -1.95% 9.51 ms +3.05% -7.47% 2.42%
focus 131.85 ms +0.33% -9.37% 120.45 ms +4.2% -5.23% 9.46%
firstFocus 234.31 ms +0% -0% 234.03 ms +0% -0% 0.12%
selectAll 607.99 ms +2.18% -3.8% 577.9 ms +0.77% -5.36% 5.21%
listViewOpen 84.52 ms +2.74% -4.34% 81.22 ms +3.39% -4.12% 4.06%
inserterOpen 43.93 ms +6.69% -7.03% 41.65 ms +11.38% -10.06% 5.47%
inserterHover 13.93 ms +6.75% -7.47% 11.89 ms +11.19% -9.08% 17.16%
inserterSearch 9.6 ms +4.69% -8.85% 8.63 ms +3.01% -13.09% 11.24%
loadPatterns 707.32 ms +13.97% -7.32% 620.82 ms +4.65% -3.16% 13.93%
wpTotal 518.68 ms +4.07% -4.78% 506.43 ms +6.44% -4.67% 2.42%
wpMemoryUsage 13.39 MB +0% -0% 13.39 MB +0% -0% 0.03%
wpDbQueries 54 +0% -1.85% 54 +0% -1.85% 0%

site-editor

Metric 2bf38ed try/notes-emoji-picker-autocomplete-grid % Change
serverResponse 421.99 ms +3.61% -5.29% 421.26 ms +1.76% -3.86% 0.17%
firstPaint 238.6 ms +30.02% -14.67% 234.53 ms +3.14% -4.05% 1.74%
domContentLoaded 1175.1 ms +3.28% -2.31% 1153.36 ms +1.31% -1.01% 1.88%
loaded 1176.31 ms +3.26% -2.31% 1154.61 ms +1.3% -1.03% 1.88%
firstContentfulPaint 492.43 ms +3.33% -4.75% 467.42 ms +1.96% -2.58% 5.35%
firstBlock 4392.73 ms +2.8% -1.5% 4327.56 ms +1.83% -1.73% 1.51%
type 18.38 ms +5.71% -4.9% 18.08 ms +4.65% -4.2% 1.66%
navigate 119.88 ms +19.74% -3% 122.37 ms +11.64% -3.29% -2.03%
loadPatterns 1304.73 ms +4.55% -4.09% 1338.14 ms +3.41% -10.85% -2.5%
loadPages 1035.59 ms +0.79% -3.92% 1003.48 ms +0.26% -0.75% 3.2%
wpTotal 410.61 ms +3.64% -5.31% 409.92 ms +1.78% -3.89% 0.17%
wpMemoryUsage 12.44 MB +0% -0% 12.43 MB +0% -0% 0.03%
wpDbQueries 43 +2.33% -0% 43 +2.33% -0% 0%

9b0cc37 Run

🏁 Flaky tests

Some 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.

should cut and paste individual blocks with collapsed selection in /test/e2e/specs/editor/various/copy-cut-paste.spec.js, passed after 1 failed attempt.
Error: expect(string).toMatchSnapshot(expected) failed

  @@ -1,3 +1,3 @@
   <!-- wp:paragraph -->
  -<p>2Cut - collapsed selection</p>
  +<p>2</p>
   <!-- /wp:paragraph -->


    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/copy-cut-paste.spec.js:45:49

9b0cc37 Run

…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
@adamsilverstein
adamsilverstein marked this pull request as ready for review October 7, 2026 15:35
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

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

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

[Package] E2E Tests /packages/e2e-tests [Package] Editor /packages/editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant