Files
familienarchiv/frontend/src/lib/document
Marcel 9f1b8b4215 fix(enrichment-block): migrate $app/stores → $app/state to eliminate birpc race
The async vi.mock factory in EnrichmentBlock.svelte.spec.ts performed an
`await import(...)` in its body — the same mechanism #535/#546 fixed for
pdfjs-dist. Issue #553: when Chromium's playwright route handler fetches
the mocked module after the worker's birpc channel has closed, the
factory's RPC roundtrip raises `[birpc] rpc is closed, cannot call
"resolveManualMock"` and the run exits 1.

Migrate EnrichmentBlock from the deprecated `$app/stores.navigating`
(store) to the modern `$app/state.navigating` (reactive proxy). The
spec uses vi.hoisted + a sync vi.mock factory with a getter that defers
the read — no dynamic import in the factory body. Delete the now-unused
__mocks__/navigatingStore.ts.

Fix path applied: $app/state migration (Markus's recommendation /
Felix's Path 2). See ADR-012.

Refs #553

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 22:00:44 +02:00
..

document (frontend)

UI for the archive's core concept: viewing, uploading, editing, searching, bulk-selecting, and transcribing documents.

What this domain owns

Components: DocumentRow, DocumentThumbnail, DocumentTopBar, DocumentViewer, DocumentMetadataDrawer, DocumentEditLayout, DocumentStatusChip, UploadZone, BulkSelectionBar, BulkDropZone. Utilities: search.ts (search-param helpers), filename.ts (filename formatting), documentStatusLabel.ts (i18n label mapping), validateFile.ts (upload validation), groupDocuments.ts (list grouping). Sub-folders: annotation/, transcription/, viewer/.

What this domain does NOT own

  • Person typeahead — person/PersonTypeahead.svelte (cross-domain import, allowed by ESLint rule)
  • Tag input — tag/TagInput.svelte (cross-domain import, allowed)
  • Shared discussion — shared/discussion/ (comment/mention editor)

Key components

Component Route used in Notes
DocumentRow.svelte / (search results), admin queues Compact document card with thumbnail
DocumentViewer.svelte /documents/[id] PDF/image inline viewer
DocumentEditLayout.svelte /documents/[id]/edit Full edit form with sticky save bar
UploadZone.svelte /documents/new, bulk upload Drag-and-drop file drop area
BulkSelectionBar.svelte /documents bulk mode Multi-select action bar

Cross-domain imports

  • person/PersonTypeahead.svelte — sender / receiver selection
  • tag/TagInput.svelte — tag chip input
  • ocr/OcrProgress.svelte — job status indicator in the document header
  • shared/primitives/BackButton.svelte, shared/discussion/ — shared UI

Backend counterpart

backend/src/main/java/org/raddatz/familienarchiv/document/README.md