Repository navigation
Preserve unsaved knowledge base settings when another card is saved. - #1452
Merged
Merged
Conversation
Signed-off-by: Floating-Y <118035379+Floating-Y@users.noreply.github.com>
WaylandYang
approved these changes
Oct 26, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thanks, this fixes it: each card now syncs from its own server values, and a real reload or a switch of base still starts fresh. I'll retitle the squash commit to state the behaviour. Merging.
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.
Why
Saving one knowledge base settings card invalidates the detail query. The shared synchronization effect then resets every card from the refreshed response, discarding unrelated drafts.
To reproduce:
What changes
Split synchronization into four effects, each depending on its card's server fields and
kbId. Saving another card preserves unrelated drafts while initial loading, KB switching, saved values, and server updates to unedited cards continue to synchronize.Keep independent PATCH payloads and query invalidation unchanged. Only the settings page and its regression test change; no API, database, dependency, or other-page changes.
Add regression coverage for draft retention, isolated requests, empty/null descriptions, saved values and status, server updates, and switching between KBs with identical server values.
The existing same-card conflict behavior remains: a server-side change to fields in a dirty card can replace that card's draft.
How it was checked
Local validation on Windows for the worktree committed as
5adc726, based onupstream/devatc8aedf9:pnpm test: 49 files, 334 tests passed.pnpm build,pnpm typecheck, andgit diff --check: passed.Tests execute actual component input/save callbacks, mutation functions, success handlers, and query functions. Query snapshots model refreshes; browser interaction and TanStack cache integration were not tested. Backend checks were not run for this frontend-only change.
Before review
git commit -s)web/:pnpm buildandpnpm testpass