From 89b178f9aa84fffcb3050aed5753ae24ebe005ce Mon Sep 17 00:00:00 2001 From: misswell Date: Mon, 9 Nov 2026 14:29:23 +0800 Subject: [PATCH] feat(run): a Find entry on every console, not just the Run toolbar (#1764) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Console search exists (⌘F, the magnifier in a Run tab's toolbar), but a console without a toolbar of its own — a stack-trace tab, say — offered no visible way in: the shortcut only worked once the output had focus, and nothing said so. Every uncontrolled ConsoleView now shows a small Find button over the output's top-right corner, opening the same find bar (query, match count, Enter/Shift+Enter, case and regex options). Consoles whose find bar a toolbar drives keep exactly one entry: the toolbar's. How it was verified: - pnpm vitest run src/features/run/findBar.test.tsx: 9 passed, including a new test that the button opens the find bar and focuses its input. - pnpm typecheck. --- src/features/run/ConsoleView.tsx | 13 +++++++++++++ src/features/run/Run.module.css | 25 +++++++++++++++++++++++++ src/features/run/findBar.test.tsx | 7 +++++++ 3 files changed, 45 insertions(+) diff --git a/src/features/run/ConsoleView.tsx b/src/features/run/ConsoleView.tsx index 64cb70cb9..4493beae5 100644 --- a/src/features/run/ConsoleView.tsx +++ b/src/features/run/ConsoleView.tsx @@ -498,6 +498,19 @@ export function ConsoleView({ const items = virtualizer.getVirtualItems(); return (
+ {/* A console whose find bar is not driven by a toolbar (a stack-trace tab, say) still + needs a visible way in: the same Find the Run toolbar offers, over the output. */} + {controlledFindOpen === undefined && !findOpen && ( + + )} {findOpen && ( { + it("offers a visible Find entry in a console without a toolbar (stack traces)", () => { + setup(); + fireEvent.click(screen.getByRole("button", { name: "Find in console" })); + expect(screen.getByRole("search")).toBeInTheDocument(); + expect(input()).toHaveFocus(); + }); + it("opens on ⌘F, searches as you type and highlights every match", () => { const { log, view } = setup(); const bar = openFind(log);