From db8c22e1350e51d8213694749d45d3ff18f49ab5 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Wed, 9 Sep 2026 20:51:02 +0200 Subject: [PATCH] fix(app): stop the Find placeholder from hiding Go to line Hiding `.cm-panels` suppressed every CodeMirror panel in the file editor, including the Go to line dialog that Mod-Alt-g opens through the same search keymap. Hide only the inert Find placeholder panel instead, by its own class, and leave the shared panel container alone. --- packages/app/e2e/browser/pane-find.spec.ts | 38 ++++++++++++++++++++ packages/app/src/file-pane/find/model.web.ts | 7 ++-- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/packages/app/e2e/browser/pane-find.spec.ts b/packages/app/e2e/browser/pane-find.spec.ts index 1beb244735..45ba51cc2d 100644 --- a/packages/app/e2e/browser/pane-find.spec.ts +++ b/packages/app/e2e/browser/pane-find.spec.ts @@ -390,3 +390,41 @@ test.describe("the active match stays visible under the floating widget", () => await expect(right).toBeFocused(); }); }); + +test("Go to line keeps its dialog with Find closed and open", async ({ + page, + withWorkspace, +}, testInfo) => { + const workspace = await withWorkspace({ prefix: "pane-find-goto-" }); + const lines = Array.from({ length: 40 }, (_, index) => `line ${index + 1}`).join("\n"); + await writeFile(path.join(workspace.repoPath, "lines.txt"), `${lines}\n`); + await workspace.navigateTo(); + await openSource(page, "lines.txt"); + const gotoInput = page.getByRole("textbox", { name: "Go to line" }); + + await test.step("with Find closed", async () => { + await source(page).focus(); + await source(page).press("ControlOrMeta+Alt+g"); + await expect(gotoInput).toBeVisible(); + await page.screenshot({ path: testInfo.outputPath("goto-line-find-closed.png") }); + await gotoInput.fill("12"); + await gotoInput.press("Enter"); + await expect(page.getByLabel("Line 12, column 1")).toBeVisible(); + await expect(gotoInput).toBeHidden(); + }); + + await test.step("with Find open", async () => { + await source(page).press("ControlOrMeta+f"); + await expect(query(page)).toBeFocused(); + await query(page).fill("line 3"); + await source(page).focus(); + await source(page).press("ControlOrMeta+Alt+g"); + await expect(gotoInput).toBeVisible(); + await page.screenshot({ path: testInfo.outputPath("goto-line-find-open.png") }); + await gotoInput.fill("30"); + await gotoInput.press("Enter"); + await expect(page.getByLabel("Line 30, column 1")).toBeVisible(); + await expect(query(page)).toHaveValue("line 3"); + await expect(status(page)).toHaveText("11 matches"); + }); +}); diff --git a/packages/app/src/file-pane/find/model.web.ts b/packages/app/src/file-pane/find/model.web.ts index 2640684f4d..0ce22500a9 100644 --- a/packages/app/src/file-pane/find/model.web.ts +++ b/packages/app/src/file-pane/find/model.web.ts @@ -45,9 +45,10 @@ export class FileFindModel { readonly getSnapshot = () => this.snapshot; readonly extension: Extension = [ - // The widget floats over the editor as a sibling overlay, so CodeMirror's own - // panel slot stays empty and contributes no layout or scroll margin of its own. - EditorView.theme({ ".cm-panels": { display: "none" } }), + // The widget floats over the editor as a sibling overlay, so this panel is an + // inert placeholder that only reports whether Find is open. Hide the placeholder + // itself, never the shared panel container — Go to line's dialog lives there too. + EditorView.theme({ ".cm-panel.paseo-file-find": { display: "none" } }), // Reveal matches clear of the widget instead of underneath it. EditorView.scrollMargins.of((view) => { const clearance = this.clearance(view);