Suggest mode: Suggestion summary, attribute conflict detection, and architecture docs#78352
Suggest mode: Suggestion summary, attribute conflict detection, and architecture docs#78352adamsilverstein wants to merge 10 commits into
Conversation
|
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. |
|
Size Change: +1.36 kB (+0.02%) Total Size: 7.51 MB 📦 View Changed
|
|
Flaky tests detected in df62560. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/27780297253
|
95d4319 to
06c8368
Compare
5920ff9 to
5dfa6f2
Compare
06c8368 to
1f7a652
Compare
…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.
The suggest-mode stack diverged from trunk before #75147 landed, so addNoteIdToMetadata and getNoteIdsFromMetadata are absent from this branch's collab-sidebar/utils.js. suggestion-mode/provider.js imports both, breaking the JS bundle build (esbuild: no matching export) and cascading into the PHP, Playwright, and release checks. Vendor the two pure helpers verbatim from trunk (786c69c) so this PR builds independently of a full-stack rebase. They resolve cleanly against trunk's identical definitions when the stack is updated.
Three e2e tests asserted behavior not present on this branch; they were masked until the JS build break was fixed and the suite could run. editor-intent-switcher: the intent is session-scoped by design (see setEditorIntent / editorIntent reducer) - reload returns to Edit. Rewrite the reload test to assert that reset instead of expecting Suggest to persist, which the implementation deliberately refuses. suggestion-mode: 'auto-saves a content edit' and the heading-level capture test wait for an automatic debounced POST /wp/v2/comments. The debounced auto-save subsystem is Phase 6 (#78308), not in this stack's ancestry; here a suggestion is only persisted via the explicit commit-bar Submit button. Skip both with a tracking reference to #78308.
Commit d055691 vendored addNoteIdToMetadata/getNoteIdsFromMetadata onto this branch because the stale stack predated #75147. With trunk merged back into the stack, those helpers exist canonically in collab-sidebar/utils.js again, so the vendored copy is redundant and caused a duplicate-definition build break. Remove it; suggestion-mode provider.js now imports the trunk-supplied versions.
5dfa6f2 to
df62560
Compare
…e-5c-summary-diff-docs
…e-5c-summary-diff-docs
Remove 17 vestigial bulk-suppression entries for files byte-identical to trunk (which carries no suppression for them), fixing the failing lint job.
…e-5c-summary-diff-docs
…e-5c-summary-diff-docs # Conflicts: # test/e2e/specs/editor/various/editor-intent-switcher.spec.js # tools/eslint/suppressions.json
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_gmtstaleness compare with a per-attribute divergence check.modified_gmtflagged 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-overlayandsuggestion-diffrefinements to match the new contract.Editor store / UX
setEditorIntentsnackbar — Mode transitions now surface a snackbar ("You're suggesting" / "You're editing" / "You're viewing") alongside the existing a11y announcement.actions.js,reducer.js,selectors.jsupdated for the new selectors;use-block-editor-settings.jswires the suggestion provider settings through.suggestion-mode/style.scssis the home for suggestion visuals (block bracket marker, summary card); imported frompackages/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
test/provider.js(extended),test/suggestion-summary.js(new),test/with-suggestion-overlay.js(extended).suggestion-mode.spec.jsupdated to exercise the new flow.Test plan
Manual:
SuggestionSummaryrenders in the inline diff and (after the sidebar PR lands) in the note thread.Replaces part of #77407.
🗺️ PR Stack Navigation
_wp_suggestionmeta, provider, sidebar actions📋 Tracking issue: #73411