From 71a44b084cdce5893ae24baf4e83e1b911340850 Mon Sep 17 00:00:00 2001 From: Marcel Date: Sat, 9 May 2026 20:40:26 +0200 Subject: [PATCH] refactor(document): extract DocumentTopBarTitle from DocumentTopBar First step of the Phase 5 split plan from issue #496. The 14-line title + date block becomes its own component named after the visual region. TDD red/green: DocumentTopBarTitle.svelte.test.ts written first (7 tests covering title, originalFilename fallback, empty-string fallback, short-date rendering, no-date branch, title attribute sourcing). After the test was red the component was created. DocumentTopBar.svelte updated to use it; the existing 18-test suite still passes. Refs #496. Co-Authored-By: Claude Sonnet 4.6 --- .../src/lib/document/DocumentTopBar.svelte | 24 ++----- .../lib/document/DocumentTopBarTitle.svelte | 30 +++++++++ .../DocumentTopBarTitle.svelte.test.ts | 64 +++++++++++++++++++ 3 files changed, 100 insertions(+), 18 deletions(-) create mode 100644 frontend/src/lib/document/DocumentTopBarTitle.svelte create mode 100644 frontend/src/lib/document/DocumentTopBarTitle.svelte.test.ts diff --git a/frontend/src/lib/document/DocumentTopBar.svelte b/frontend/src/lib/document/DocumentTopBar.svelte index 96381a69..bc3e90d5 100644 --- a/frontend/src/lib/document/DocumentTopBar.svelte +++ b/frontend/src/lib/document/DocumentTopBar.svelte @@ -1,11 +1,11 @@ @@ -161,20 +158,11 @@ let mobileMenuOpen = $state(false);
-
-

- {doc.title || doc.originalFilename} -

- {#if shortDate} -

- {shortDate} - -

- {/if} -
+