Repository navigation
Suggest mode: combined feature branch for Playground testing (draft) - #78994
adamsilverstein wants to merge 761 commits into
Conversation
|
Size Change: +33.1 kB (+0.42%) Total Size: 7.95 MB 📦 View Changed
|
|
Flaky tests detected in 277c3ec. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/32911895936 Navigates the items list via UP/DOWN arrow keys in
|
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.
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.
Fix: empty inserted block no longer becomes a suggestionBug: 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 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 Committed here in c63392f, and backported to the insert-mechanism PR #77971 (where this code originates) in c268952. |
|
Fixed the "Format: content" note for whitespace-only suggestions. Cause: typing only whitespace in Suggest mode produces an Fix: render the marker text verbatim via a new Added a unit case ( |
…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.
…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().
…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.
61b9e76 to
45a17fd
Compare
Indenting a list item clones the source list for the new nested list, so inside a suggested list the clone carried the list's pending-insert marker and note link. The note then had two anchors: its summary moved to the nested list, the parent insertion lost its note, and a second decision appeared that could not resolve (#73411). A block adopted without a note of its own, inside a pending insertion or as a list indent's carrier, now drops the inherited suggestion state.
Covers the report on #73411 where a nested list in a suggested list duplicated the list's note and left a decision that would not resolve.
Trunk's Menu now throws in development builds when a Menu.Group sits inside a Menu.RadioGroup (#83792), which crashed the editor as soon as the Options menu opened. Put the Mode label and radio items directly in the RadioGroup, the same shape trunk gave ModeSwitcher, and cover it with a jsdom test since production e2e builds never hit the guard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BTRGFetxgiXPJC9a91DMTL
# Conflicts: # packages/editor/CHANGELOG.md
The test registers the real core-data store, and the reconciler reads getCurrentUser(), whose resolver calls api-fetch against a jsdom with no server. On a shuffled CI shard the failed request rejected after the test ended and Vitest failed the run on the unhandled rejection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BTRGFetxgiXPJC9a91DMTL
The test registers the real core-data store, and auto-save reads getCurrentUser(), whose resolver calls api-fetch against a jsdom with no server. A failed request can reject after its test ends, which fails a shuffled CI shard on the unhandled rejection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BTRGFetxgiXPJC9a91DMTL
Part of #73411
What
Draft / testing-only branch. Bundles the full Suggest 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 nine reviewable PRs below. This branch just gives reviewers and testers one place to try the whole flow.
One deliberate difference from the stack
Suggest 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 carries one commit of its own on top of the stack tip. It makes the
window.__experimentalSuggestionModebridge unconditional, drops the now-inert Experiments screen entry, and removes the e2e spec that covered the experiment-off state, which cannot happen here. 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
https://playground.wordpress.net/gutenberg.html?pr=78994
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.
Notes
suggest/e2e) plus the single default-on commit described above. That is why the diff here is the sum of all nine plus a few lines.test/e2e/specs/editor/various/suggestion-mode*.spec.ts, plustest/e2e/specs/site-editor/suggestion-mode-intent-shortcuts.spec.ts.docs/explanations/architecture/suggestions.md.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.