Suggest mode 6/9: review UI (Apply / Reject sidebar and summary) - #80432
adamsilverstein wants to merge 58 commits into
Conversation
Adds the sidebar review surface: SuggestionActions renders the Accept / Reject affordance in a note's header, resolves the marked text for inline suggestions on read, and shows a Docs-style Add / Delete / Format summary (SuggestionSummary + word-diff). The notes list hides the generic Resolve button for suggestion notes so the checkmark isn't duplicated, and the note toolbar's Add-note button stays active while a suggestion is being composed.
|
Size Change: +5.08 kB (+0.06%) Total Size: 7.93 MB 📦 View Changed
|
# Conflicts: # packages/editor/src/components/collab-sidebar/format.js # tools/eslint/suppressions.json
|
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 If 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. |
Trunk switched @wordpress/dependency-group to 'never' mode, so the import group headers in these files now fail lint.
|
Flaky tests detected in ec52201. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/33117692745 refuses the drop and uploads nothing in
|
# Conflicts: # tools/eslint/suppressions.json
Rename the files this PR adds from .js to .ts/.tsx and add types so the strict type check covers them: the word diff exports a WordDiffSegment interface and the summary/actions components carry typed props. No behavior changes; eslint suppression paths follow the renames.
# Conflicts: # packages/components/CHANGELOG.md
# Conflicts: # packages/editor/src/components/collab-sidebar/note.jsx
Changing an existing link's href keeps the same anchor tag and visible text, so the summary fell back to a bare "Change: text" and a reviewer could accept a new URL without ever seeing it. Compare link targets on their own and report "Change link: old → new". Claude-Session: https://claude.ai/code/session_01EmSXGAGtuLnk3UEe5kXPSU
|
Claude picked up the review note on link summaries:
|
There was a problem hiding this comment.
Let's not add legacy components in new code 🙂
There was a problem hiding this comment.
Agreed, and the suppression is gone.
Claude checked what is left on the legacy side:
Textmoved to@wordpress/uiin 99fa69d, which removed the suppressions entry. The file still importsButtonandConfirmDialogfrom@wordpress/components: their@wordpress/uicounterparts,IconButtonandAlertDialog, are on the use-with-caution list in theuse-recommended-componentsrule, so switching would need a new suppression and would mix the two systems in a header that already uses the legacyButtonfor Resolve. Happy to switch once those two are promoted.
New code should not pull in legacy components. The summary and the status lines under a suggestion used __experimentalText, which the use-recommended-components rule flags, so both files needed lint suppressions to land. Switch to Text from @wordpress/ui (body-md for the 13px summary lines, body-sm for the 12px status lines) and drop the two suppressions. The ui Text has no muted variant, so the status lines get a small class that applies the neutral-weak foreground token instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TmgVCwTwC7cJaY1UYMBjpS
The header check and close icons looked mismatched. @wordpress/icons now draws both as 1.5px stroked, non-scaling paths, but the header still carried overrides written for the old filled glyphs: it blew both icons up to 32px and forced a 1px stroke onto the check only. The result was a thin, oversized check next to a heavier close icon, which is not what the mockup in #73411 shows. Render both as plain small icon buttons, the same size as the note's Resolve and actions menu buttons, and drop the size and stroke overrides. The two glyphs now share one weight and sit in the header the way the design has them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TmgVCwTwC7cJaY1UYMBjpS
…/review-ui # Conflicts: # packages/editor/src/components/collab-sidebar/note.jsx
ResolvedSuggestionSummary's selector mapped fresh op objects on every store change, so every suggestion note re-rendered and re-ran its word diff per keystroke. Select only the marker strings and build the ops in a memo. Note now calls useSuggestionDecision once and hands the result to both the header buttons and the body. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHz7zkCC2S8crriSWsYPDk
| .editor-collab-sidebar-panel__suggestion-summary { | ||
| em { | ||
| font-style: italic; | ||
| color: $gray-700; |
There was a problem hiding this comment.
We're using design system tokens elsewhere (e.g. --wpds-color-foreground-content-neutral-weak a few lines below), and I imagine we could do similar here to avoid mixing the two systems.
Opportunity for the design system: There might be an opportunity to clarify how agents think to work with shared variables between the base styles and design tokens.
There was a problem hiding this comment.
Swapped in a0fd2a8: both colors now read --wpds-color-foreground-content-neutral-weak and the base-styles import is gone.
…ns.tsx Co-authored-by: Andrew Duthie <1779930+aduth@users.noreply.github.com>
The suggestion summary stylesheet already reads its muted status color from a design system token but set the quoted-text color from the base-styles palette, mixing the two systems in one file. Read both from the same foreground token and drop the base-styles import. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MnVknLuyvKfR9DsM4H3SrX
|
The mismatched icons were my doing, not the icon set's. Fixed in 5479ffc. Claude went back over the icon styling and reports:
|

Part of #73411
What's in this PR
Adds the sidebar review surface: SuggestionActions renders the Accept /
Reject affordance in a note's header, resolves the marked text for inline
suggestions on read, and shows a Docs-style Add / Delete / Format summary
(SuggestionSummary + word-diff). The notes list hides the generic Resolve
button for suggestion notes so the checkmark isn't duplicated, and the note
toolbar's Add-note button stays active while a suggestion is being composed.
Screenshot
Reviewing as the post author. Each suggestion becomes a note with a plain-language summary and Accept / Reject actions, here an attribute change and an inline addition:
Testing
This is one layer of the stack. To exercise the whole feature, #78994 bundles every layer into one branch and builds it in Playground:
👉 https://playground.wordpress.net/gutenberg.html?pr=78994
Enable Gutenberg > Experiments > Collaboration > Suggestion Mode, then follow the walkthrough in #73411, which also explains how to review the stack layer by layer.
Suggest mode stack
This rebuilds the manually-stacked Suggest mode work (#73411) as a GitHub Stack of 9 small, independently reviewable PRs, each building on the one below it:
Each follow up fix now sits in the layer that owns the code it changes, rather than piling onto the top of the stack. The whole feature can be exercised end-to-end via the combined testing branch #78994 (Playground). Behind the "Suggestion Mode" experiment (Gutenberg > Experiments).
AI Use
Code and description both written with 🤖 Claude Code. I will review and test.