fix: bump comment text to text-base + reload annotations on block delete
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) Has been cancelled
CI / Backend Unit Tests (pull_request) Has been cancelled
CI / E2E Tests (pull_request) Has been cancelled

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 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-05 23:40:23 +02:00
parent ef11cbee4e
commit f359c19e4c
4 changed files with 11 additions and 3 deletions

View File

@@ -240,7 +240,7 @@ onMount(() => {
{/if} {/if}
</div> </div>
{#if parsed.quote} {#if parsed.quote}
<div class="my-1 border-l-2 border-line pl-2 font-serif text-sm text-ink-3 italic"> <div class="my-1 border-l-2 border-line pl-2 font-serif text-base text-ink-3 italic">
&ldquo;{parsed.quote}&rdquo; &ldquo;{parsed.quote}&rdquo;
</div> </div>
{/if} {/if}
@@ -258,7 +258,7 @@ onMount(() => {
<!-- svelte-ignore a11y_no_static_element_interactions --> <!-- svelte-ignore a11y_no_static_element_interactions -->
<div class="relative" onclick={() => { if (isOwn(msg)) startEdit(msg); }}> <div class="relative" onclick={() => { if (isOwn(msg)) startEdit(msg); }}>
<p <p
class="font-serif text-sm leading-relaxed text-ink-2 {isOwn(msg) ? '-mx-1 cursor-text rounded px-1 transition-colors hover:bg-surface' : ''}" class="font-serif text-base leading-relaxed text-ink-2 {isOwn(msg) ? '-mx-1 cursor-text rounded px-1 transition-colors hover:bg-surface' : ''}"
> >
<!-- eslint-disable-next-line svelte/no-at-html-tags -- renderBody escapes all HTML before injecting mention links --> <!-- eslint-disable-next-line svelte/no-at-html-tags -- renderBody escapes all HTML before injecting mention links -->
{@html renderBody(parsed.body, msg.mentionDTOs ?? [])} {@html renderBody(parsed.body, msg.mentionDTOs ?? [])}

View File

@@ -18,6 +18,7 @@ type Props = {
error: string; error: string;
transcribeMode?: boolean; transcribeMode?: boolean;
blockNumbers?: Record<string, number>; blockNumbers?: Record<string, number>;
annotationReloadKey?: number;
activeAnnotationId: string | null; activeAnnotationId: string | null;
onAnnotationClick: (id: string) => void; onAnnotationClick: (id: string) => void;
onTranscriptionDraw?: (rect: DrawRect) => void; onTranscriptionDraw?: (rect: DrawRect) => void;
@@ -30,6 +31,7 @@ let {
error, error,
transcribeMode = false, transcribeMode = false,
blockNumbers = {}, blockNumbers = {},
annotationReloadKey = 0,
activeAnnotationId = $bindable(), activeAnnotationId = $bindable(),
onAnnotationClick, onAnnotationClick,
onTranscriptionDraw onTranscriptionDraw
@@ -86,6 +88,7 @@ let {
documentId={doc.id} documentId={doc.id}
transcribeMode={transcribeMode} transcribeMode={transcribeMode}
blockNumbers={blockNumbers} blockNumbers={blockNumbers}
annotationReloadKey={annotationReloadKey}
bind:activeAnnotationId={activeAnnotationId} bind:activeAnnotationId={activeAnnotationId}
onAnnotationClick={onAnnotationClick} onAnnotationClick={onAnnotationClick}
onTranscriptionDraw={onTranscriptionDraw} onTranscriptionDraw={onTranscriptionDraw}

View File

@@ -12,6 +12,7 @@ let {
documentId = '', documentId = '',
transcribeMode = false, transcribeMode = false,
blockNumbers = {}, blockNumbers = {},
annotationReloadKey = 0,
activeAnnotationId = $bindable<string | null>(null), activeAnnotationId = $bindable<string | null>(null),
onAnnotationClick, onAnnotationClick,
onTranscriptionDraw, onTranscriptionDraw,
@@ -21,6 +22,7 @@ let {
documentId?: string; documentId?: string;
transcribeMode?: boolean; transcribeMode?: boolean;
blockNumbers?: Record<string, number>; blockNumbers?: Record<string, number>;
annotationReloadKey?: number;
activeAnnotationId?: string | null; activeAnnotationId?: string | null;
onAnnotationClick?: (id: string) => void; onAnnotationClick?: (id: string) => void;
onTranscriptionDraw?: (rect: DrawRect) => void; onTranscriptionDraw?: (rect: DrawRect) => void;
@@ -208,7 +210,7 @@ $effect(() => {
}); });
$effect(() => { $effect(() => {
if (documentId) { if (documentId && annotationReloadKey >= 0) {
loadAnnotations(documentId); loadAnnotations(documentId);
} }
}); });

View File

@@ -54,6 +54,7 @@ let activeAnnotationId = $state<string | null>(null);
// ── Transcription blocks ───────────────────────────────────────────────────── // ── Transcription blocks ─────────────────────────────────────────────────────
let transcriptionBlocks = $state<TranscriptionBlockData[]>([]); let transcriptionBlocks = $state<TranscriptionBlockData[]>([]);
let annotationReloadKey = $state(0);
const blockNumbers = $derived( const blockNumbers = $derived(
Object.fromEntries( Object.fromEntries(
@@ -92,6 +93,7 @@ async function deleteBlock(blockId: string) {
}); });
if (!res.ok) throw new Error('Delete failed'); if (!res.ok) throw new Error('Delete failed');
transcriptionBlocks = transcriptionBlocks.filter((b) => b.id !== blockId); transcriptionBlocks = transcriptionBlocks.filter((b) => b.id !== blockId);
annotationReloadKey++;
} }
async function createBlockFromDraw(rect: { async function createBlockFromDraw(rect: {
@@ -208,6 +210,7 @@ onMount(() => {
error={fileError} error={fileError}
transcribeMode={transcribeMode} transcribeMode={transcribeMode}
blockNumbers={blockNumbers} blockNumbers={blockNumbers}
annotationReloadKey={annotationReloadKey}
bind:activeAnnotationId={activeAnnotationId} bind:activeAnnotationId={activeAnnotationId}
onAnnotationClick={handleAnnotationClick} onAnnotationClick={handleAnnotationClick}
onTranscriptionDraw={createBlockFromDraw} onTranscriptionDraw={createBlockFromDraw}