feat(transcription): show block numbers on PDF annotation overlays
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 1m26s
CI / Backend Unit Tests (pull_request) Failing after 2m29s
CI / E2E Tests (pull_request) Failing after 1h28m33s

Add blockNumbers prop through AnnotationLayer → PdfViewer → DocumentViewer.
Each turquoise annotation rectangle now shows a numbered badge (top-left,
matching the block card number in the right panel).

Block numbers are derived from sorted transcriptionBlocks, mapped by
annotationId, creating a visual link between PDF regions and block cards.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-05 21:39:11 +02:00
parent 7ad852dd52
commit 569a13e1b1
4 changed files with 43 additions and 1 deletions

View File

@@ -55,6 +55,14 @@ let activeAnnotationId = $state<string | null>(null);
let transcriptionBlocks = $state<TranscriptionBlockData[]>([]);
const blockNumbers = $derived(
Object.fromEntries(
[...transcriptionBlocks]
.sort((a, b) => a.sortOrder - b.sortOrder)
.map((b, i) => [b.annotationId, i + 1])
)
);
async function loadTranscriptionBlocks() {
if (!doc?.id) return;
try {
@@ -197,6 +205,7 @@ onMount(() => {
isLoading={isLoading}
error={fileError}
transcribeMode={transcribeMode}
blockNumbers={blockNumbers}
bind:activeAnnotationId={activeAnnotationId}
onAnnotationClick={handleAnnotationClick}
onTranscriptionDraw={createBlockFromDraw}