From 1cbe48fe5d83a4cfbc2388259ce0d744c89160ed Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2026 02:28:00 +0000 Subject: [PATCH] fix(app): give every session header hover state the same height (#58195) Co-authored-by: iamdavidhill <1879069+iamdavidhill@users.noreply.github.com> --- packages/app/e2e/regression/session-header.spec.ts | 14 ++++++++++++-- .../app/src/session/session-identity-header.css | 9 +++++---- .../app/src/session/session-identity-header.tsx | 4 ++-- .../app/src/session/timeline/message-timeline.tsx | 6 +++--- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/packages/app/e2e/regression/session-header.spec.ts b/packages/app/e2e/regression/session-header.spec.ts index 226ebab1734..6b3625a04e5 100644 --- a/packages/app/e2e/regression/session-header.spec.ts +++ b/packages/app/e2e/regression/session-header.spec.ts @@ -30,6 +30,15 @@ for (const direction of ["ltr", "rtl"] as const) { const titleBounds = await header.getByRole("heading").boundingBox() expect(titleBounds).not.toBeNull() + // Every control in the header highlights the same 28px band on hover. + const usage = header.getByRole("button", { name: "Toggle session context", exact: true }) + const heights = await Promise.all( + [project, header.getByRole("heading"), options, usage, details, review].map( + async (control) => (await control.boundingBox())?.height, + ), + ) + expect(heights).toEqual([28, 28, 28, 28, 28, 28]) + for (const editing of [false, true]) { if (editing) { await header.getByRole("heading").click() @@ -231,8 +240,9 @@ test.describe("location", () => { await expect(header.locator(".session-location-worktree-icon")).toBeHidden() const location = header.locator('[data-slot="session-location-trigger"]') await location.hover() - await expect(location).toHaveCSS("padding-inline-start", "4px") - await expect(location).toHaveCSS("padding-inline-end", "4px") + await expect(location).toHaveCSS("padding-inline-start", "6px") + await expect(location).toHaveCSS("padding-inline-end", "6px") + expect(await location.boundingBox()).toMatchObject({ width: 28, height: 28 }) } await header.screenshot({ path: test.info().outputPath(`location-${panel ? "compact" : "expanded"}.png`) }) } diff --git a/packages/app/src/session/session-identity-header.css b/packages/app/src/session/session-identity-header.css index cba60f85e49..d48469a4796 100644 --- a/packages/app/src/session/session-identity-header.css +++ b/packages/app/src/session/session-identity-header.css @@ -31,16 +31,17 @@ .session-header-location > [data-slot="session-location-trigger"] { gap: 8px; - padding-inline: 4px; + padding-inline: 6px; } - /* The avatar-only trigger sits 4px from its avatar on every side, and the row adds a 4px gap. */ + /* The avatar-only trigger is square like the header's icon buttons, 6px from its avatar on every side, and the row + adds a 4px gap. */ .session-header-location > .session-header-separator { - --separator-before: 8px; + --separator-before: 10px; } .session-header-location > .session-header-separator:dir(rtl) { - --separator-before: 7px; + --separator-before: 9px; } /* The collapsed header reads avatar, separator, title; the names stay in the trigger's title and accessible name. */ diff --git a/packages/app/src/session/session-identity-header.tsx b/packages/app/src/session/session-identity-header.tsx index 95f368eead8..c038039f519 100644 --- a/packages/app/src/session/session-identity-header.tsx +++ b/packages/app/src/session/session-identity-header.tsx @@ -183,7 +183,7 @@ export function SessionLocation(props: {