Skip to content

[6.x] Fix Bard sets showing the wrong values after saving - #15445

Merged
jasonvarga merged 1 commit into
6.xfrom
bard-sync-after-shortcut-save
Sep 11, 2026
Merged

jasonvarga merged 1 commit into
6.xfrom
bard-sync-after-shortcut-save

Conversation

@duncanmcclean

@duncanmcclean duncanmcclean commented Sep 11, 2026

Copy link
Copy Markdown
Member

This pull request fixes an issue where Bard sets would show the next set's values after saving, when the field has remove_empty_nodes enabled. Saving a second time would then write those wrong values to the entry.

This was happening because the value watcher skips rebuilding the editor from the save response while the editor is focused. With remove_empty_nodes: true, the server had stripped the empty paragraphs, so the sets in the editor were pointing at the wrong indexes in the saved value.

This PR fixes it by only skipping the rebuild while focused when the change is confined to set values (which sets sync into the editor themselves). Anything else rebuilds the editor, like it does when the editor isn't focused.

Fixes #15440
Caused by #14808

saving with `cmd+s` keeps the editor focused, so the `value` watcher never rebuilt it from the response. with `remove_empty_nodes` stripping paragraphs, the sets ended up pointing at the wrong indexes in the value. the focus guard now only skips changes confined to set values, which sets sync themselves.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EgVCmXDcwKKNQP6EgpPUaA
@duncanmcclean duncanmcclean changed the title [6.x] Fix Bard sets showing the wrong values after saving with a shortcut [6.x] Fix Bard sets showing the wrong values after saving Sep 11, 2026
@jasonvarga
jasonvarga merged commit ee3e3b4 into 6.x Sep 11, 2026
68 checks passed
@jasonvarga
jasonvarga deleted the bard-sync-after-shortcut-save branch September 11, 2026 21:16
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.

Bard sets show the wrong values after saving with shortkey

2 participants