From 3fe6eedffbf921293176fa3dff20e0a4ee6b8ec3 Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 13 Apr 2026 10:37:51 +0200 Subject: [PATCH] feat(ocr): allow re-running OCR when transcription blocks already exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a collapsible OCR trigger below the block list in edit mode. Uses a
element so it's unobtrusive — the primary workflow is editing existing blocks, but users can expand to re-run OCR with a confirmation dialog that warns about replacing existing blocks. Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/messages/de.json | 1 + frontend/messages/en.json | 1 + frontend/messages/es.json | 1 + .../lib/components/TranscriptionEditView.svelte | 17 +++++++++++++++++ 4 files changed, 20 insertions(+) diff --git a/frontend/messages/de.json b/frontend/messages/de.json index 683c1b3a..2221634e 100644 --- a/frontend/messages/de.json +++ b/frontend/messages/de.json @@ -515,6 +515,7 @@ "ocr_confirm_title": "Vorhandene Transkription ersetzen?", "ocr_confirm_body": "Alle {count} vorhandenen Blöcke werden gelöscht und durch die OCR-Ergebnisse ersetzt. Diese Aktion kann nicht rückgängig gemacht werden.", "ocr_confirm_btn": "Ersetzen", + "ocr_rerun_label": "OCR erneut ausführen…", "ocr_progress_heading": "OCR läuft", "ocr_progress_page": "Seite {current} von {total}", "ocr_error_heading": "OCR fehlgeschlagen", diff --git a/frontend/messages/en.json b/frontend/messages/en.json index c61bc728..8dcfb42e 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -515,6 +515,7 @@ "ocr_confirm_title": "Replace existing transcription?", "ocr_confirm_body": "All {count} existing blocks will be deleted and replaced with OCR results. This action cannot be undone.", "ocr_confirm_btn": "Replace", + "ocr_rerun_label": "Re-run OCR…", "ocr_progress_heading": "OCR running", "ocr_progress_page": "Page {current} of {total}", "ocr_error_heading": "OCR failed", diff --git a/frontend/messages/es.json b/frontend/messages/es.json index 6dcf5a25..1737621b 100644 --- a/frontend/messages/es.json +++ b/frontend/messages/es.json @@ -515,6 +515,7 @@ "ocr_confirm_title": "¿Reemplazar transcripción existente?", "ocr_confirm_body": "Los {count} bloques existentes serán eliminados y reemplazados con los resultados del OCR. Esta acción no se puede deshacer.", "ocr_confirm_btn": "Reemplazar", + "ocr_rerun_label": "Ejecutar OCR de nuevo…", "ocr_progress_heading": "OCR en curso", "ocr_progress_page": "Página {current} de {total}", "ocr_error_heading": "OCR fallido", diff --git a/frontend/src/lib/components/TranscriptionEditView.svelte b/frontend/src/lib/components/TranscriptionEditView.svelte index d1c74e29..a8f27ec3 100644 --- a/frontend/src/lib/components/TranscriptionEditView.svelte +++ b/frontend/src/lib/components/TranscriptionEditView.svelte @@ -318,6 +318,23 @@ $effect(() => { > {m.transcription_next_block_cta({ number: sortedBlocks.length + 1 })} + + {#if canRunOcr && onTriggerOcr} +
+ + {m.ocr_rerun_label()} + +
+ +
+
+ {/if} {:else}