mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-16 13:05:14 +03:00
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>
This commit is contained in:
committed by
GitHub
Unverified
parent
8ee9351be9
commit
622c74d530
@@ -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")
|
||||
|
||||
@@ -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 (
|
||||
<button
|
||||
type="button"
|
||||
class="flex h-6 max-w-[280px] items-center gap-1.5 rounded-sm bg-v2-background-bg-base px-1.5 text-13-medium text-v2-text-text-base shadow-[var(--v2-elevation-raised)]"
|
||||
class="-ms-1.5 flex h-6 max-w-[280px] items-center gap-1.5 rounded-sm bg-v2-background-bg-base px-1.5 text-13-medium text-v2-text-text-base shadow-[var(--v2-elevation-raised)]"
|
||||
aria-label={props.label}
|
||||
onMouseDown={(event) => event.preventDefault()}
|
||||
onClick={props.onBack}
|
||||
|
||||
Reference in New Issue
Block a user