feat(#38): document edit history with diff and compare mode #52
Reference in New Issue
Block a user
Delete Branch "feat/38-document-edit-history"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
document_versionstable (Flyway V9) storing JSONB snapshots of each document state after create/updateDocumentVersionServicecomputeschangedFieldsat write time by diffing against the previous snapshot; denormalizeseditorNameGET /api/documents/{id}/versionsandGET /api/documents/{id}/versions/{versionId}diffnpm package) and compare mode for any two versionsTest plan
./mvnw test)DocumentVersionServiceTest— 12 tests covering editor name, snapshot content, changedFields tracking (title, location, sender, receivers, tags), getSummaries, getVersionDocumentServiceTest— 2 new tests verifying version is recorded after create and updateDocumentControllerTest— 4 new tests for the two version endpoints (401 + 200)svelte-checkpasses (0 errors related to history feature)history.spec.ts— 3 scenarios: versions list, diff after title edit, compare modeCloses #38
🤖 Generated with Claude Code
8b422c8f06to62f62a89a1Browser-side fetch('/api/...') calls bypass SvelteKit's handleFetch hook (which adds the Authorization header from the auth_token cookie for SSR). As a result, client-side API calls in the dev server always got a 401. Add a proxy configure hook that extracts the auth_token cookie from incoming requests and sets it as the Authorization header before forwarding to the backend. This makes browser-side fetches (history panel, file preview, etc.) work correctly in dev mode. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>