diff --git a/frontend/src/lib/components/AnnotationLayer.svelte b/frontend/src/lib/components/AnnotationLayer.svelte index cb862772..4dbe4c28 100644 --- a/frontend/src/lib/components/AnnotationLayer.svelte +++ b/frontend/src/lib/components/AnnotationLayer.svelte @@ -15,6 +15,7 @@ let { blockNumbers = {}, activeAnnotationId = null, dimmed = false, + flashAnnotationId = null, onDraw, onAnnotationClick }: { @@ -24,6 +25,7 @@ let { blockNumbers?: Record; activeAnnotationId?: string | null; dimmed?: boolean; + flashAnnotationId?: string | null; onDraw: (rect: DrawRect) => void; onAnnotationClick?: (id: string) => void; } = $props(); @@ -110,6 +112,7 @@ const containerStyle = $derived(
{/if} + + diff --git a/frontend/src/lib/components/DocumentViewer.svelte b/frontend/src/lib/components/DocumentViewer.svelte index 707ae0ba..c48d1f2a 100644 --- a/frontend/src/lib/components/DocumentViewer.svelte +++ b/frontend/src/lib/components/DocumentViewer.svelte @@ -21,6 +21,7 @@ type Props = { annotationReloadKey?: number; activeAnnotationId: string | null; annotationsDimmed?: boolean; + flashAnnotationId?: string | null; onAnnotationClick: (id: string) => void; onTranscriptionDraw?: (rect: DrawRect) => void; }; @@ -35,6 +36,7 @@ let { annotationReloadKey = 0, activeAnnotationId = $bindable(), annotationsDimmed = false, + flashAnnotationId = null, onAnnotationClick, onTranscriptionDraw }: Props = $props(); @@ -93,6 +95,7 @@ let { annotationReloadKey={annotationReloadKey} bind:activeAnnotationId={activeAnnotationId} annotationsDimmed={annotationsDimmed} + flashAnnotationId={flashAnnotationId} onAnnotationClick={onAnnotationClick} onTranscriptionDraw={onTranscriptionDraw} documentFileHash={doc.fileHash ?? null} diff --git a/frontend/src/lib/components/PdfViewer.svelte b/frontend/src/lib/components/PdfViewer.svelte index 05373848..7705620b 100644 --- a/frontend/src/lib/components/PdfViewer.svelte +++ b/frontend/src/lib/components/PdfViewer.svelte @@ -17,7 +17,8 @@ let { onAnnotationClick, onTranscriptionDraw, documentFileHash, - annotationsDimmed = false + annotationsDimmed = false, + flashAnnotationId = null }: { url: string; documentId?: string; @@ -29,6 +30,7 @@ let { onTranscriptionDraw?: (rect: DrawRect) => void; documentFileHash?: string | null; annotationsDimmed?: boolean; + flashAnnotationId?: string | null; } = $props(); let pdfDoc = $state(null); @@ -459,6 +461,7 @@ function zoomOut() { blockNumbers={blockNumbers} activeAnnotationId={activeAnnotationId} dimmed={annotationsDimmed} + flashAnnotationId={flashAnnotationId} onDraw={handleDraw} onAnnotationClick={handleAnnotationClick} /> diff --git a/frontend/src/routes/documents/[id]/+page.svelte b/frontend/src/routes/documents/[id]/+page.svelte index f4f5d4eb..2b1005a9 100644 --- a/frontend/src/routes/documents/[id]/+page.svelte +++ b/frontend/src/routes/documents/[id]/+page.svelte @@ -54,6 +54,7 @@ let transcribeMode = $state(false); let panelMode = $state<'read' | 'edit'>('read'); let activeAnnotationId = $state(null); let highlightBlockId = $state(null); +let flashAnnotationId = $state(null); // ── Transcription blocks ───────────────────────────────────────────────────── @@ -177,6 +178,10 @@ async function handleAnnotationClick(annotationId: string) { function handleParagraphClick(annotationId: string) { activeAnnotationId = annotationId; + flashAnnotationId = annotationId; + setTimeout(() => { + flashAnnotationId = null; + }, 1500); } // Load blocks when transcribe mode is entered and set default panel mode @@ -241,6 +246,7 @@ onMount(() => { blockNumbers={blockNumbers} annotationReloadKey={annotationReloadKey} annotationsDimmed={transcribeMode && panelMode === 'read'} + flashAnnotationId={flashAnnotationId} bind:activeAnnotationId={activeAnnotationId} onAnnotationClick={handleAnnotationClick} onTranscriptionDraw={createBlockFromDraw}