From 49a112f18e9bf6a6a3bf50915495049af92e017d Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Sun, 25 Oct 2026 12:27:29 +0100 Subject: [PATCH] fix(app): keep the command palette at a fixed height (#58939) Co-authored-by: vimtor --- .../app/e2e/regression/command-palette.spec.ts | 16 ++++++++++++++++ packages/app/src/shell/commands/dialog.css | 12 ++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/app/e2e/regression/command-palette.spec.ts b/packages/app/e2e/regression/command-palette.spec.ts index 77be5062485..d2396b481dc 100644 --- a/packages/app/e2e/regression/command-palette.spec.ts +++ b/packages/app/e2e/regression/command-palette.spec.ts @@ -232,3 +232,19 @@ test("navigation replaces commands without retaining disposed owners", async ({ ) expect(warnings).toEqual([]) }) + +test("keeps the same height as the number of results changes", async ({ page }) => { + const { dialog, input } = await openCommandPalette(page) + const container = page.locator('[data-component="dialog-v2"] [data-slot="dialog-container"]') + const height = async () => (await container.boundingBox())?.height + const initial = await height() + expect(initial).toBe(480) + + await input.fill("copy session") + await expect(dialog.getByRole("option")).toHaveCount(1) + expect(await height()).toBe(initial) + + await input.fill("zzzz no palette match") + await expect(dialog.getByText("No results found")).toBeVisible() + expect(await height()).toBe(initial) +}) diff --git a/packages/app/src/shell/commands/dialog.css b/packages/app/src/shell/commands/dialog.css index 284e2f9f8c0..2bb15673a5a 100644 --- a/packages/app/src/shell/commands/dialog.css +++ b/packages/app/src/shell/commands/dialog.css @@ -2,18 +2,10 @@ overflow: hidden; } -/* Anchor to the top edge of where a centered 480px-tall dialog would sit, so the - top stays put while the content-driven height grows and shrinks. */ -[data-component="dialog-v2"]:has(.command-palette) { - align-items: flex-start; -} - +/* Keep a fixed height so the dialog does not resize as results change while typing. */ [data-component="dialog-v2"]:has(.command-palette) [data-slot="dialog-container"] { width: min(calc(100vw - 24px), 640px); - height: auto; - min-height: 280px; - max-height: min(calc(100vh - 96px), 480px); - margin-top: max(48px, calc((100vh - 480px) / 2)); + height: min(calc(100vh - 96px), 480px); border-radius: 12px; background: var(--v2-background-bg-base); box-shadow: var(--v2-elevation-floating);