Suggest mode: Auto-save subsystem (Phase 6)#78308
Open
adamsilverstein wants to merge 1 commit into
Open
Conversation
|
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. |
This was referenced May 14, 2026
Per-block debounced background save for Suggest mode. After a 1.5 s idle window, pending overlay edits persist as a note comment; subsequent edits on the same block update the existing note's meta rather than creating a new one, and a fully reverted overlay trashes the note. Saves on the same clientId run sequentially via a per-block promise queue, while different blocks run concurrently. Replaces the explicit SuggestionCommitBar toolbar button.
9978bd3 to
f9d22c7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Follow-up to #77407 (Phase 5). Carves the auto-save subsystem out of Phase 5 so each PR concentrates on one concern — Phase 5 stays focused on REST permissions + PHP tests, and this PR owns the Google Docs–style background save.
Tracked in #73411.
What's in this PR
SuggestionAutoSave— invisible component that debounces overlay edits (1.5 s per block) and persists them asnotecomments with the_wp_suggestionmeta payload. Replaces the explicitSuggestionCommitBartoolbar button (restored on Phase 5 so the prior stack stays functional in isolation).clientIdchain sequentially so a slow network call can't race with a follow-up edit and produce duplicatePOSTs or out-of-order writes. Different blocks run concurrently.updateSuggestion/deleteSuggestionon the provider — once a comment id is linked, subsequent editsPUTthe same comment; a fully reverted overlay trashes the note. Includes a stale-link check via core-data so a peer-resolved comment doesn't get clobbered mid-session.commentIdandsyncedOpsKeyfields on overlay entries,SET_COMMENT_ID/SET_SYNCED_OPS_KEYreducer cases, and matchingsetCommentId/setSyncedOpsKeycallbacks on the context.Test plan
```bash
npm run test:unit -- packages/editor/src/components/suggestion-mode/
```
Stack
🗺️ PR Stack Navigation
_wp_suggestionmeta, provider, sidebar actions📋 Tracking issue: #73411