diff --git a/e2e/searchEverywhereLayout.spec.ts b/e2e/searchEverywhereLayout.spec.ts index 0c393866bb..b820081593 100644 --- a/e2e/searchEverywhereLayout.spec.ts +++ b/e2e/searchEverywhereLayout.spec.ts @@ -21,6 +21,30 @@ async function searchFiles(page: Page) { return dialog; } +for (const count of [1, 2, 24]) { + test(`without the preview the results list shows its rows (${count} results)`, async ({ workbench: page }) => { + await stubDesktop(page); + await page.evaluate((count) => { + window.__ipc.handlers.find_files = () => + Array.from({ length: count }, (_, i) => ({ + path: `/dev/acme-api/src/main${i}.js`, + relPath: `src/main${i}.js`, + score: 100 - i, + indices: [], + })); + }, count); + await doubleShift(page); + const dialog = page.locator('[role="dialog"]:has(#se-query)'); + await dialog.getByRole("tab", { name: "Files", exact: true }).click(); + await dialog.getByRole("combobox", { name: "Search query" }).fill("main"); + await expect(dialog.getByRole("separator", { name: "Preview", exact: true })).toBeHidden(); + const list = dialog.getByRole("listbox", { name: "Results" }); + await expect + .poll(async () => (await list.boundingBox())?.height ?? 0) + .toBeGreaterThanOrEqual(Math.min(count, 5) * 24); + }); +} + test("preview splitter resizes with mouse and keyboard, keeps query focus and remembers its ratio", async ({ workbench: page, }) => { diff --git a/src/features/search/everywhere/SearchEverywhere.module.css b/src/features/search/everywhere/SearchEverywhere.module.css index 63b031b104..9d04ee8876 100644 --- a/src/features/search/everywhere/SearchEverywhere.module.css +++ b/src/features/search/everywhere/SearchEverywhere.module.css @@ -139,7 +139,9 @@ height: 532px; } .results { - flex: 1; + /* `auto`, not `1`: without the preview `.content` has no definite height, and a 0% basis there + collapses the list in the system WebKit of macOS 15 instead of using its inline height. */ + flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;