fix: clicking annotation enters transcribe mode and scrolls to block
Some checks failed
CI / Unit & Component Tests (push) Has been cancelled
CI / Backend Unit Tests (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CI / Unit & Component Tests (pull_request) Failing after 1m27s
CI / Backend Unit Tests (pull_request) Failing after 2m37s
CI / E2E Tests (pull_request) Failing after 1h28m16s
Some checks failed
CI / Unit & Component Tests (push) Has been cancelled
CI / Backend Unit Tests (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CI / Unit & Component Tests (pull_request) Failing after 1m27s
CI / Backend Unit Tests (pull_request) Failing after 2m37s
CI / E2E Tests (pull_request) Failing after 1h28m16s
When clicking a turquoise annotation on the PDF: - If not in transcribe mode, enters it and loads blocks - Waits for DOM render, then scrolls to the corresponding block card Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -124,16 +124,22 @@ function handleBlockFocus(blockId: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleAnnotationClick(annotationId: string) {
|
async function handleAnnotationClick(annotationId: string) {
|
||||||
activeAnnotationId = annotationId;
|
activeAnnotationId = annotationId;
|
||||||
// In transcribe mode, focus the block that owns this annotation
|
|
||||||
if (transcribeMode) {
|
if (!transcribeMode) {
|
||||||
|
transcribeMode = true;
|
||||||
|
await loadTranscriptionBlocks();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait for DOM to render the blocks, then scroll to the matching one
|
||||||
|
requestAnimationFrame(() => {
|
||||||
const block = transcriptionBlocks.find((b) => b.annotationId === annotationId);
|
const block = transcriptionBlocks.find((b) => b.annotationId === annotationId);
|
||||||
if (block) {
|
if (block) {
|
||||||
const el = document.querySelector(`[data-block-id="${block.id}"]`);
|
const el = document.querySelector(`[data-block-id="${block.id}"]`);
|
||||||
el?.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
el?.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load blocks when transcribe mode is entered
|
// Load blocks when transcribe mode is entered
|
||||||
|
|||||||
Reference in New Issue
Block a user