Compare commits

...
Author SHA1 Message Date
l0ng-ai 1748afd991 fix(search): show the results list when the preview is off
Without the preview, `.content` has no definite height, and the results
pane's `flex: 1` (a 0% basis) collapsed it to its padding in the system
WebKit of macOS 15, so Search Everywhere and Go to File showed no rows.
The pane now uses an `auto` basis and keeps its inline height.
2026-11-11 09:39:30 +08:00
2 changed files with 27 additions and 1 deletions

No files matched your search

+24
View File
@@ -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,
}) => {
@@ -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;