From ee85ce466866d290a14c052fe26c73bd76406812 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 24 Mar 2026 22:49:44 +0100 Subject: [PATCH] feat(frontend): keep annotation tab after switching to document discussion Clicking the Diskussion sub-tab no longer deselects the active annotation, so the Annotation tab stays visible and accessible for easy toggling back. The annotation is cleared only via Escape or clicking elsewhere on the PDF. Removes the now-unused onClearAnnotation callback chain. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/lib/components/DocumentBottomPanel.svelte | 3 --- frontend/src/lib/components/PanelDiscussion.svelte | 3 --- frontend/src/routes/documents/[id]/+page.svelte | 4 ---- 3 files changed, 10 deletions(-) diff --git a/frontend/src/lib/components/DocumentBottomPanel.svelte b/frontend/src/lib/components/DocumentBottomPanel.svelte index adc8c2f9..514f808f 100644 --- a/frontend/src/lib/components/DocumentBottomPanel.svelte +++ b/frontend/src/lib/components/DocumentBottomPanel.svelte @@ -50,7 +50,6 @@ type Props = { activeTab: Tab; activeAnnotationId: string | null; activeAnnotationPage: number | null; - onClearAnnotation?: () => void; onAnnotationCommentCountChange?: (annotationId: string, count: number) => void; }; @@ -65,7 +64,6 @@ let { activeTab = $bindable(), activeAnnotationId, activeAnnotationPage, - onClearAnnotation, onAnnotationCommentCountChange }: Props = $props(); @@ -191,7 +189,6 @@ const panelHeight = $derived(open ? height : MIN_HEIGHT); canComment={canComment} currentUserId={currentUserId} canAdmin={canAdmin} - onClearAnnotation={onClearAnnotation} onAnnotationCommentCountChange={onAnnotationCommentCountChange} /> {:else if activeTab === 'history'} diff --git a/frontend/src/lib/components/PanelDiscussion.svelte b/frontend/src/lib/components/PanelDiscussion.svelte index e15658fb..8ebf4abd 100644 --- a/frontend/src/lib/components/PanelDiscussion.svelte +++ b/frontend/src/lib/components/PanelDiscussion.svelte @@ -29,7 +29,6 @@ type Props = { canComment: boolean; currentUserId: string | null; canAdmin: boolean; - onClearAnnotation?: () => void; onAnnotationCommentCountChange?: (annotationId: string, count: number) => void; }; @@ -41,7 +40,6 @@ let { canComment, currentUserId, canAdmin, - onClearAnnotation, onAnnotationCommentCountChange }: Props = $props(); @@ -64,7 +62,6 @@ $effect(() => { function selectDocumentTab() { activeSubTab = 'document'; - onClearAnnotation?.(); } function selectAnnotationTab() { diff --git a/frontend/src/routes/documents/[id]/+page.svelte b/frontend/src/routes/documents/[id]/+page.svelte index e5c820d6..a16e7c13 100644 --- a/frontend/src/routes/documents/[id]/+page.svelte +++ b/frontend/src/routes/documents/[id]/+page.svelte @@ -162,8 +162,4 @@ $effect(() => { bind:activeTab={activeTab} activeAnnotationId={activeAnnotationId} activeAnnotationPage={activeAnnotationPage} - onClearAnnotation={() => { - activeAnnotationId = null; - activeAnnotationPage = null; - }} />