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

@@ -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}