Repository navigation
Notes: Add a filter for the limited preset emoji reaction list - #84200
Open
adamsilverstein wants to merge 210 commits into
Open
adamsilverstein wants to merge 210 commits into
adamsilverstein wants to merge 210 commits into
Conversation
Introduce a new component that displays a horizontal row of emoji buttons for adding reactions to notes. Features include: - Curated emoji set: 👍 👎 ❤️ 🎉 😄 😕 👀 🚀 - Keyboard navigation with arrow keys, Home, and End - Accessible with role="listbox" and role="option" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Introduce a component that displays current reactions with counts as pill-shaped buttons. Features include: - Shows reaction counts for each emoji - Highlights user's own reactions with distinct styling - Click to toggle (add/remove) reaction - "+" button opens emoji picker dropdown Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Introduce a popover component that shows who reacted and when. Features include: - Displays reactions grouped by emoji - Shows user avatars and names - Uses humanTimeDiff() for relative timestamps (e.g., "3 days ago") - Fetches user data for all reactors Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extend the useBlockCommentsActions hook with three new functions:
- onAddReaction: Add a reaction to a comment
- onRemoveReaction: Remove user's reaction from a comment
- onToggleReaction: Toggle reaction (add if not present, remove if present)
Reactions are stored in comment meta._wp_reactions with structure:
{ emoji: [{ userId, timestamp }] }
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add SCSS styles for: - Reactions container with flexbox layout - Pill-shaped reaction buttons with active state - Add reaction button with dashed border - Emoji picker dropdown - Reaction details popover with user avatars Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…yling Replace the plus icon with a Google Docs-inspired smiley face SVG, change focusOnMount to 'firstElement' so the emoji picker captures focus and prevents the note from collapsing, and restyle the button to be perfectly round with a clean white background that appears on hover. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the "Add reaction" smiley button from below the note content to the upper-right header area alongside the resolve and actions buttons. Also register _wp_reactions as comment meta in PHP so the REST API accepts it, and fix the 500 error caused by spreading all comment meta (including potentially invalid _wp_note_status) when saving reactions. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Add variant="tertiary" to the reaction pill Button components so the WordPress default dark button styling doesn't override the custom light gray background. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
The Button component automatically adds the is-pressed class when aria-pressed is true, which sets a dark background (#1E1E1E). Override with matching specificity to keep the light blue active state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Increase height to 32px, use equal padding on all sides, and reduce gap between emoji and count to bring the aspect ratio closer to 1:1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The reactions meta registration is a new feature targeting WordPress 7.0, not a 6.9 backport. Move it to its own file in lib/compat/wordpress-7.0/ per reviewer feedback.
The editor assumes users are logged in by default, so these guards are redundant. Matches the pattern used by other collab sidebar actions.
Reactions update comment metadata without adding, removing, or resizing comments, so reflowing is unnecessary.
Replace individual getUser() calls with a single getUsers() request using include, context: view, and _fields to reduce API calls and support low-capability users.
Negative reactions are better expressed as comments in a collaborative editing context. The thinking emoji provides a constructive "I need to consider this" signal instead.
The horizontal layout caused emojis to overflow and get cut off in the sidebar popover.
Start conservatively with ❤️ 🎉 😄 👀 🚀 to avoid skin-tone concerns and keep the picker compact. More reactions can be added later.
Aligns with the existing _wp_note_status meta key naming convention. Both meta keys are used exclusively for block comments (notes), so using the _wp_note_ prefix for both makes the naming more consistent and clearly indicates these are note-specific features.
Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
The useSelect subscription for the current user ID was running for all notes in CommentBoard. Since ReactionDisplay only renders when a note is selected, moving the selector there avoids unnecessary subscriptions.
Show GitHub-style tooltips on reaction buttons instead of requiring a menu action to open a details popover. The tooltip displays who reacted (e.g. "Alice and Bob reacted with Heart emoji"), providing quicker access to this info.
The setting is editor-specific, so read it from the editor store instead of passing it through the WP-agnostic block-editor settings. When it is missing, offer no emoji rather than client-side defaults the server may have filtered out and would reject. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017FGp5zYv14MKoTuh3RFuWi
The editor read the `noteReactionEmojis` setting straight from getEditorSettings(), which made the setting key a de facto public API. Route it through a private `getNoteReactionEmojis` selector and mark the setting internal, so the list can move to another data source later without breaking anyone. The `wp_note_reaction_emojis` filter stays the public extension point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UfTH9DtSqxSHGAAgE2NDVM
…dditional-comment-type' into add/notes-reaction-emoji-filter # Conflicts: # lib/compat/wordpress-7.2/note-reactions.php
westonruter
reviewed
Oct 9, 2026
- useNoteReactions( noteId ): useEntityProp-style [ summary, toggle ]. - Drop redundant summary refetch; notes list refetch already brings it. - Merge pills and picker into NoteReactions. - Reactor names tied to summary identity; drop module cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the hand-rolled page walk and names cache with a getEntityRecords select gated on pill hover/focus. core-data caches across remounts and invalidates on comment writes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/notes-reaction-emoji-filter The parent folded ReactionDisplay and AddReactionButton into NoteReactions, so the filtered emoji list moves there: the picker lists useReactionEmojis(), hides when the list is empty, and a pill for an emoji no longer offered renders from its hex key and only allows removing the user's own reaction. Claude-Session: https://claude.ai/code/session_01RmMwj4CN9cF8b1Sx58Pvik
Mapping the shorter emojis name lets Prettier collapse the callback. Claude-Session: https://claude.ai/code/session_01RmMwj4CN9cF8b1Sx58Pvik
The ReactionDisplay test that covered removal-only pills went away with the component, so test the same behavior on NoteReactions, plus hiding the picker when the site offers no emoji. Claude-Session: https://claude.ai/code/session_01RmMwj4CN9cF8b1Sx58Pvik
Base automatically changed from
add-notes-emoji-reactions-try-addditional-comment-type
to
trunk
October 16, 2026 23:37
1 task
The filter is milestoned for 7.3 and has its own Core PR (wpd #14132), so move its functions to the 7.3 compat directory and give it its own backport changelog entry. Add return types and the list shape to the docblocks, as asked in review, so PHPStan checks callers against it.
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.
The filter is a PHP API, so its array keys follow core's snake_case like the REST fields do. The editor maps hex_key to its own hexKey when it reads the setting.
Member
Author
|
Thanks for the review @westonruter! |
The picker was a single row, so a filtered list of 20 or more emoji ran across the canvas and, at 100, off screen where most emoji could not be clicked. Lay it out as a grid of up to seven columns, which keeps the default list on one row, and scroll after five rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018vwYjSvYqQEKwGQupRKktQ
adamsilverstein
added a commit
that referenced
this pull request
Nov 11, 2026
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
This was referenced Nov 11, 2026
Member
Author
|
I added a more screenshots in the description and made sure the selector works even if 100 emoji are added. |
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #84199.
Follow up to #76767, which ships a fixed set of seven reaction emoji in WordPress 7.2. This brings back a way for sites to change that list, targeted at 7.3, as a follow-up we can review on its own, the same way #84043 does for the full picker.
Core backport: WordPress/wordpress-develop#14132 (Trac https://core.trac.wordpress.org/ticket/66276)
What?
Claude wrote the code, summary below:
Why?
The filter was in an earlier version of #76767 and got dropped to keep that first iteration small (see the review there and #83538 (review)). Sites still need a way to shape the list, and keeping it here lets us talk through the rendering concern without holding up #76767.
How?
Screenshots
Captured with the e2e test plugin (
packages/e2e-tests/plugins/note-reaction-emojis.php), which applies the filter above.More screenshots: 10, 20 and 100 added emoji
The picker lays emoji out in rows of up to seven, so the default list stays on one row, and scrolls after five rows.
Testing Instructions
__return_empty_array. The add-reaction trigger is gone, and the unicorn pill is still there; clicking it removes your reaction.Tested locally:
Tests_Note_Reaction_EmojisandWP_Test_REST_Comments_Controller_Gutenberg- 97 pass.collab-sidebar/reactionstests and the private selectors - 39 pass.Open questions
AI Use
Claude Code did the typing on both the code and this description, I did the asking. I will review and test.