Skip to content

Suggest mode: combined feature branch for Playground testing (draft) - #78994

Draft
adamsilverstein wants to merge 1344 commits into
trunkfrom
try/suggest-mode-combined
Draft

adamsilverstein wants to merge 1344 commits into
trunkfrom
try/suggest-mode-combined

Conversation

@adamsilverstein

@adamsilverstein adamsilverstein commented Jun 6, 2026 •

Copy link
Copy Markdown
Member

Part of #73411

What

Draft / testing-only branch. Bundles the full Suggestion mode feature into one branch so the end-to-end experience can be exercised in WordPress Playground. It is not meant to be merged - the feature lands through the ten reviewable PRs below. This branch just gives reviewers and testers one place to try the whole flow.

  1. #80427 - editor intent (edit/suggest) and experiment gate
  2. #80428 - suggestion storage, REST controller, and provider
  3. #80429 - block-level capture (attribute and structural)
  4. #80430 - inline marker primitive
  5. #80431 - inline suggestion operations
  6. #80432 - review UI (Apply/Reject sidebar + summary)
  7. #80433 - inline live wiring
  8. #82047 - architecture documentation
  9. #82048 - end-to-end test suite
  10. #85794 - overlapping suggestions (new): stacked markers and per-suggestion formatting deltas, following the Google Docs model, so most overlaps that used to be refused now work and resolve the same way in any accept/reject order

One deliberate difference from the stack

Suggestion mode is enabled by default here. Everywhere else it sits behind Settings > Experiments > Collaboration > Suggestion Mode, off until you turn it on. That extra step was costing testers their first session: miss it and you get a stock editor, with nothing to tell you that is the wrong one.

So this branch differs from the stack tip in two files. It makes the window.__experimentalSuggestionMode bridge unconditional, and removes the e2e spec that covered the experiment-off state, which cannot happen here. The Experiments screen entry is still registered (the e2e specs toggle it), it just has no effect. The notice a post shows when it carries suggestion markers and the experiment is off still lives on #80427 and up, along with its coverage.

Nothing else differs. Review the gate on #80427, not here.

Testing

Test in WordPress Playground

https://playground.wordpress.net/gutenberg.html?pr=78994

Ready-made test site: open it in Playground. It installs this PR's build, adds a reviewer Editor (password password) and a draft with paragraphs, headings, an image and a list, then opens that draft signed in as the reviewer. Blueprint source.

Open a post with a few paragraphs and look for Options (⋮) > Mode. No setup, no experiment to enable. A multi-paragraph post matters - some of the input handling only shows up once there is more than one block.

Then follow the full walkthrough in the tracking issue: #73411 (comment)

It covers mode switching and shortcuts, inline text suggestions, formatting, attribute and structural suggestions, the notes sidebar, undo, persistence, and the accept/reject cycle. Keeping it in one place means it stays in step with the code.

To try overlaps from #85794, sign in as two different users and suggest over each other's suggestions: type inside or delete across someone else's addition or deletion, format text they already reformatted, or remove a block they suggested. Then accept and reject the pieces in different orders. Enter inside another author's suggestion is still refused on purpose.

Notes

  • Review and merge happen on the ten PRs above, not here.
  • The branch is the tip of the stack (suggest/overlap) merged in, plus the two-file default-on delta described above. That is why the diff here is the sum of all ten plus a few lines.
  • Every layer, including Suggestion mode 10/10: overlapping suggestions #85794, is merged into this branch as of 2026-10-28. The stack was last refreshed against trunk on 2026-10-20.
  • Intents are Editing and Suggesting only. The read-only Viewing intent was pulled from the whole stack and is tracked in Suggestion mode: Add a Viewing mode #85770.
  • e2e coverage lives in test/e2e/specs/editor/various/suggestion-mode*.spec.ts, test/e2e/specs/editor/collaboration/collaboration-suggestion-mode*.spec.ts, and test/e2e/specs/site-editor/suggestion-mode-intent-shortcuts.spec.ts.
  • Architecture write-up: docs/explanations/architecture/suggestions.md.
  • Full map and rationale: Add Suggestion mode with Notes #73411.

AI Use

Built with 🤖 Claude Code over a few rounds of back and forth, and Claude wrote this description too. I will review and test.

@github-actions github-actions Bot added [Package] Editor /packages/editor [Package] Block editor /packages/block-editor [Package] Edit Post /packages/edit-post [Package] Edit Site /packages/edit-site labels Jun 6, 2026
@github-actions

github-actions Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

Size Change: +33.1 kB (+0.42%)

Total Size: 7.95 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 475 kB +125 B (+0.03%)
build/scripts/core-data/index.min.js 37.4 kB +7 B (+0.02%)
build/scripts/editor/index.min.js 608 kB +29.6 kB (+5.11%) 🔍
build/styles/block-editor/content-rtl.css 6.22 kB +562 B (+9.93%) ⚠️
build/styles/block-editor/content-rtl.min.css 4.67 kB +528 B (+12.75%) ⚠️
build/styles/block-editor/content.css 6.22 kB +562 B (+9.93%) ⚠️
build/styles/block-editor/content.min.css 4.67 kB +532 B (+12.87%) ⚠️
build/styles/block-editor/style-rtl.css 20.4 kB +171 B (+0.85%)
build/styles/block-editor/style-rtl.min.css 17.3 kB +122 B (+0.71%)
build/styles/block-editor/style.css 20.4 kB +168 B (+0.83%)
build/styles/block-editor/style.min.css 17.3 kB +122 B (+0.71%)
build/styles/editor/style-rtl.css 32.1 kB +179 B (+0.56%)
build/styles/editor/style-rtl.min.css 27.4 kB +164 B (+0.6%)
build/styles/editor/style.css 32.2 kB +179 B (+0.56%)
build/styles/editor/style.min.css 27.4 kB +163 B (+0.6%)

compressed-size-action

@github-actions

github-actions Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

Flaky tests detected in 277c3ec.
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/32911895936
📝 Reported tests:

Navigates the items list via UP/DOWN arrow keys in /test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  getByLabel('Page Two')
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" with timeout 5000ms
  - waiting for getByLabel('Page Two')
    14 × locator resolved to <button type="button" tabindex="-1" aria-pressed="false" id="view-list-0-465-item-wrapper" class="dataviews-view-list__item" aria-labelledby="view-list-0-465-label" aria-describedby="view-list-0-465-description"></button>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js:112:49

adamsilverstein added a commit that referenced this pull request Jun 16, 2026
Bring Phase 0-1 of the inline-suggestions work (clean phase branch
try/suggest-mode-inline-markers, stacked on #78218) into the combined
testing branch: the shared inline-markers primitive + the Notes refactor
onto it, and the core/suggestion marker format with its type-aware PHP
strip. This makes the new layer available for the suggest-mode integration
phases (deletions/additions) and for Playground testing on #78994.
adamsilverstein added a commit that referenced this pull request Jun 17, 2026
Bring the Phase 2 inline-deletion work (try/inline-suggestions-phase2)
onto the combined branch for Playground testing: the core/suggestion
format registration + canvas decoration, the accept/reject value
transforms, the provider inline-suggestion apply/reject paths, and the
Suggest deletion toolbar control.

Lets the create -> decorate -> accept/reject deletion flow be exercised in
a running editor on #78994.
@adamsilverstein adamsilverstein added No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core [Type] Feature New feature to highlight in changelogs. Needs Testing Needs further testing to be confirmed. labels Jun 24, 2026
@adamsilverstein adamsilverstein self-assigned this Jun 24, 2026
@adamsilverstein

Copy link
Copy Markdown
Member Author

Fix: empty inserted block no longer becomes a suggestion

Bug: In Suggest mode, clicking the default block appender (the empty space below the last block) inserted an unmodified default paragraph, and the store interceptor's new-block branch immediately tagged it pending-insert and wrote a block-insert-after op — surfacing an "Insert block: paragraph" suggestion for a block the user hadn't put anything into.

Fix: Defer the insertion suggestion while the new block is still an unmodified default block. The interceptor now skips it without recording a snapshot, so the next fire — once the block has content — re-enters the new-block branch and registers the insertion. A suggestion is only created once the user actually types into the block.

Guard added in store-interceptor.js (isUnmodifiedDefaultBlock), plus an e2e test covering the empty-appender case and the type-to-suggest follow-through. All 10 suggestion-mode.spec.js tests pass locally (red→green verified).

Committed here in c63392f, and backported to the insert-mechanism PR #77971 (where this code originates) in c268952.

@adamsilverstein

Copy link
Copy Markdown
Member Author

Fixed the "Format: content" note for whitespace-only suggestions.

Cause: typing only whitespace in Suggest mode produces an inline-suggestion op whose resolved text is all spaces. summarizeOperations required that text to survive a trim() and then ran it through ellipsize() (which collapses/trims whitespace), so a pure-whitespace edit became an empty quote and fell through to the generic Format: content label.

Fix: render the marker text verbatim via a new clampText() helper that caps length without collapsing whitespace, and only fall back to the attribute label when no text resolves (marker edited away). A typed space now reads Add: " ".

Added a unit case (quotes a whitespace-only inline-suggestion add verbatim) and an e2e regression in suggestion-mode.spec.js. Backported to the review PR #79282 (try/inline-suggestions-phase2).

adamsilverstein added a commit that referenced this pull request Jun 24, 2026
…tent

Clicking the default block appender inserts an unmodified default
paragraph via insertDefaultBlock. In Suggest mode that empty block
incorrectly became an Insert block suggestion on its own. Guard the
store interceptor's new-block branch with isUnmodifiedDefaultBlock so
the insertion is only recorded once the block has content, and skip
without recording a snapshot so a later fire re-enters the branch.

Ports the fix already present on the combined branch (#78994) and the
structural stack (#77971) to the inline-suggestions base so #79282
matches. Adds the matching e2e regression test.
adamsilverstein added a commit that referenced this pull request Jun 24, 2026
…ns-base

Brings the inline-suggestions base current with trunk (was 161 commits
behind). Conflicts resolved to mirror the proven combined branch
(#78994) organization, reflecting the graduation of block notes and the
base note REST controller to WordPress 6.9 core:

- lib/compat/wordpress-6.9/block-comments.php and the 6.9 comment
  controller: accept trunk's deletion (graduated to core). The
  suggestion-specific additions they carried are rehoused in the 7.1
  compat layer.
- lib/compat/wordpress-7.1/block-suggestions.php: new file holding the
  suggestion comment-meta registration (_wp_suggestion,
  _wp_suggestion_status, payload-size constant) that previously lived in
  6.9/block-comments.php. Inline-marker strip stays out (phase 2).
- lib/compat/wordpress-7.1/class-gutenberg-rest-comment-controller-7-1.php:
  the suggestion REST permission subclass, moved from the deleted 6.9
  controller and narrowed to suggestion lifecycle updates.
- lib/load.php: require block-bindings (trunk), block-comments,
  block-suggestions, and the 7.1 comment controller.
- collab-sidebar/note.js: take the integrated version (trunk's
  simplified show-more plus the suggestion canResolve guard).
- editor CHANGELOG: keep the suggest-mode Unreleased entries above
  trunk's released 14.49.0 / 14.48.1 headers.
- REST controller test: reference Gutenberg_REST_Comment_Controller_7_1
  and gutenberg_register_suggestion_meta().
adamsilverstein added a commit that referenced this pull request Jun 24, 2026
…s-phase2

Cascades the trunk catch-up and the empty-inserted-block guard up from
the base branch. Conflict resolutions mirror the combined branch
(#78994):

- lib/compat/wordpress-7.1/block-suggestions.php: union of the base's
  suggestion meta registration and this branch's inline-marker
  render-strip (meta + strip).
- lib/load.php: add the 7.1 comment controller require.
- editor CHANGELOG: keep the suggest-mode New Features and Bug Fixes
  entries above trunk's released 14.49.0 / 14.48.1 headers.
- provider.js: point the payload-size doc reference at
  block-suggestions.php (where the meta now lives).

After this merge the suggestion feature footprint is identical to the
combined branch.
@adamsilverstein adamsilverstein changed the title Suggest mode: Combined feature branch (draft, for Playground testing) Suggest mode: Combined feature branch for Playground testing (draft) Jun 30, 2026
@adamsilverstein adamsilverstein changed the title Suggest mode: Combined feature branch for Playground testing (draft) [TEST BRANCH] Suggest mode: Combined feature branch for Playground testing Jun 30, 2026
@adamsilverstein adamsilverstein changed the title [TEST BRANCH] Suggest mode: Combined feature branch for Playground testing Combined feature branch for Playground testing (draft) Jun 30, 2026
@adamsilverstein
adamsilverstein force-pushed the try/suggest-mode-combined branch 3 times, most recently from 61b9e76 to 45a17fd Compare June 30, 2026 20:29
Covers what a plugin has to know until there is an API: the availability
check, slashing the payload, which capabilities apply, marker attribute
order, the finalized action, and the Accept state of a note with no anchor.
gutenberg_suggestions_enabled() reads the experiment, which stays off on
this branch even though the editor has Suggest mode on unconditionally.
478aba1 changed their setup from applied-unsaved to applied, so the
autosave test failed on its own assertion and the nested update test no
longer covered a finalize.
# Conflicts:
#	packages/editor/CHANGELOG.md
…inline-wiring

# Conflicts:
#	packages/block-editor/CHANGELOG.md
#	packages/editor/CHANGELOG.md
The 16.2.0 / 20.1.0 package release on trunk turned the old Unreleased
sections into versioned ones, and the merge left this branch's entries
inside them, where they would read as already shipped.
…est/overlap

# Conflicts:
#	packages/block-editor/CHANGELOG.md

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Testing Needs further testing to be confirmed. No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core [Package] Block editor /packages/block-editor [Package] Core data /packages/core-data [Package] E2E Tests /packages/e2e-tests [Package] Editor /packages/editor [Type] Feature New feature to highlight in changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant