Skip to content

fix(platform): preserve knowledge drafts across versions - #4337

Merged
yannickmonney merged 1 commit into
mainfrom
fix/knowledge-version-draft
Oct 5, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
fix/knowledge-version-draft

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

What changed

  • Track Knowledge entry dialogs by enduring documentId instead of version _id.
  • Keep the dirty edit session mounted across version replacement, announce the newer version, and require explicit discard confirmation.
  • Add EN/DE/FR copy and a regression test for replaced version identity.

Verification

  • oxlint passed for changed TypeScript files.
  • git diff --check passed.
  • oxfmt passed for changed TypeScript files.
  • Focused Vitest and typecheck were attempted but this worktree lacks workspace dependency/type packages.

Closes #3901

@yannickmonney

Copy link
Copy Markdown
Contributor Author

ACCEPT — exact head fe94746961e4d1d4e0110ee3865d048f5aa836d7 reviewed.

  • useViewedRecord accepts an identity-key function; Knowledge uses documentId ?? _id, preserving view/edit continuity across version replacement while deletion/access loss still closes and other callers remain unchanged.
  • Dirty forms retain their draft, announce the newer version with an alert, and require explicit discard confirmation; EN/DE/FR copy is present.
  • Focused regression: /opt/node/bin/node ./node_modules/vitest/vitest.mjs run services/platform/app/hooks/use-viewed-record.test.ts --maxWorkers=1 — 4 passed.
  • Exact-head CI read: all required checks passed; only expected skipped candidate/container checks and neutral Trivy.

Delegated to merge at this exact head.

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.

Bug: a new Knowledge version closes another session’s editor and loses its draft

1 participant