feat(desktop): add Cmd+F search to v2 changes pane
Summary
Adds Cmd+F (Ctrl+Shift+F on Windows/Linux) text search to the v2 changes (diff) pane, matching the existing find-in-terminal / find-in-chat / find-in-file-viewer experience.
- New
FIND_IN_DIFFhotkey in the renderer hotkey registry (⌘Fmac,Ctrl+Shift+Fwin/linux), gated to the active diff pane. - New
useDiffPaneSearchhook that wraps the shareduseTextSearchengine, searching across each file's@pierre/diffsshadow root viagetDiffSearchRootsand auto-closing when the pane loses focus. DiffPanenow wrapsCodeViewin a relative container and renders the existingMarkdownSearchoverlay (input,X of Ymatch count, case toggle, prev/next, Esc to close; Enter / Shift+Enter to navigate).
Known limitation
CodeView is virtualized, so off-screen lines aren't in the DOM. Matches are scoped to currently rendered/expanded content and the count updates as you scroll — the same trade-off the shipped v1 diff/chat search makes. Collapsed files are naturally excluded. A stable total count + jump-to-off-screen would require a data-driven search with scrollTo navigation (possible follow-up).
Test Plan
- Open the Changes pane in a v2 workspace, press
⌘F, type a query, and confirm matches highlight with aX of Ycount. - Enter / Shift+Enter cycle through matches; case toggle works; Esc closes.
- Search closes automatically when focus leaves the diff pane.
-
bun run lintandbun run typecheckpass.
Summary by cubic
Adds Cmd+F (Ctrl+Shift+F on Windows/Linux) search to the v2 Changes pane. Uses the shared find UI with match highlighting, X of Y, case toggle, Enter/Shift+Enter navigation, and Esc to close.
-
New Features
- Added
FIND_IN_DIFFhotkey scoped to the active changes pane. DiffPanemountsMarkdownSearchand usesuseDiffPaneSearch(viauseFindHotkeySearch) to search inside@pierre/diffsshadow roots; auto-closes on focus loss.- Limitation:
CodeViewis virtualized, so only visible/expanded lines are searchable; counts update as you scroll.
- Added
-
Refactors
- Extracted
useFindHotkeySearchto standardize Cmd+F behavior (toggle, auto-close, file-change reset). - Migrated chat and file viewer search hooks to
useFindHotkeySearch.
- Extracted
Summary by CodeRabbit
-
New Features
- In-pane Markdown search added to the diff view with Cmd/Ctrl+F support, case-sensitive matching, and next/previous navigation.
- A new platform-aware "Find in diff" hotkey is available.
-
Refactor
- Search behavior unified into a shared find-hotkey system and applied to file viewer, markdown, and chat panes for consistent UX.