From 622c74d5308ea2f3e2976c6b6dbd71e37c0a54e0 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2026 13:34:10 +0800 Subject: [PATCH] fix(app): line up the location dialog's project chip with the row icons (#58356) Co-authored-by: Brendonovich <14191578+Brendonovich@users.noreply.github.com> --- packages/app/e2e/regression/new-session.spec.ts | 9 +++++++++ packages/app/src/new-session/location/dialog.tsx | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/app/e2e/regression/new-session.spec.ts b/packages/app/e2e/regression/new-session.spec.ts index 8f596c56b95..3e03a40dbef 100644 --- a/packages/app/e2e/regression/new-session.spec.ts +++ b/packages/app/e2e/regression/new-session.spec.ts @@ -621,6 +621,15 @@ test("the location dialog lists every ready server's projects in one list and ta await expect(chip.locator('[data-component="tag"]')).toHaveText("apollo") await expect(options.locator(".command-palette-title")).toHaveText(["opencode", "New worktree", "opencode-beta"]) await expect(options.nth(0)).toHaveAttribute("aria-selected", "true") + // The chip's avatar sits on the same column as the row icons below it. + await expect + .poll(async () => { + const avatar = await chip.locator('[data-component="project-avatar-v2"]').boundingBox() + const icon = await options.nth(0).locator(".command-palette-row-icon").boundingBox() + + return avatar && icon ? Math.abs(avatar.x - icon.x) : Infinity + }) + .toBeLessThanOrEqual(0.5) await page.keyboard.press("Backspace") await expect(search).toHaveValue("opencode") await expect(options.nth(0)).toHaveAttribute("aria-selected", "true") diff --git a/packages/app/src/new-session/location/dialog.tsx b/packages/app/src/new-session/location/dialog.tsx index cd47986363c..679b0ad6ab0 100644 --- a/packages/app/src/new-session/location/dialog.tsx +++ b/packages/app/src/new-session/location/dialog.tsx @@ -501,11 +501,13 @@ function DrillButton(props: { label: string; onDrill: () => void }) { ) } +// The negative start margin cancels the chip's padding, so its icon sits where the search icon would and lines up with +// the row icons, leaving the chip the same 6px inset from the field on every side. function BackChip(props: { label: string; onBack: () => void; children: JSX.Element }) { return (