Skip to content

Fix[Editorial Notes]: Clarify Editorial Notes save flow and hide stale updates action#682

Merged
dkotter merged 5 commits into
WordPress:developfrom
yogeshbhutkar:fix-678/blocks-detach-from-notes-on-reload
Jun 17, 2026
Merged

Fix[Editorial Notes]: Clarify Editorial Notes save flow and hide stale updates action#682
dkotter merged 5 commits 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

This PR improves the Editorial Updates flow in two related ways:

  1. Adds a concise save prompt to the Editorial Notes snackbar after suggestions are generated.
  2. Updates the Apply Editorial Updates button state so it only appears when there is at least one pending Note still linked to a block in the current editor state.

Why?

Blocks store their related Note IDs in block metadata. If a user generates Notes and then refreshes before saving the post, the Notes themselves can persist, but the block metadata linking those Notes back to their blocks is lost. There is an upstream issue for this behavior, and the long-term fix should come from that decision (Ref: WordPress/gutenberg#72717). Until then, the UI should avoid implying that orphaned Notes can still be applied to content.

How?

The snackbar now nudges users to save after suggestions are added, helping preserve the block-to-Note links. The Editorial Updates button now derives its visibility from an actionable state: it checks the current blocks for linked Note IDs and only shows when one of those linked Notes is still pending.

Together, these changes reduce confusion by prompting the user to save at the right moment and hiding the update action when there is no linked block Note to apply.

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 or open a post with reviewable content.
  2. Generate Editorial Notes and confirm the Snackbar prompts saving.
  3. Refresh the editor without saving the post.
  4. Confirm Apply Editorial Updates is hidden when the generated Notes are no longer linked to blocks.

Screencast

screencast.mov

Changelog Entry

Fixed - Clarify the Editorial Notes save prompt and only show Editorial Updates when pending Notes are linked to current blocks.

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
@yogeshbhutkar yogeshbhutkar marked this pull request as ready for review June 9, 2026 10:39
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: ekamran <ekamran@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@dkotter dkotter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good to me but probably worth pausing for a discussion on this.

Up to this point, we've more or less taken the approach that saving content should be a user initiated behavior. For instance, if I trigger Excerpt Generation, I still have to manually click the save button otherwise that excerpt is lost with a page refresh.

This PR changes that for Editorial Notes where we automatically trigger a save when a Note is added. While this ensures that Note and it's association aren't lost, this does mean the post is saved even though a user didn't intentionally click save. If they had made other changes to the post that they weren't ready to publish yet, this makes those changes live.

We may be fine with that though as mentioned, we've tried to stay away from that so far cc @jeffpaul

@ekamran

ekamran commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Thanks for looking into this. I agree this is the main tradeoff here.

From the issue side, the problem I wanted to report was that after reload the UI can still offer “Apply Editorial Updates”, but the existing Notes can no longer be matched back to the block. I was not assuming that automatically saving the whole post is necessarily the right fix.

Your point about user-initiated saving makes sense to me. If generating Editorial Notes triggers a full post save, that could also persist unrelated content changes the user was not ready to save yet.

So I think the safer direction may need a product/maintainer decision first. A few possible directions could be:

  • keep post saving user-initiated, but make it clear that the post must be saved after generating Editorial Notes for the note/block association to survive reloads;
  • store the Note-to-block association somewhere that does not require saving unrelated post content, if there is a reliable place for that;
  • or avoid showing “Apply Editorial Updates” when pending Notes exist but no current block can be matched, and explain why.

The important part for me is avoiding the broken state where pending Notes exist, the action is shown, but applying updates only results in “No blocks found matching the existing Notes.”

@yogeshbhutkar

Copy link
Copy Markdown
Contributor Author

Thank you so much for all the inputs. I also noticed that the core Notes functionality itself seems to suffer from this issue (Ref: WordPress/gutenberg#72717). If you create a note and refresh the page without saving, the note is stored, but its association is not persisted. Ideally, we could wait for the upstream resolution first, as it may fix this case as well. If not, we can follow/refer the approach agreed upon there for consistency.

For the other points, I agree that we can make the snackbar message clearer so users understand that they need to persist the changes. We could also explore showing the “Apply updates” button conditionally, based on whether the updates are actually applicable. This may require some pre-computation, but from a feasibility standpoint, it should be fine.

If any other ideas come up while implementing this, I’d be more than happy to iterate on the approach in this PR.

@ekamran

ekamran commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Thanks for checking the upstream Notes issue. Since this seems tied to the core Notes behavior, I agree it’s safer not to introduce separate auto-save behavior in the AI plugin before that direction is settled.

From the AI plugin side, the main thing I’d want to avoid is the confusing state where pending Notes exist, “Apply Editorial Updates” is shown, but no matching blocks can be found. A clearer snackbar or only showing the action when updates are actually applicable both sound like reasonable interim directions to me.

@dkotter

dkotter commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

also noticed that the core Notes functionality itself seems to suffer from this issue (Ref: WordPress/gutenberg#72717). If you create a note and refresh the page without saving, the note is stored, but its association is not persisted.

Yeah, noticed this myself while building this Feature and was one other reason why I left it like this, seemed best to match WordPress Core (even though easy to argue that's a bug).

From the AI plugin side, the main thing I’d want to avoid is the confusing state where pending Notes exist, “Apply Editorial Updates” is shown, but no matching blocks can be found. A clearer snackbar or only showing the action when updates are actually applicable both sound like reasonable interim directions to me.

I agree, any way we can make this clearer I'm on board for

@yogeshbhutkar yogeshbhutkar marked this pull request as draft June 12, 2026 08:23
@yogeshbhutkar yogeshbhutkar force-pushed the fix-678/blocks-detach-from-notes-on-reload branch from bb546ce to 27d3e87 Compare June 12, 2026 08:25
@yogeshbhutkar yogeshbhutkar changed the title Fix[Editorial Notes]: Persist block metadata on generation to link back notes on reload Fix[Editorial Notes]: Clarify Editorial Notes save flow and hide stale updates action Jun 12, 2026
@yogeshbhutkar

Copy link
Copy Markdown
Contributor Author

This PR has been updated to clarify the snackbar messaging around saving changes. The “Apply Editorial Updates” button is now conditionally rendered based on the attached notes.

cc: @dkotter @ekamran

@yogeshbhutkar yogeshbhutkar marked this pull request as ready for review June 12, 2026 11:26
@yogeshbhutkar yogeshbhutkar requested a review from dkotter June 12, 2026 11:26
@yogeshbhutkar yogeshbhutkar force-pushed the fix-678/blocks-detach-from-notes-on-reload branch from f7994a0 to 94e2f53 Compare June 16, 2026 11:44
@dkotter dkotter added this to the 1.1.0 milestone Jun 17, 2026
@dkotter dkotter merged commit 1fdfb07 into WordPress:develop Jun 17, 2026
22 checks passed
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

3 participants