From f359c19e4c689b8d9c0a379b6423e04592f5678e Mon Sep 17 00:00:00 2001 From: Marcel Date: Sun, 5 Apr 2026 23:40:23 +0200 Subject: [PATCH] fix: bump comment text to text-base + reload annotations on block delete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Comment text: - Body and quote bumped from text-sm (14px) to text-base (16px) to visually match the font-sans author name at text-sm Annotation reload on delete: - Add annotationReloadKey prop through DocumentViewer → PdfViewer - Increment key after block delete in +page.svelte - PdfViewer reloads annotations when key changes - Annotation rectangle disappears immediately, not just after refresh Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/lib/components/CommentThread.svelte | 4 ++-- frontend/src/lib/components/DocumentViewer.svelte | 3 +++ frontend/src/lib/components/PdfViewer.svelte | 4 +++- frontend/src/routes/documents/[id]/+page.svelte | 3 +++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/components/CommentThread.svelte b/frontend/src/lib/components/CommentThread.svelte index 2f836822..73858028 100644 --- a/frontend/src/lib/components/CommentThread.svelte +++ b/frontend/src/lib/components/CommentThread.svelte @@ -240,7 +240,7 @@ onMount(() => { {/if} {#if parsed.quote} -
+
“{parsed.quote}”
{/if} @@ -258,7 +258,7 @@ onMount(() => {
{ if (isOwn(msg)) startEdit(msg); }}>

{@html renderBody(parsed.body, msg.mentionDTOs ?? [])} diff --git a/frontend/src/lib/components/DocumentViewer.svelte b/frontend/src/lib/components/DocumentViewer.svelte index 275a27d4..6266f975 100644 --- a/frontend/src/lib/components/DocumentViewer.svelte +++ b/frontend/src/lib/components/DocumentViewer.svelte @@ -18,6 +18,7 @@ type Props = { error: string; transcribeMode?: boolean; blockNumbers?: Record; + annotationReloadKey?: number; activeAnnotationId: string | null; onAnnotationClick: (id: string) => void; onTranscriptionDraw?: (rect: DrawRect) => void; @@ -30,6 +31,7 @@ let { error, transcribeMode = false, blockNumbers = {}, + annotationReloadKey = 0, activeAnnotationId = $bindable(), onAnnotationClick, onTranscriptionDraw @@ -86,6 +88,7 @@ let { documentId={doc.id} transcribeMode={transcribeMode} blockNumbers={blockNumbers} + annotationReloadKey={annotationReloadKey} bind:activeAnnotationId={activeAnnotationId} onAnnotationClick={onAnnotationClick} onTranscriptionDraw={onTranscriptionDraw} diff --git a/frontend/src/lib/components/PdfViewer.svelte b/frontend/src/lib/components/PdfViewer.svelte index e3984d7f..a3f767f6 100644 --- a/frontend/src/lib/components/PdfViewer.svelte +++ b/frontend/src/lib/components/PdfViewer.svelte @@ -12,6 +12,7 @@ let { documentId = '', transcribeMode = false, blockNumbers = {}, + annotationReloadKey = 0, activeAnnotationId = $bindable(null), onAnnotationClick, onTranscriptionDraw, @@ -21,6 +22,7 @@ let { documentId?: string; transcribeMode?: boolean; blockNumbers?: Record; + annotationReloadKey?: number; activeAnnotationId?: string | null; onAnnotationClick?: (id: string) => void; onTranscriptionDraw?: (rect: DrawRect) => void; @@ -208,7 +210,7 @@ $effect(() => { }); $effect(() => { - if (documentId) { + if (documentId && annotationReloadKey >= 0) { loadAnnotations(documentId); } }); diff --git a/frontend/src/routes/documents/[id]/+page.svelte b/frontend/src/routes/documents/[id]/+page.svelte index b7fd293c..a3af67a0 100644 --- a/frontend/src/routes/documents/[id]/+page.svelte +++ b/frontend/src/routes/documents/[id]/+page.svelte @@ -54,6 +54,7 @@ let activeAnnotationId = $state(null); // ── Transcription blocks ───────────────────────────────────────────────────── let transcriptionBlocks = $state([]); +let annotationReloadKey = $state(0); const blockNumbers = $derived( Object.fromEntries( @@ -92,6 +93,7 @@ async function deleteBlock(blockId: string) { }); if (!res.ok) throw new Error('Delete failed'); transcriptionBlocks = transcriptionBlocks.filter((b) => b.id !== blockId); + annotationReloadKey++; } async function createBlockFromDraw(rect: { @@ -208,6 +210,7 @@ onMount(() => { error={fileError} transcribeMode={transcribeMode} blockNumbers={blockNumbers} + annotationReloadKey={annotationReloadKey} bind:activeAnnotationId={activeAnnotationId} onAnnotationClick={handleAnnotationClick} onTranscriptionDraw={createBlockFromDraw}