diff --git a/frontend/src/lib/components/AnnotationSidePanel.svelte b/frontend/src/lib/components/AnnotationSidePanel.svelte
new file mode 100644
index 00000000..0a337662
--- /dev/null
+++ b/frontend/src/lib/components/AnnotationSidePanel.svelte
@@ -0,0 +1,65 @@
+
+
+
-
- {#if activeAnnotationId}
-
-
-
-
- {/if}
-
-
-
- {#if !activeAnnotationId || activeSubTab === 'document'}
-
- (docCommentCount = count)}
- />
- {:else}
-
- {#key activeAnnotationId}
- onAnnotationCommentCountChange?.(activeAnnotationId, count)}
- />
- {/key}
- {/if}
-
+
+
diff --git a/frontend/src/routes/documents/[id]/+page.svelte b/frontend/src/routes/documents/[id]/+page.svelte
index b3682c10..9142083d 100644
--- a/frontend/src/routes/documents/[id]/+page.svelte
+++ b/frontend/src/routes/documents/[id]/+page.svelte
@@ -3,6 +3,7 @@ import { onMount } from 'svelte';
import DocumentTopBar from '$lib/components/DocumentTopBar.svelte';
import DocumentViewer from '$lib/components/DocumentViewer.svelte';
import DocumentBottomPanel from '$lib/components/DocumentBottomPanel.svelte';
+import AnnotationSidePanel from '$lib/components/AnnotationSidePanel.svelte';
type Tab = 'metadata' | 'transcription' | 'discussion' | 'history';
@@ -58,14 +59,6 @@ let annotateMode = $state(false);
let activeAnnotationId = $state
(null);
let activeAnnotationPage = $state(null);
-// When an annotation is clicked, open the Diskussion tab.
-$effect(() => {
- if (activeAnnotationId) {
- activeTab = 'discussion';
- panelOpen = true;
- }
-});
-
// Close the panel when entering annotate mode so the PDF is fully visible.
$effect(() => {
if (annotateMode) panelOpen = false;
@@ -152,6 +145,18 @@ $effect(() => {
activeAnnotationId = id;
}}
/>
+ {
+ activeAnnotationId = null;
+ activeAnnotationPage = null;
+ }}
+ />