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:
@@ -54,6 +54,7 @@ let transcribeMode = $state(false);
|
||||
let panelMode = $state<'read' | 'edit'>('read');
|
||||
let activeAnnotationId = $state<string | null>(null);
|
||||
let highlightBlockId = $state<string | null>(null);
|
||||
let flashAnnotationId = $state<string | null>(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}
|
||||
|
||||
Reference in New Issue
Block a user