Files
familienarchiv/frontend/src/lib/ocr
Marcel 00a8878146 test: cover PersonEditForm and SegmentationTrainingCard branches
PersonEditForm: PERSON vs INSTITUTION/GROUP visibility matrix (firstName,
title, alias, birth/deathYear toggle), lastName label switch, prop
hydration of all populated fields, fallback to PERSON for unknown type,
empty-string handling for null fields. 10 tests, ~30 branches.

SegmentationTrainingCard: trainingInfo null vs populated, block count
display, button disabled-state matrix (training × tooFewBlocks ×
serviceDown), too-few-blocks and service-down hints, success message
after a mocked fetch, training history heading. 10 tests, ~25 branches.

Refs #496.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 21:50:28 +02:00
..

ocr (frontend)

UI for OCR job management, progress display, and sender-model training in the admin/enrichment panel.

What this domain owns

Components: OcrProgress.svelte, OcrTrigger.svelte, OcrTrainingCard.svelte, SegmentationTrainingCard.svelte, TrainingHistory.svelte. Utilities: translateOcrProgress.ts (progress-state → display-string mapping), training.ts (training API helpers).

What this domain does NOT own

  • OCR processing — all text recognition runs in the Python ocr-service/ container. The frontend shows job state; it does not run OCR.
  • Transcription block display — rendered by document/transcription/ components.

Key components

Component Used in Notes
OcrProgress.svelte document header, enrich panel Progress bar and status label for an active OCR job
OcrTrigger.svelte enrich panel, document detail Button to start an OCR job; disabled when one is running
OcrTrainingCard.svelte /admin/ocr Trigger sender-model training; shows training history
SegmentationTrainingCard.svelte /admin/ocr Trigger segmentation training
TrainingHistory.svelte /admin/ocr List of past training runs with status

Backend counterpart

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