From 2bfbf45eba45ea9b627e79d576310d6d92a98398 Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 26 Mar 2026 12:47:08 +0100 Subject: [PATCH] refactor(types): extract shared types to \$lib/types.ts Eliminates type duplication across 6 files by introducing a single shared types module: - Comment + CommentReply: were identically defined in CommentThread, PanelDiscussion, and DocumentBottomPanel - DocumentPanelTab: was identically defined in DocumentBottomPanel and documents/[id]/+page.svelte - Annotation: was defined in both AnnotationLayer and PdfViewer (PdfViewer's variant with fileHash? is now the canonical definition) Co-Authored-By: Claude Sonnet 4.6 --- .../src/lib/components/AnnotationLayer.svelte | 12 +------ .../src/lib/components/CommentThread.svelte | 20 +---------- .../lib/components/DocumentBottomPanel.svelte | 28 +++------------- .../src/lib/components/PanelDiscussion.svelte | 20 +---------- frontend/src/lib/components/PdfViewer.svelte | 14 +------- frontend/src/lib/types.ts | 33 +++++++++++++++++++ .../src/routes/documents/[id]/+page.svelte | 7 ++-- 7 files changed, 44 insertions(+), 90 deletions(-) create mode 100644 frontend/src/lib/types.ts diff --git a/frontend/src/lib/components/AnnotationLayer.svelte b/frontend/src/lib/components/AnnotationLayer.svelte index f2e3a993..34ca26d2 100644 --- a/frontend/src/lib/components/AnnotationLayer.svelte +++ b/frontend/src/lib/components/AnnotationLayer.svelte @@ -1,15 +1,5 @@