From c404008072b88fd556660f55f954a0fbfc8e960b Mon Sep 17 00:00:00 2001 From: Ananovo Date: Wed, 29 Jul 2026 19:55:56 +0800 Subject: [PATCH] fix(web): keep sticky workspace headers opaque and aligned (#1234) --- .../SessionList.directory-action.test.tsx | 37 +++++++++++++++++++ web/src/components/SessionList.tsx | 6 +-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/web/src/components/SessionList.directory-action.test.tsx b/web/src/components/SessionList.directory-action.test.tsx index caf27e49..fdb23635 100644 --- a/web/src/components/SessionList.directory-action.test.tsx +++ b/web/src/components/SessionList.directory-action.test.tsx @@ -88,6 +88,43 @@ describe('SessionList directory action', () => { }) }) + it('keeps the sticky project header opaque and aligned with the list viewport', () => { + const session = makeSession({ + id: 'session-1', + updatedAt: Date.now(), + metadata: { + path: '/home/ubuntu', + name: 'Greeting', + flavor: 'codex', + } + }) + + renderWithProviders( + + ) + + const projectHeader = screen.getByTitle('/home/ubuntu') + expect(projectHeader).toHaveClass('bg-[var(--app-bg)]') + expect(projectHeader).toHaveClass('hover:bg-[var(--app-secondary-bg)]') + expect(projectHeader).not.toHaveClass('hover:bg-[var(--app-subtle-bg)]') + + const listContent = projectHeader.parentElement?.parentElement + expect(listContent).not.toHaveClass('pt-1') + + const searchInput = screen.getByPlaceholderText(/Search sessions/) + const searchWrapper = searchInput.parentElement?.parentElement + expect(searchWrapper).toHaveClass('pb-1') + }) + it('hides the directory action for sessions without path metadata', () => { renderWithProviders( +
@@ -1281,7 +1281,7 @@ export function SessionList(props: {
-
+
{groups.map((group) => { const isCollapsed = isGroupCollapsed(group) const visibleGroupSessions = getVisibleGroupSessions(group) @@ -1297,7 +1297,7 @@ export function SessionList(props: { return (
toggleGroup(group.key, isCollapsed)} title={group.directory} >