Some checks failed
CI / Unit & Component Tests (push) Has been cancelled
CI / OCR Service Tests (push) Has been cancelled
CI / Backend Unit Tests (push) Has been cancelled
CI / Unit & Component Tests (pull_request) Failing after 1m39s
CI / OCR Service Tests (pull_request) Successful in 16s
CI / Backend Unit Tests (pull_request) Successful in 4m9s
Pulls the transcription-block state (load, save, delete, reviewToggle,
markAllReviewed, createFromDraw, toggleTrainingLabel, deleteAnnotation
+ derived blockNumbers / hasBlocks / lastEditedAt / annotationReloadKey)
out of documents/[id]/+page.svelte into a reusable factory in
lib/document/transcription/useTranscriptionBlocks.svelte.ts.
The page now reads transcription.blocks / .blockNumbers / .hasBlocks /
.lastEditedAt / .annotationReloadKey reactively and delegates writes
to transcription.{load, save, delete, reviewToggle, markAllReviewed,
createFromDraw, toggleTrainingLabel, deleteAnnotation,
findByAnnotationId, bumpAnnotationReloadKey}. The confirm-then-delete
dialog stays in the page; the hook only handles the data ops.
24 unit tests cover initial state, load (success / non-OK / network /
empty-id), derived state (blockNumbers in sortOrder, lastEditedAt
recent-pick, lastEditedAt-null fallback), delete (success bumps key /
non-OK throws), reviewToggle (success updates / non-OK no-op), markAll
(success / non-OK), createFromDraw (success / non-OK / network all
return correct shape), toggleTrainingLabel (200 / 500), deleteAnnotation
(linked-block path / orphan-annotation path / orphan-fail throw),
findByAnnotationId match + miss, bumpAnnotationReloadKey.
Also bumps the polling-loop test waits in useOcrJob.svelte.test.ts to
150-200ms (from 60-80ms) so the suite is reliable when run in parallel.
Refs #496.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 selectiontag/TagInput.svelte— tag chip inputocr/OcrProgress.svelte— job status indicator in the document headershared/primitives/BackButton.svelte,shared/discussion/— shared UI
Backend counterpart
backend/src/main/java/org/raddatz/familienarchiv/document/README.md