Skip to content

Apply/Reject controls in the collaboration sidebar - #78353

Closed
adamsilverstein wants to merge 8 commits into
phase-5c-summary-diff-docsfrom
phase-5b-collab-sidebar-actions
Closed

adamsilverstein wants to merge 8 commits into
phase-5c-summary-diff-docsfrom
phase-5b-collab-sidebar-actions

Conversation

@adamsilverstein

@adamsilverstein adamsilverstein commented May 15, 2026 •

Copy link
Copy Markdown
Member

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

@github-actions github-actions Bot added the [Package] Editor /packages/editor label May 15, 2026
@github-actions

github-actions Bot commented May 15, 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>

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 added [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 [Package] Edit Widgets /packages/edit-widgets [Package] E2E Tests /packages/e2e-tests [Package] Project management automation /packages/project-management-automation labels May 18, 2026
@github-actions

github-actions Bot commented May 18, 2026 •

Copy link
Copy Markdown

Size Change: +781 B (+0.01%)

Total Size: 7.51 MB

📦 View Changed
Filename Size Change
build/scripts/editor/index.min.js 481 kB +781 B (+0.16%)

compressed-size-action

@github-actions

github-actions Bot commented May 18, 2026 •

Copy link
Copy Markdown

Flaky tests detected in ff0fed1.
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/28184512201
📝 Reported issues:

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.
… phase-5b-collab-sidebar-actions

# Conflicts:
#	test/e2e/specs/editor/various/editor-intent-switcher.spec.js
The 'Inline notes › highlights an inline marker with the author color at
the rest opacity' e2e test exercises the per-author inline-marker tinting
feature (note-highlight-styles.js), which is introduced downstream on the
autosave branch. This branch has no inline-mark rendering, so the 'Add
note' rich-text entry the test relies on never appears and the test times
out. Move the coverage to the branch that owns the feature; it remains on
autosave and below where it passes.
@adamsilverstein

Copy link
Copy Markdown
Member Author

Superseded by the fresh-stack restructure of Suggest mode (#73411).

The feature has been re-sliced from this 16-deep stack onto current trunk as a clean 2-PR stack:

The whole feature now sits behind a Suggestion Mode experiment (Settings → Experiments → Collaboration). Closing in favour of the new stack — details: #73411 (comment)

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.

1 participant