Overview
Add workspace-wide text search as a sidebar panel, following existing panel architecture. All patterns and integration points already exist in the codebase.
Steps
-
Add hotkey definition — Add findInFiles: { key: 'f', ctrl: true, shift: true } to DEFAULT_HOTKEYS in frontend/src/modules/types/hotkeys.ts
-
Extend SidebarPanel type — Add 'find' to the SidebarPanel union in frontend/src/stores/types.ts
-
Register hotkey handler — In frontend/src/modules/editor/PrompdEditor.tsx registerMonacoHotkeys(), intercept Ctrl+Shift+F and dispatch toggle-sidebar event with detail 'find'
-
Add Activity Bar button — Add a Search icon (lucide-react) to frontend/src/modules/editor/ActivityBar.tsx following existing button pattern
-
Create FindInFilesPanel component — New file frontend/src/modules/editor/FindInFilesPanel.tsx:
- Search input with debounced query
- Results grouped by file with line number previews
- Click handler opens file + jumps to line via
onOpenFile() + setJumpTo()
- Keyboard navigation (arrow keys, Enter) following CommandPalette pattern
-
Wire panel into App.tsx — Add conditional render block at ~line 4243 using existing visibility/position/pointerEvents pattern
-
Add IPC search handler — Add fs:searchInFiles IPC handler in frontend/electron/main.js that searches in the main process (avoids hundreds of individual IPC round-trips). Takes query + directory + file patterns, returns grouped results with line numbers.
-
File filtering — Search .prmd, .pdflow, .md, .json, .yaml, .ts, .tsx, .js by default. Exclude node_modules/, .git/, dist/. Respect .prompdignore if present. Configurable include/exclude globs in the search UI.
Key Files
| File |
Role |
frontend/src/modules/types/hotkeys.ts |
Hotkey definitions |
frontend/src/stores/types.ts |
SidebarPanel type |
frontend/src/modules/editor/PrompdEditor.tsx |
Hotkey registration |
frontend/src/modules/editor/ActivityBar.tsx |
Sidebar buttons |
frontend/src/modules/App.tsx (~line 4243) |
Panel rendering |
frontend/electron/main.js |
IPC handlers |
frontend/electron/preload.js |
IPC bridge |
Reference Patterns
- Panel architecture: FileExplorer, GitPanel (sidebar panels)
- Search UI: RegistrySearchOverlay.tsx, CommandPalette.tsx
- File opening:
onOpenFile() in App.tsx (~line 1055)
Estimate
~1 new file, ~6 files modified. Medium complexity.
Overview
Add workspace-wide text search as a sidebar panel, following existing panel architecture. All patterns and integration points already exist in the codebase.
Steps
Add hotkey definition — Add
findInFiles: { key: 'f', ctrl: true, shift: true }toDEFAULT_HOTKEYSinfrontend/src/modules/types/hotkeys.tsExtend SidebarPanel type — Add
'find'to theSidebarPanelunion infrontend/src/stores/types.tsRegister hotkey handler — In
frontend/src/modules/editor/PrompdEditor.tsxregisterMonacoHotkeys(), intercept Ctrl+Shift+F and dispatchtoggle-sidebarevent with detail'find'Add Activity Bar button — Add a Search icon (lucide-react) to
frontend/src/modules/editor/ActivityBar.tsxfollowing existing button patternCreate FindInFilesPanel component — New file
frontend/src/modules/editor/FindInFilesPanel.tsx:onOpenFile()+setJumpTo()Wire panel into App.tsx — Add conditional render block at ~line 4243 using existing visibility/position/pointerEvents pattern
Add IPC search handler — Add
fs:searchInFilesIPC handler infrontend/electron/main.jsthat searches in the main process (avoids hundreds of individual IPC round-trips). Takes query + directory + file patterns, returns grouped results with line numbers.File filtering — Search
.prmd,.pdflow,.md,.json,.yaml,.ts,.tsx,.jsby default. Excludenode_modules/,.git/,dist/. Respect.prompdignoreif present. Configurable include/exclude globs in the search UI.Key Files
frontend/src/modules/types/hotkeys.tsfrontend/src/stores/types.tsfrontend/src/modules/editor/PrompdEditor.tsxfrontend/src/modules/editor/ActivityBar.tsxfrontend/src/modules/App.tsx(~line 4243)frontend/electron/main.jsfrontend/electron/preload.jsReference Patterns
onOpenFile()in App.tsx (~line 1055)Estimate
~1 new file, ~6 files modified. Medium complexity.