Suggest mode 7/7: inline live wiring, docs, and end-to-end tests#80433
Suggest mode 7/7: inline live wiring, docs, and end-to-end tests#80433adamsilverstein wants to merge 2 commits into
Conversation
Wires the inline suggestion engine into the live editor: the addition, deletion, and format keyboards capture typing / delete / cut / paste / format toggles on beforeinput and turn them into inline markers; the content reconciler covers the onChange seams (IME, autocorrect, drag, multi-line paste); the overlay HOC hands format and content edits off to those paths before the overlay runs; author colors tint markers per suggester; annotations decorate them on the canvas; and the note garbage collector prunes orphaned suggestion notes. Restores the inline apply/reject branches in the provider, mounts the singletons in the editor provider, adds the server-side inline marker strip, the architecture doc, and the full e2e suites (golden path, persistence, review, undo, overlay invariants).
|
Size Change: +8.19 kB (+0.11%) Total Size: 7.75 MB 📦 View Changed
|
Input events target the editing host. With the editableRoot block support (native cross-block selection, #79105) that host is the writing-flow wrapper whenever the selected block has editable siblings, so event.target no longer identifies the block's rich text. The suggest-mode keyboard interceptors then never engaged and typing fell through to the per-keystroke reconciler path, which drops every keystroke after the first (each plan re-validates against a content snapshot the previous write already moved) - a typed addition in any multi-paragraph document lost all but its first character. Resolve the affected element from the event's target range (or the live selection for clipboard events, which expose no target ranges) instead of event.target, in both isEventTargetSelectedRichText and readEventRange. Also harden the tinting e2e: assert the typed run lands inside the marker (an attribute-only assertion missed the text loss) and assert each marker resolves its author's exact palette color rather than merely differing, so a user-id collision on the 7-color palette cannot fail the test.
|
The Fixed in 1b71c34 by resolving the affected element from the event's target range (or the live selection for clipboard events) instead of All 64 suggestion-mode e2e tests pass locally. Cherry-picked to the combined testing branch (#78994) to keep it byte-equal with the stack tip. |
|
Flaky tests detected in 1b71c34. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/29610435654
|
What's in this PR
Wires the inline suggestion engine into the live editor: the addition,
deletion, and format keyboards capture typing / delete / cut / paste /
format toggles on beforeinput and turn them into inline markers; the
content reconciler covers the onChange seams (IME, autocorrect, drag,
multi-line paste); the overlay HOC hands format and content edits off to
those paths before the overlay runs; author colors tint markers per
suggester; annotations decorate them on the canvas; and the note garbage
collector prunes orphaned suggestion notes. Restores the inline apply/reject
branches in the provider, mounts the singletons in the editor provider, adds
the server-side inline marker strip, the architecture doc, and the full e2e
suites (golden path, persistence, review, undo, overlay invariants).
Suggest mode stack
This rebuilds the manually-stacked Suggest mode work (#73411) as a GitHub Stack of 7 small, independently reviewable PRs. Each is CI-green on its own and builds on the one below it:
The whole feature can be exercised end-to-end via the combined testing branch #78994 (Playground). Behind the "Suggestion Mode" experiment (Gutenberg > Experiments).