Suggest mode 4/9: inline marker primitive - #80430
adamsilverstein wants to merge 54 commits into
Conversation
Adds the generic inline-marker layer: wrap a rich-text range in a core/suggestion <mark>, find a marker's range by id, read the caret and selection in rich-text offset space, reconcile a marker after the user edits across it, and decorate markers via the annotations API. This is a self-contained rich-text utility with no suggestion-specific logic; the suggestion operations that build on it land in the next step.
|
Size Change: 0 B Total Size: 7.93 MB |
|
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. |
Trunk switched @wordpress/dependency-group to 'never' mode, so the import group headers in these files now fail lint.
Rename the files this PR adds from .js to .ts and add types so the strict type check covers them. The marker id stays nullable in the public signatures because findMarkerRange/findMarkerText explicitly short-circuit on a missing id. No behavior changes.
|
Flaky tests detected in 5ca7f73. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/33117683339 Should save the changes in
|
# Conflicts: # packages/components/CHANGELOG.md
# Conflicts: # packages/editor/CHANGELOG.md
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
🤖 PR meta 🤖📦 Bundle sizeSize Change: +61 B (0%) Total Size: 8.27 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
|
…est/inline-markers
…est/inline-markers
…est/inline-markers
…est/inline-markers
…est/inline-markers
…est/inline-markers
…est/inline-markers
…est/inline-markers
…est/inline-markers
…est/inline-markers
…est/inline-markers
findMarkerRange and findMarkerText serialized a RichTextData value to HTML and parsed it back on every lookup, which runs per suggestion per store update. RichTextData already exposes formats and text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHz7zkCC2S8crriSWsYPDk
Each range dispatched its own addAnnotation, so every annotated block re-rendered once per range whenever the ranges changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHz7zkCC2S8crriSWsYPDk
…est/inline-markers
…est/inline-markers
…est/inline-markers
…est/inline-markers
…est/inline-markers
Part of #73411
What's in this PR
Adds the generic inline-marker layer: wrap a rich-text range in a
core/suggestion , find a marker's range by id, read the caret and
selection in rich-text offset space, reconcile a marker after the user
edits across it, and decorate markers via the annotations API. This is a
self-contained rich-text utility with no suggestion-specific logic; the
suggestion operations that build on it land in the next step.
Diagram
This layer adds the marker primitive itself, so there is nothing to see in the UI yet. What it defines is the shape of a marker and the editor-only accessibility pass layered on top:
Testing
This is one layer of the stack. To exercise the whole feature, #78994 bundles every layer into one branch and builds it in Playground:
👉 https://playground.wordpress.net/gutenberg.html?pr=78994
Enable Gutenberg > Experiments > Collaboration > Suggestion Mode, then follow the walkthrough in #73411, which also explains how to review the stack layer by layer.
Suggest mode stack
This rebuilds the manually-stacked Suggest mode work (#73411) as a GitHub Stack of 9 small, independently reviewable PRs, each building on the one below it:
Each follow up fix now sits in the layer that owns the code it changes, rather than piling onto the top of the stack. 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
Code and description both written with 🤖 Claude Code. I will review and test.