Skip to content

Suggest mode: Surface Apply/Reject in the collaboration sidebar#78353

Open
adamsilverstein wants to merge 1 commit into
phase-5c-summary-diff-docsfrom
phase-5b-collab-sidebar-actions
Open

Suggest mode: Surface Apply/Reject in the collaboration sidebar#78353
adamsilverstein wants to merge 1 commit into
phase-5c-summary-diff-docsfrom
phase-5b-collab-sidebar-actions

Conversation

@adamsilverstein
Copy link
Copy Markdown
Member

@adamsilverstein adamsilverstein commented May 15, 2026

Overview

One of three replacement PRs for the now-closed #77407. This slice wires Apply / Reject sidebar UI on top of the summary + attribute-conflict work from #78352.

Tracking issue: #73411.

What's in this PR

Collaboration sidebar

  • useSuggestionDecision hook in suggestion-actions.js — A single source of truth for Apply / Reject behavior. Both the note header (icon buttons) and the note body (resolution state, staleness dialog) read from the same hook, so their behavior cannot diverge.
  • Icon-only Apply / Reject buttons in the note header (check, closeSmall icons from @wordpress/icons).
  • Note body renders the SuggestionSummary plus the staleness confirmation dialog when hasAttributeConflict returns true.
  • utils.js — helpers shared between note components for reading the suggestion-related metadata.

Tests

  • Unit: test/utils.js extended for the new helpers.
  • e2e: block-notes.spec.js (new spec covering Apply / Reject flows) and editor-intent-switcher.spec.js (snackbar assertions).

Test plan

npm run test:unit -- packages/editor/src/components/collab-sidebar
npm run test:e2e -- test/e2e/specs/editor/various/block-notes.spec.js
npm run test:e2e -- test/e2e/specs/editor/various/editor-intent-switcher.spec.js

Manual:

  1. Switch to Suggest mode (snackbar confirms) and edit a paragraph.
  2. Switch back to Edit mode; open the note in the collab sidebar.
  3. Apply button (check icon) accepts the suggestion; Reject (close icon) discards.
  4. Edit the same paragraph's attributes in another window, then open the original suggestion: the staleness dialog appears only if the divergent attributes overlap (per hasAttributeConflict).

Replaces part of #77407.


🗺️ PR Stack Navigation

# PR Phase
1 #77403 Intent scaffolding Edit / Suggest / View mode
2 #77404 Overlay capture In-memory suggestion overlay
3 #77405 Provider + Accept/Reject _wp_suggestion meta, provider, sidebar actions
4 #77406 Summary + docs + attribute tests Add/Delete/Formatting summary, architecture stub, conflict scoping
5a #78351 REST permissions and PHP coverage Permissions, payload cap, PHP tests
5b #78352 Summary + attribute conflict + docs Renderer, per-attribute staleness, architecture docs
5c #78353 Surface Apply/Reject in the collaboration sidebar ← this PR Icon buttons + e2e + sidebar wiring
6 #78308 Auto-save subsystem Background debounced save (replaces commit-bar)

📋 Tracking issue: #73411

Wire icon-only Apply / Reject controls into the note header and a shared
useSuggestionDecision hook into the note body so the staleness dialog and
resolution state stay consistent. Notes carrying a _wp_suggestion payload
now render the SuggestionSummary in the thread, and block-notes and
editor-intent-switcher e2e specs cover the new sidebar UI.
@github-actions github-actions Bot added the [Package] Editor /packages/editor label May 15, 2026
@github-actions
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.

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 [Status] In Progress Tracking issues with work in progress [Type] Feature New feature to highlight in changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant