Files
familienarchiv/frontend/src/lib/ocr
Marcel 19e2f65a21
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 / fail2ban Regex (push) Has been cancelled
CI / Semgrep Security Scan (push) Has been cancelled
CI / Compose Bucket Idempotency (push) Has been cancelled
CI / Unit & Component Tests (pull_request) Successful in 3m34s
CI / OCR Service Tests (pull_request) Successful in 20s
CI / fail2ban Regex (pull_request) Has been cancelled
CI / Semgrep Security Scan (pull_request) Has been cancelled
CI / Compose Bucket Idempotency (pull_request) Has been cancelled
CI / Backend Unit Tests (pull_request) Has been cancelled
fix(csrf): send X-XSRF-TOKEN on all client-side mutating fetch calls
hooks.server.ts already forwards the CSRF token for server-side fetch
(form actions, load). Client-side XHR calls bypassed it, causing Spring
Security to return 403 before PermissionAspect even ran.

Adds getCsrfToken/withCsrf/makeCsrfFetch to cookies.ts.
useTranscriptionBlocks wraps its injectable fetchImpl with makeCsrfFetch
(covers all block mutations and saveBlockWithConflictRetry).
useBlockAutoSave, TranscriptionEditView, BulkDocumentEditLayout,
OcrTrainingCard, and SegmentationTrainingCard apply withCsrf inline.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 20:35:51 +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