From 2b8032524df12d761563b90edb6ea7d67103fb7d Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 22 Apr 2026 14:34:31 +0200 Subject: [PATCH] fix(nav): restore DocumentTopBar back button sizing and add right padding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - BackButton gains showLabel prop: showLabel=false renders icon-only with aria-label, no mr-2 on svg (was causing 0px button width in topbar) - DocumentTopBar: BackButton restored to h-11 w-11 circular touch target with showLabel=false matching the original 44×44px it replaced - Topbar row gets pr-4 (16px right padding per spec); action buttons div no longer needs its own pr-3 Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/lib/components/BackButton.svelte | 7 ++++--- frontend/src/lib/components/BackButton.svelte.spec.ts | 7 +++++++ frontend/src/lib/components/DocumentTopBar.svelte | 9 ++++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/frontend/src/lib/components/BackButton.svelte b/frontend/src/lib/components/BackButton.svelte index 622cd726..7108f02f 100644 --- a/frontend/src/lib/components/BackButton.svelte +++ b/frontend/src/lib/components/BackButton.svelte @@ -1,15 +1,16 @@ diff --git a/frontend/src/lib/components/BackButton.svelte.spec.ts b/frontend/src/lib/components/BackButton.svelte.spec.ts index 5df58856..4d00cb5b 100644 --- a/frontend/src/lib/components/BackButton.svelte.spec.ts +++ b/frontend/src/lib/components/BackButton.svelte.spec.ts @@ -33,4 +33,11 @@ describe('BackButton', () => { expect(btn?.className).toContain('mr-3'); expect(btn?.className).not.toContain('mb-4'); }); + + it('hides label text and sets aria-label when showLabel is false', async () => { + render(BackButton, { props: { showLabel: false } }); + const btn = document.querySelector('button'); + expect(btn?.textContent?.trim()).toBe(''); + expect(btn?.getAttribute('aria-label')).toMatch(/zurück/i); + }); }); diff --git a/frontend/src/lib/components/DocumentTopBar.svelte b/frontend/src/lib/components/DocumentTopBar.svelte index 614ae9f5..f352364a 100644 --- a/frontend/src/lib/components/DocumentTopBar.svelte +++ b/frontend/src/lib/components/DocumentTopBar.svelte @@ -129,12 +129,15 @@ let mobileMenuOpen = $state(false);
-
+
- +
@@ -190,7 +193,7 @@ let mobileMenuOpen = $state(false); -
+
{#if canWrite && isPdf && !transcribeMode} {@render transcribeBtn(false)} {/if}