Fix[Editorial Notes]: Clarify Editorial Notes save flow and hide stale updates action#682
Conversation
6ceac22 to
bb546ce
Compare
|
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. |
dkotter
left a comment
There was a problem hiding this comment.
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
|
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:
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.” |
|
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. |
|
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. |
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).
I agree, any way we can make this clearer I'm on board for |
bb546ce to
27d3e87
Compare
f7994a0 to
94e2f53
Compare
What?
Closes #678
This PR improves the Editorial Updates flow in two related ways:
Apply Editorial Updatesbutton 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
Screencast
screencast.mov
Changelog Entry