From 25936a2f4be4a499a1afe41fa6cd3fdbe5c8249b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Thu, 14 May 2026 23:04:16 +0800 Subject: [PATCH] fix: reduce desktop tab bar visual crowding The previous tab strip height made session titles and toolbar affordances feel cramped. Increase the shared titlebar height token for tabs, overflow controls, and the native drag gutter so the top chrome reads as a deliberate desktop titlebar while preserving the existing drag, close, and toolbar interactions. Constraint: Keep the change scoped to the desktop tab strip and avoid changing session state, ordering, or window-control behavior Rejected: Increase only the outer bar height | tab hit targets and overflow controls would remain visually misaligned Confidence: high Scope-risk: narrow Directive: Keep tab, overflow button, and drag-gutter heights aligned when changing this titlebar again Tested: cd desktop && bunx vitest run src/components/layout/TabBar.test.tsx Tested: bun run check:desktop Tested: Browser smoke on Vite with tab bar measured at about 44px and toolbar controls centered Not-tested: Native packaged Tauri window rendering on Windows titlebar controls --- desktop/src/components/layout/TabBar.test.tsx | 28 +++++++++++++++++++ desktop/src/components/layout/TabBar.tsx | 10 +++---- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/desktop/src/components/layout/TabBar.test.tsx b/desktop/src/components/layout/TabBar.test.tsx index 42544b27..f2f4e9c1 100644 --- a/desktop/src/components/layout/TabBar.test.tsx +++ b/desktop/src/components/layout/TabBar.test.tsx @@ -256,6 +256,34 @@ describe('TabBar', () => { expect(screen.getByTestId('tab-bar-drag-gutter')).toHaveAttribute('data-tauri-drag-region') }) + it('keeps the desktop tab strip at a roomier titlebar height', async () => { + const { TabBar } = await import('./TabBar') + const { useTabStore } = await import('../../stores/tabStore') + const { useChatStore } = await import('../../stores/chatStore') + + useTabStore.setState({ + tabs: [ + { sessionId: 'tab-1', title: 'Untitled Session', type: 'session', status: 'idle' }, + ], + activeTabId: 'tab-1', + }) + useChatStore.setState({ + sessions: {}, + disconnectSession: vi.fn(), + } as Partial>) + + await act(async () => { + render() + }) + + const tabBar = screen.getByTestId('tab-bar') + const tab = screen.getByText('Untitled Session').closest('.tab-bar-hit-area') + + expect(tabBar).toHaveClass('min-h-11') + expect(tab).toHaveClass('min-h-11') + expect(screen.getByTestId('tab-bar-drag-gutter')).toHaveClass('min-h-11') + }) + it('passes the active session workdir into the open-project control', async () => { const { TabBar } = await import('./TabBar') const { useTabStore } = await import('../../stores/tabStore') diff --git a/desktop/src/components/layout/TabBar.tsx b/desktop/src/components/layout/TabBar.tsx index 08c55727..94af3ba3 100644 --- a/desktop/src/components/layout/TabBar.tsx +++ b/desktop/src/components/layout/TabBar.tsx @@ -294,11 +294,11 @@ export function TabBar() { return (
{canScrollLeft && ( - )} @@ -357,12 +357,12 @@ export function TabBar() { data-testid="tab-bar-drag-gutter" data-tauri-drag-region aria-hidden="true" - className={`flex-shrink-0 min-h-[37px] ${showWindowControls ? 'w-3' : 'w-4'}`} + className={`min-h-11 flex-shrink-0 ${showWindowControls ? 'w-3' : 'w-4'}`} /> )} {canScrollRight && ( - )} @@ -466,7 +466,7 @@ const TabItem = forwardRef