feat(ui): add bidirectional scroll-sync with flash animations

Paragraph click flashes the PDF annotation outline (1.5s fade).
Annotation click highlights the paragraph with a background flash.
Both directions scroll the target into view.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-07 11:25:23 +02:00
parent e089192d7a
commit 81b14e5026
4 changed files with 33 additions and 1 deletions

View File

@@ -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<PDFDocumentProxy | null>(null);
@@ -459,6 +461,7 @@ function zoomOut() {
blockNumbers={blockNumbers}
activeAnnotationId={activeAnnotationId}
dimmed={annotationsDimmed}
flashAnnotationId={flashAnnotationId}
onDraw={handleDraw}
onAnnotationClick={handleAnnotationClick}
/>