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: {