Skip to content

Suggest mode: Suggestion summary, attribute conflict detection, and architecture docs#78352

Open
adamsilverstein wants to merge 1 commit into
phase-5a-rest-backendfrom
phase-5c-summary-diff-docs
Open

Suggest mode: Suggestion summary, attribute conflict detection, and architecture docs#78352
adamsilverstein wants to merge 1 commit into
phase-5a-rest-backendfrom
phase-5c-summary-diff-docs

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 introduces the suggestion summary renderer, per-attribute conflict detection, snackbar feedback, and architecture documentation.

Tracking issue: #73411.

What's in this PR

Suggestion-mode component additions

  • suggestion-summary.js — Compact alternative to the full inline diff. Renders an Add / Delete / Format line per operation suitable for sidebar threads. Used by the collab-sidebar PR on top of this branch.
  • hasAttributeConflict + parseSuggestionPayload (provider) — Replaces the post-modified_gmt staleness compare with a per-attribute divergence check. modified_gmt flagged nearly every auto-saved suggestion as stale because every save bumps the post timestamp; the new check only prompts when the specific attributes a suggestion targets have moved off baseline.
  • with-suggestion-overlay and suggestion-diff refinements to match the new contract.

Editor store / UX

  • setEditorIntent snackbar — Mode transitions now surface a snackbar ("You're suggesting" / "You're editing" / "You're viewing") alongside the existing a11y announcement.
  • Store wiringactions.js, reducer.js, selectors.js updated for the new selectors; use-block-editor-settings.js wires the suggestion provider settings through.
  • Stylesuggestion-mode/style.scss is the home for suggestion visuals (block bracket marker, summary card); imported from packages/editor/src/style.scss.

Documentation

  • docs/explanations/architecture/suggestions.md — Architecture doc covering the provider abstraction, overlay subsystem, and lifecycle.
  • docs/reference-guides/data/data-core-editor.md — Updated to cover the new editor-store selectors / actions.

Tests

  • Unit: test/provider.js (extended), test/suggestion-summary.js (new), test/with-suggestion-overlay.js (extended).
  • e2e: suggestion-mode.spec.js updated to exercise the new flow.

Test plan

npm run test:unit -- packages/editor/src/components/suggestion-mode
npm run test:unit -- packages/editor/src/store/test/actions.js
npm run test:e2e -- test/e2e/specs/editor/various/suggestion-mode.spec.js
npm run lint:js -- packages/editor/src/components/suggestion-mode packages/editor/src/store

Manual:

  1. Switch to Suggest mode → snackbar reads "You're suggesting".
  2. Edit a paragraph → SuggestionSummary renders in the inline diff and (after the sidebar PR lands) in the note thread.
  3. Submit, then in another window edit the same paragraph's attributes → reopening the original suggestion in the sidebar shows the staleness confirmation only when the specific attributes diverge — not on any unrelated post change.

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 ← this PR Renderer, per-attribute staleness, architecture docs
5c #78353 Surface Apply/Reject in the collaboration sidebar Icon buttons + e2e + sidebar wiring
6 #78308 Auto-save subsystem Background debounced save (replaces commit-bar)

📋 Tracking issue: #73411

…and architecture docs

Introduce SuggestionSummary as a compact alternative to the full inline diff,
swap post-modified_gmt staleness for hasAttributeConflict (per-attribute
divergence from the captured baseline), wire snackbar feedback into
setEditorIntent transitions, and add the wp/suggestions architecture doc plus
core/editor data-reference updates. Provider, with-suggestion-overlay,
suggestion-diff, and the suggestion-mode e2e spec follow the new contract.
@github-actions
Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@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