Skip to content

Suggestion mode 8/9: architecture documentation - #82047

Open
adamsilverstein wants to merge 230 commits into
suggest/inline-wiringfrom
suggest/docs
Open

adamsilverstein wants to merge 230 commits into
suggest/inline-wiringfrom
suggest/docs

Conversation

@adamsilverstein

@adamsilverstein adamsilverstein commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

Part of #73411

Claude wrote these docs with me and keeps this description in step with them:

What's in this PR

Splits the Suggestion mode architecture docs out of the wiring PR (#80433), so they can be read as prose instead of scrolled past inside a diff of a hundred files. There are two documents, meant to be read in this order, and two READMEs beside the code:

  1. Suggestion mode overview (suggestions-overview.md, new). The map: the three kinds of suggestion (inline text, structural, block attribute) and how each is captured, stored and rendered, a glossary, sequence diagrams for each data flow and for accept / reject, and how a save moves pending suggestions out of the stored post and back for the editor. Start here. It is a permanent handbook page: the layer-by-layer table, the open findings from the 2026-10-04 architecture review and the questions for reviewers moved to Add Suggestion mode with Notes #73411, since they stop being true once the stack merges.
  2. Suggestion mode (suggestions.md). The detailed reference, organized by concern: capture, inline markers, overlapping suggestions, the payload schema, the decision lifecycle, save-time extraction, front-end rendering, real-time collaboration, and the known limitations, with short sections that collect the feature gating, security and accessibility rules. It opens with Storage at a glance: every stored key and shape in one table, one suggestion shown in its editor form and its stored form, and the versions and limits of each format. That is the section to read for a storage review.
  3. suggestion-mode/README.md (new) lists what each module does, and inline-suggestions/test/README.md (new) explains how to run, replay and regenerate the overlap fixtures and the convergence fuzz. Both used to be tables and command lists inside the reference.

Both documents are registered in docs/toc.json and linked from the architecture index, so they show up in the developer docs handbook. docs/manifest.json gains the two matching entries and nothing else.

The reference was also brought in line with the code: TypeScript file names, the PHP living in lib/compat/wordpress-7.1/, core permissions (there is no Gutenberg permission override), one replace note for a type-over, the inline-suggestion op, and a dozen modules it was missing. Both docs use the Google Docs names throughout: Suggestion mode, with Editing and Suggesting modes, and Accept for the positive decision. The reference says outright that a read-only Viewing mode is out of scope for the first iteration (#85770), and no longer ties a move to Yjs attribution to #77005, which was closed.

Testing

Nothing to run. Read both docs against the layers below and see whether they describe what the code actually does. Feedback on the open questions in #73411 is especially welcome.

Check that the Mermaid diagrams render in the GitHub preview.

To check the handbook wiring: npm run docs:gen should leave the tree clean.


Suggestion mode stack

This rebuilds the manually-stacked Suggestion mode work (#73411) as a GitHub Stack of 9 small, independently reviewable PRs, each building on the one below it:

  1. #80427 - editor intent (edit/suggest) + experiment gate
  2. #80428 - suggestion storage, REST controller, provider
  3. #80429 - block-level capture (attribute + 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

Each follow up fix now sits in the layer that owns the code it changes, rather than piling onto the top of the stack. Overlapping suggestions were briefly their own layer (#86206, now closed); that code sits in the layers that own it, mainly #80431 and #80433. The whole feature can be exercised end-to-end via the combined testing branch #78994 (Playground). Behind the "Suggestion Mode" experiment (Gutenberg > Experiments).


AI Use

Both documents and this description came out of a conversation with 🤖 Claude Code. Docs only, no code in this PR. I will review them for accuracy.

🤖 Generated with Claude Code

https://claude.ai/code/session_016nxoTjV6e8hn6YUb7AEioP

Describe how a suggestion is captured, stored, marked inline and
reviewed, so the subsystem has a written explanation alongside the code
rather than only in the pull requests that built it.
@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.

The document was added to docs/explanations/architecture but never listed
in docs/toc.json, so it did not reach the generated manifest or the
developer docs handbook. Add the toc entry, regenerate the manifest, and
link it from the architecture index alongside the other editor docs.
Cascade the trunk refresh up the Suggest mode stack.
@github-actions

Copy link
Copy Markdown

Flaky tests detected in 17466ed.
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/33117847764
📝 Reported tests:

refuses the drop and uploads nothing in /test/e2e/specs/editor/various/single-file-placeholder-drop.spec.js, passed after 1 failed attempt.
Error: expect(received).toHaveLength(expected)

Expected length: 0
Received length: 2
Received array:  [{"_links": {"about": [{"href": "http://localhost:8889/wp-json/wp/v2/types/attachment"}], "author": [{"embeddable": true, "href": "http://localhost:8889/wp-json/wp/v2/users/1"}], "collection": [{"href": "http://localhost:8889/wp-json/wp/v2/media"}], "curies": [{"href": "https://api.w.org/{rel}", "name": "wp", "templated": true}], "replies": [{"embeddable": true, "href": "http://localhost:8889/wp-json/wp/v2/comments?post=106"}], "self": [{"href": "http://localhost:8889/wp-json/wp/v2/media/106", "targetHints": {"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]}}], "wp:attached-to": [{"embeddable": true, "href": "http://localhost:8889/wp-json/wp/v2/posts/104", "id": 104, "post_type": "post"}]}, "alt_text": "", "author": 1, "caption": {"rendered": ""}, "class_list": ["post-106", "attachment", "type-attachment", "status-inherit", "hentry", "entry"], "comment_status": "open", "date": "2026-08-27T21:37:30", "date_gmt": "2026-08-27T21:37:30", "description": {"rendered": "<p class=\"attachment\"><a href='http://localhost:8889/wp-content/uploads/2026/08/10x10_e2e_test_image_z9T8jK-1.png'><img loading=\"lazy\" decoding=\"async\" width=\"10\" height=\"10\" src=\"http://localhost:8889/wp-content/uploads/2026/08/10x10_e2e_test_image_z9T8jK-1.png\" class=\"attachment-medium size-medium\" alt=\"\" style=\"width:100%;height:100%;max-width:10px;\" /></a></p>
"}, "featured_media": 0, "filename": "10x10_e2e_test_image_z9T8jK-1.png", "filesize": 80, "guid": {"rendered": "http://localhost:8889/wp-content/uploads/2026/08/10x10_e2e_test_image_z9T8jK-1.png"}, "id": 106, "link": "http://localhost:8889/?attachment_id=106", "media_details": {"file": "2026/08/10x10_e2e_test_image_z9T8jK-1.png", "filesize": 80, "height": 10, "image_meta": {"alt": "", "aperture": "0", "camera": "", "caption": "", "copyright": "", "created_timestamp": "0", "credit": "", "focal_length": "0", "iso": "0", "keywords": [], "orientation": "0", "shutter_speed": "0", "title": ""}, "sizes": {}, "width": 10}, "media_type": "image", "meta": [], "mime_type": "image/png", "modified": "2026-08-27T21:37:30", "modified_gmt": "2026-08-27T21:37:30", "ping_status": "closed", "post": 104, "slug": "10x10_e2e_test_image_z9t8jk-2", "source_url": "http://localhost:8889/wp-content/uploads/2026/08/10x10_e2e_test_image_z9T8jK-1.png", "status": "inherit", "template": "", "title": {"rendered": "10x10_e2e_test_image_z9T8jK"}, "type": "attachment"}, {"_links": {"about": [{"href": "http://localhost:8889/wp-json/wp/v2/types/attachment"}], "author": [{"embeddable": true, "href": "http://localhost:8889/wp-json/wp/v2/users/1"}], "collection": [{"href": "http://localhost:8889/wp-json/wp/v2/media"}], "curies": [{"href": "https://api.w.org/{rel}", "name": "wp", "templated": true}], "replies": [{"embeddable": true, "href": "http://localhost:8889/wp-json/wp/v2/comments?post=105"}], "self": [{"href": "http://localhost:8889/wp-json/wp/v2/media/105", "targetHints": {"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]}}], "wp:attached-to": [{"embeddable": true, "href": "http://localhost:8889/wp-json/wp/v2/posts/104", "id": 104, "post_type": "post"}]}, "alt_text": "", "author": 1, "caption": {"rendered": ""}, "class_list": ["post-105", "attachment", "type-attachment", "status-inherit", "hentry", "entry"], "comment_status": "open", "date": "2026-08-27T21:37:30", "date_gmt": "2026-08-27T21:37:30", "description": {"rendered": "<p class=\"attachment\"><a href='http://localhost:8889/wp-content/uploads/2026/08/10x10_e2e_test_image_z9T8jK.png'><img loading=\"lazy\" decoding=\"async\" width=\"10\" height=\"10\" src=\"http://localhost:8889/wp-content/uploads/2026/08/10x10_e2e_test_image_z9T8jK.png\" class=\"attachment-medium size-medium\" alt=\"\" style=\"width:100%;height:100%;max-width:10px;\" /></a></p>
"}, "featured_media": 0, "filename": "10x10_e2e_test_image_z9T8jK.png", "filesize": 80, "guid": {"rendered": "http://localhost:8889/wp-content/uploads/2026/08/10x10_e2e_test_image_z9T8jK.png"}, "id": 105, "link": "http://localhost:8889/?attachment_id=105", "media_details": {"file": "2026/08/10x10_e2e_test_image_z9T8jK.png", "filesize": 80, "height": 10, "image_meta": {"alt": "", "aperture": "0", "camera": "", "caption": "", "copyright": "", "created_timestamp": "0", "credit": "", "focal_length": "0", "iso": "0", "keywords": [], "orientation": "0", "shutter_speed": "0", "title": ""}, "sizes": {}, "width": 10}, "media_type": "image", "meta": [], "mime_type": "image/png", "modified": "2026-08-27T21:37:30", "modified_gmt": "2026-08-27T21:37:30", "ping_status": "closed", "post": 104, "slug": "10x10_e2e_test_image_z9t8jk", "source_url": "http://localhost:8889/wp-content/uploads/2026/08/10x10_e2e_test_image_z9T8jK.png", "status": "inherit", "template": "", "title": {"rendered": "10x10_e2e_test_image_z9T8jK"}, "type": "attachment"}]
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/single-file-placeholder-drop.spec.js:71:45

@adamsilverstein
adamsilverstein requested review from Mamaduka, retrofox and t-hamano and removed request for ajitbohra and fabiankaegy September 4, 2026 00:22
@adamsilverstein adamsilverstein added the [Type] Developer Documentation Documentation for developers label Sep 4, 2026
… orphans

The known limitations still said there was no garbage collection. State
what the collector and the keyboards now cover, and narrow the copy gap
to the browser's native copy of a partial rich-text selection.
Follows the wording change in the layers below.
…ribute

The format keyboard and the content reconciler are no longer limited to
a block's `content`. See #87434.
The sentence added for #87433 was dropped again when the docs for
#87434 were committed over it.
@adamsilverstein adamsilverstein changed the title Suggestion mode 9/10: architecture documentation Suggestion mode 8/9: architecture documentation Nov 28, 2026

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

[Package] Editor /packages/editor [Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant