Skip to content

Fix[Editorial Notes]: Persist block metadata on generation to link back notes on reload#682

Draft
yogeshbhutkar wants to merge 1 commit into
WordPress:developfrom
yogeshbhutkar:fix-678/blocks-detach-from-notes-on-reload
Draft

Fix[Editorial Notes]: Persist block metadata on generation to link back notes on reload#682
yogeshbhutkar wants to merge 1 commit into
WordPress:developfrom
yogeshbhutkar:fix-678/blocks-detach-from-notes-on-reload

Conversation

@yogeshbhutkar

@yogeshbhutkar yogeshbhutkar commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

What?

Closes #678

Why?

Editorial Notes store the root Note ID in block metadata so later review and refinement passes can associate a block with its Note thread. Without saving after a new noteId is linked, that metadata exists only in editor state and is lost after reload.

Ref:

( dispatch( blockEditorStore ) as any ).updateBlockAttributes(
block.clientId,
{
metadata: { ...existingMeta, noteId: note.id },
}
);

How?

createNote() now reports whether it created a new root Note thread and linked its ID to block metadata. Full-post review accumulates that signal across batches and saves post once at the end, only when a new noteId was linked. Single-block review also saves only when its review links a new noteId.

Use of AI Tools

AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: Initial code skeleton; final implementation was reviewed and edited by me.

Testing Instructions

  1. Create a new post and add reviewable block content.
  2. Run the Editorial Notes review.
  3. Confirm Editorial Notes are created for the reviewed content.
  4. Reload the editor.
  5. Confirm the "Apply Editorial Updates" action is still available and works after reload.

Screencast

fix.mov

Changelog Entry

Fixed - Editorial Notes at block metadata being lost after reload when the editor had unsaved changes, preventing "Apply Editorial Updates" from finding the linked notes.

Open WordPress Playground Preview

@yogeshbhutkar yogeshbhutkar force-pushed the fix-678/blocks-detach-from-notes-on-reload branch from 6ceac22 to bb546ce Compare June 9, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editorial Updates cannot match existing Notes after editor reload

1 participant