Skip to content

Add Expand, Minimize and Hide Notes modes to the Options (ellipsis) menu - #79965

Merged
adamsilverstein merged 16 commits into
add/notes-visibility-togglefrom
add/minimize-notes-mode
Jul 23, 2026
Merged

adamsilverstein merged 16 commits into
add/notes-visibility-togglefrom
add/minimize-notes-mode

Conversation

@adamsilverstein

@adamsilverstein adamsilverstein commented Jul 7, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #73417

Adds a Minimize notes choice to the Notes group in the editor's Options (ellipsis) menu, introduced in #76024. Rebuilt on the canvas-margin floating notes architecture from #79864, and byte-identical to the implementation validated on the combined test branch #79971.

When minimized, floating note threads collapse to a small avatar pill anchored at the canvas edge:

  • Hovering or focusing a pill reveals the author name and time (CSS-only :hover/:focus-within).
  • Clicking a pill (or pressing Enter on it) expands the full thread, exactly like selecting a regular thread; Escape collapses it again.
  • The "All notes" sidebar is unaffected; only the floating threads minimize.

Variable reserved width

The space reserved inside the canvas now follows the presentation: 280px for full threads, 82px for minimized pills, and the boundary divider from #79864 scales with the active width. The panel also adapts automatically to the canvas width (the canvas is freely resizable): full threads collapse to pills below a 880px canvas, and the pills release their reserved space entirely below 482px, keeping a readable content column at every size. The e2e spec covers the Options-menu switching and the responsive collapse tiers.

The previous implementation (built on the retired FLOATING_NOTES_SIDEBAR plumbing) remains in history at 63a217b. Its four experimental notes keyboard shortcuts (access+j/i/e/a) are not carried over; they can return as a follow-up if still wanted.

Test plan

Test in WP Playground

  1. Open a post and add notes to a couple of blocks (notes-data-generator helps).
  2. Open the Options (ellipsis) menu and choose Minimize notes: floating threads collapse to avatar pills at the canvas edge, and the reserved space (and divider) narrows to match.
  3. Hover or Tab to a pill: the author name and time appear inline.
  4. Click a pill (or press Enter): the full thread expands with the reply form; Escape collapses it back to a pill.
  5. Choose Expand notes: full floating threads and the full reserved width return.
  6. Narrow the editor (open the Settings sidebar and List View, or shrink the window): full threads collapse to pills automatically, then the pills yield entirely on very narrow canvases.

Screencast

export-1783962513403.mp4

Screenshot

image

@github-actions

github-actions Bot commented Jul 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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @justinemshields.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Unlinked contributors: justinemshields.

Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: annezazu <annezazu@git.wordpress.org>
Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@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 Jul 7, 2026 •

Copy link
Copy Markdown

Size Change: +397 B (+0.01%)

Total Size: 7.75 MB

📦 View Changed
Filename Size Change
build/scripts/editor/index.min.js 502 kB +110 B (+0.02%)
build/styles/editor/style-rtl.css 31.3 kB +78 B (+0.25%)
build/styles/editor/style-rtl.min.css 26.6 kB +63 B (+0.24%)
build/styles/editor/style.css 31.3 kB +80 B (+0.26%)
build/styles/editor/style.min.css 26.6 kB +66 B (+0.25%)

compressed-size-action

Add 'Expand notes' and 'Minimize notes' choices to the Notes toolbar
dropdown introduced by #76024. When minimized, floating note threads
collapse to an avatar pill anchored to the canvas edge; hovering or
focusing a pill reveals the author name and time, and selecting the
thread expands it fully.

The hover reveal is CSS-only (:hover/:focus-within), so no extra
React state is needed, and the floating board's ResizeObserver
handles reflow when threads collapse or expand.
The DropdownMenu popover stayed open after selecting a choice, so a
subsequent click on the toolbar toggle closed the menu instead of
reopening it. Pass onClose through and call it on selection.
@adamsilverstein
adamsilverstein force-pushed the add/minimize-notes-mode branch from 34e662f to ba2b8f2 Compare July 7, 2026 20:54
@github-actions

github-actions Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

Flaky tests detected in c870d33.
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.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/29806905980
📝 Reported issues:

@adamsilverstein

Copy link
Copy Markdown
Member Author

Checking how this works in Docs:

image

A couple of changes we could make here:

  • Reverse the order so it goes from none to most/all.
  • Adjust the language to better match Docs (action based: hide/minimize/expand/show all)
  • Add a thin dividing line before the Show all (if our component enables that)
  • Add keyboard shortcuts, ideally matching docs

Reorder the display options from least to most visible (Hide, Minimize,
Expand, Show all), rename Show notes to Expand notes, and separate Show
all notes into its own menu group so a divider precedes it. This mirrors
the comment display menu in Google Docs, which the feature is modeled on.

Register keyboard shortcuts for each mode using WordPress conventions
(access modifier) rather than Docs' exact chords to avoid conflicts, and
surface the shortcut on each menu item. The four handlers share an
applyNotesDisplayMode helper with the dropdown.

Update the e2e assertions for the new order and label.
@adamsilverstein

Copy link
Copy Markdown
Member Author

Addressed in 6d1cbf4:

  • Order reversed to none→all: Hide → Minimize → Expand → Show all.

  • Language now action-based to match Docs: "Show notes" → Expand notes (Hide / Minimize / Expand / Show all).

  • Divider before "Show all" via a separate MenuGroup (its own radio, still checked when active).

  • Keyboard shortcuts registered per mode and shown on each item. Docs' two-key chords (W then M/E) aren't expressible with registerShortcut, so I used WP-convention access (Ctrl+Alt / Shift+Alt) bindings instead of Docs' exact combos to avoid conflicts:

    • Hide → access+J
    • Minimize → access+I
    • Expand → access+E
    • Show all → access+A

    Happy to bikeshed the exact letters. e2e assertions updated for the new order/label.

@annezazu

annezazu commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Just a note that what blocked my PR on this last time was feedback that the dropdown menu isn't necessarily the right path forward and that folks wanted to see a resizable sidebar. We need to align with design here as that's where I got stuck. I'm not a design but I obviously am biased towards liking this approach haha. @WordPress/gutenberg-design for more feedback here, although I imagine not much has changed since this is quite close UX wise to the original PR (this PR is better code wise!).

# Conflicts:
#	packages/editor/src/components/collab-sidebar/index.js
#	test/e2e/specs/editor/various/block-notes.spec.js
The Options-menu items carry keyboard shortcut text in their accessible
names, so an exact name match no longer finds them.
@adamsilverstein

Copy link
Copy Markdown
Member Author

Synced with the base branch and applied jasmussen's feedback from #79971 (comment): the Hide / Minimize / Expand choices (with their keyboard shortcuts) now live in a "Notes" group in the editor's Options (ellipsis) menu instead of a dropdown on the pinned notes button, which is a plain "All notes" sidebar toggle again. The show-all keyboard shortcut still works. e2e updated; block-notes + collaboration suites (45 tests) pass locally.

@annezazu

Copy link
Copy Markdown
Contributor

Fantastic! Thank you for taking this over.

@adamsilverstein

Copy link
Copy Markdown
Member Author

Merged the base branch and reordered the display choices to Expand / Minimize / Hide in 63a217b, per design feedback on #79971.

@jasmussen

Copy link
Copy Markdown
Contributor

This is the major change:

image

In principle I'm for it, as a simple way to start that lets us keep the notes button a toggle. But it will very much benefit the feature to migrate to Menu with submenus, so it doesn't become so long as to scroll on mobile.

That's not a blocker, but let's probably note it as a followup for someone to tackle. That would also let us use the radio grouping mechanism instead of the checkbox indication for the item-exclusive options.

One thing for this branch: can you move the Notes group under "Panels"?

This is mostly a hierarchy thing. The choice is not that important.

…ture

Port the Minimize notes mode onto the floating-notes-in-canvas-margin
implementation from #79864, matching the combined test branch (#79971)
byte for byte:

- Minimized threads collapse to an avatar pill that reveals the author
  name and time on hover or focus; selecting a pill expands the thread.
- The reserved canvas width follows the presentation: 280px for full
  threads, 82px for pills, and the boundary divider scales with it.
- The panel also yields progressively as the canvas narrows: full
  threads collapse to pills below 880px and the pills release their
  reserved space below 482px.
Rebuilds the Minimize notes mode on the canvas-margin floating notes
architecture from #79864, replacing the FLOATING_NOTES_SIDEBAR-based
implementation (previous head 63a217b). The four experimental
notes keyboard shortcuts from the previous implementation are not
carried over; they can return as a follow-up if still wanted.
@adamsilverstein

Copy link
Copy Markdown
Member Author

Rebuilt on the canvas-margin architecture; see the updated description. This PR now also carries the variable reserved width (280px full / 82px pills) and the responsive collapse tiers validated on #79971.

@jasmussen
jasmussen self-requested a review July 13, 2026 07:51
@github-actions github-actions Bot added [Package] DOM /packages/dom [Package] Keycodes /packages/keycodes [Package] Plugins /packages/plugins [Package] Components /packages/components [Package] Blocks /packages/blocks [Package] Redux Routine /packages/redux-routine [Package] Block library /packages/block-library [Package] Notices /packages/notices [Package] Token List /packages/token-list [Package] Format library /packages/format-library [Package] Rich text /packages/rich-text [Package] Block editor /packages/block-editor [Package] Edit Post /packages/edit-post [Package] Data Controls /packages/data-controls [Package] Priority Queue /packages/priority-queue labels Jul 19, 2026
@manzoorwanijk

Copy link
Copy Markdown
Member

This branch seems to have picked up irrelevant commits, probably due to a rebase issue.

Trunk renamed the pending note form class from
editor-collab-sidebar-panel__thread to
editor-collab-sidebar-panel__add-note, so the overlay's pointer-events
carve-out no longer matched it and clicks fell through to the canvas
iframe.
Tests added on trunk after this branch forked still located notes inside
the docked Editor settings region; with the floating overlay they live
in the Notes region. Also park the pointer before asserting the
un-highlight on focus-out, since hovering a floating thread highlights
its block.
@t-hamano

Copy link
Copy Markdown
Contributor

@adamsilverstein, could you resolve the rebase issues so that we can review this PR?

@adamsilverstein

Copy link
Copy Markdown
Member Author

This branch seems to have picked up irrelevant commits, probably due to a rebase issue.

Oops, fixing.

@adamsilverstein

Copy link
Copy Markdown
Member Author

This branch seems to have picked up irrelevant commits, probably due to a rebase issue.

Oops, fixing.

Fixed and enabled the gh-stack feature, https://github.github.com/gh-stack/

# Conflicts:
#	test/e2e/specs/editor/various/block-notes.spec.js
@adamsilverstein

adamsilverstein commented Jul 23, 2026 •

Copy link
Copy Markdown
Member Author

Closing this in favor of #76024, which has been fast-forwarded to this branch'stip (5bcae66af61) - no code changes, just a branch pointer move. The two PRs wound up adding a menu then removing it so consolidating them made sense.

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 [Package] Editor /packages/editor [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a “Minified Notes Mode” for reduced visual footprint (similar to Google Docs' “Minimize comments”)

5 participants