Skip to content

Notes: reveal the add-reaction trigger on hover instead of reserving a row - #82313

Open
adamsilverstein wants to merge 2 commits into
add-notes-emoji-reactions-full-pickerfrom
try/notes-reaction-hover-trigger
Open

Notes: reveal the add-reaction trigger on hover instead of reserving a row#82313
adamsilverstein wants to merge 2 commits into
add-notes-emoji-reactions-full-pickerfrom
try/notes-reaction-hover-trigger

Conversation

@adamsilverstein

@adamsilverstein adamsilverstein commented Sep 1, 2026

Copy link
Copy Markdown
Member

Stacked on #78176, and opened for testing rather than merging as-is.

In #78176 (comment) @annezazu pointed out that the add-reaction button takes up a lot of real estate, and asked whether it could appear on hover the way Google Docs does. This is a try at that.

The trigger moves in among the note's other icon actions, up beside Resolve and the actions menu, and stays faded until the note is hovered or the trigger itself is focused. A note nobody has reacted to now costs no vertical space at all for the option. The reaction pills keep their own row, but only when there are actually reactions to show.

Two things fell out of the change that are worth calling out:

  • The reveal hangs off the trigger, not the thread. The thread is tabIndex={ 0 }, so a thread-level :focus-within holds for as long as the note is selected and the fade would never take effect.
  • The whole treatment sits inside @media (hover: hover). A touch device has no hover, so there it keeps a trigger it can actually see.

The pills also no longer disappear when you deselect a note. Reactions are information about the note rather than one of its actions, so they now stay put - otherwise you could react on hover and watch the reaction vanish.

Screenshots

At rest Hovered With reactions

How has this been tested

Test in WordPress Playground

  1. Enable the Notes experiment and add a note to a block.
  2. With the note selected, move the pointer away from the sidebar. The smiley should be gone, and the note should be one row shorter than on Notes: Open a full searchable emoji picker from the add-reaction button (stacked on #76767) #78176.
  3. Hover the note. The smiley fades in beside Resolve and the actions menu.
  4. Tab to it with the keyboard - it should appear as focus lands on it, and open the picker on Enter.
  5. Add a reaction, then click the post title to deselect. The pill should stay; the smiley should go.

Existing Emoji Reactions e2e specs all pass, plus two new ones covering the fade and the deselected pills.

Types of changes

  • Move the add-reaction trigger into the note actions row, with a minimal variant so it sits with the other icon buttons instead of shouting over them.
  • Fade the trigger in on hover / focus, scoped to pointer devices.
  • Render the reaction pill row only when the note has reactions, and independently of selection.
  • Add e2e coverage for both behaviors.

Open questions

  • Google Docs reveals the emoji option on hovering any comment, selected or not. This only does it on the selected one, because rendering the trigger on every note would add a tab stop per note in the sidebar. Is the narrower version enough, or is the unselected-hover behavior the point?
  • @jasmussen @fcoveram - moving the trigger up into the actions row also drops it out of the vertical stack of circles Anne flagged. Does this help, or does it just move the problem?

AI Use

Claude Code did the typing here, I did the asking. I will review and test.

…a row

The trigger sat on a row of its own below every selected note, so a note
nobody had reacted to still paid a full row of vertical space for the
option. Move it in among the note's other icon actions and keep it faded
until the note is hovered or the trigger is focused, matching how Google
Docs surfaces the same affordance.

The reveal hangs off the trigger rather than the thread: the thread is
`tabIndex={ 0 }`, so a thread-level `:focus-within` would hold for as
long as the note is selected and the fade would never take effect. The
whole treatment is scoped to `@media (hover: hover)`, so a touch device
keeps a trigger it can actually see.

The pill row now renders only when the note has reactions, and it no
longer depends on selection - reactions are information about the note,
so they survive being deselected rather than disappearing with the
note's actions.
@github-actions github-actions Bot added the [Package] Editor /packages/editor label Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 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.

@github-actions

github-actions Bot commented Sep 1, 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>
Co-authored-by: jasmussen <joen@git.wordpress.org>

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

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Size Change: +352 B (0%)

Total Size: 7.93 MB

📦 View Changed
Filename Size Change
build/scripts/editor/index.min.js 589 kB +53 B (+0.01%)
build/styles/editor/style-rtl.css 32.3 kB +63 B (+0.2%)
build/styles/editor/style-rtl.min.css 27.8 kB +83 B (+0.3%)
build/styles/editor/style.css 32.4 kB +64 B (+0.2%)
build/styles/editor/style.min.css 27.8 kB +89 B (+0.32%)

compressed-size-action

@jasmussen

Copy link
Copy Markdown
Contributor

Nice work. Taking it for a spin:

state

For me, the focus handling works, focus isn't transferred, nor is it lost when you remove a reaction.

This follows an earlier sketch, by the way, putting the emoji button in this location. Whether we put it here or below, I'm happy to defer to anyone with an opinion. It is a little tight, but it works:

Skærmbillede 2026-09-02 kl  07 48 53

The hover to reveal, however, feels unnecessary to me, honestly. The text from the author has the same amount of reserved space whether the button is shown or not, and since the button is shown whenever the note itself is focused, there's not much to gain:

hover

It only begs the question: why is this button hidden unless I hover, and not the others? Not a strong opinion, but I think we should just remove the hover effect. I'm also curious about the hover style—a square grey backdrop. There's nothing wrong with it, but why does only the emoji button have it, and not the others? I would think all three buttons in that space should be the same variant.

Let me know if this makes sense, happy to ✅ depending on how you all feel!

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

Labels

[Package] Editor /packages/editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants