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}