feat(ocr): allow re-running OCR when transcription blocks already exist

Add a collapsible OCR trigger below the block list in edit mode.
Uses a <details> 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) <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-13 10:37:51 +02:00
parent 69768a104d
commit 3fe6eedffb
4 changed files with 20 additions and 0 deletions

View File

@@ -318,6 +318,23 @@ $effect(() => {
>
{m.transcription_next_block_cta({ number: sortedBlocks.length + 1 })}
</div>
{#if canRunOcr && onTriggerOcr}
<details class="mt-6">
<summary
class="cursor-pointer font-sans text-xs font-medium text-ink-3 transition-colors hover:text-brand-navy"
>
{m.ocr_rerun_label()}
</summary>
<div class="mt-3 max-w-xs">
<OcrTrigger
existingBlockCount={blocks.length}
storedScriptType={storedScriptType}
onTrigger={onTriggerOcr}
/>
</div>
</details>
{/if}
</div>
{:else}
<div class="flex flex-1 flex-col items-center justify-center px-6 py-12 text-center">