Problem
The current "Find in All Files" (Ctrl+Shift+F) search executes synchronously on the main thread. For large PRs with many files, this could block the UI and make the application feel unresponsive.
Location: src/app/[owner]/[repo]/[number]/page.tsx - handleExecuteSearch callback
Proposed Solution
Migrate the search logic to a Web Worker to keep the main thread free for UI updates.
Implementation Approach
- Create a new search worker in
src/features/search/workers/search-worker.ts
- Move the search loop logic (file filtering, patch parsing, match finding) to the worker
- Use
postMessage to send search parameters and receive results
- Show a progress indicator during search (already have
isSearching state)
- Support cancellation for long-running searches
Benefits
- UI remains responsive during search
- Can show real-time progress (X of Y files searched)
- Can cancel in-flight searches when user types new query
- Consistent with existing
src/features/diff/workers/diff-engine.ts pattern
Acceptance Criteria
Context
Identified during PR #292 code review by Copilot.
Problem
The current "Find in All Files" (Ctrl+Shift+F) search executes synchronously on the main thread. For large PRs with many files, this could block the UI and make the application feel unresponsive.
Location:
src/app/[owner]/[repo]/[number]/page.tsx-handleExecuteSearchcallbackProposed Solution
Migrate the search logic to a Web Worker to keep the main thread free for UI updates.
Implementation Approach
src/features/search/workers/search-worker.tspostMessageto send search parameters and receive resultsisSearchingstate)Benefits
src/features/diff/workers/diff-engine.tspatternAcceptance Criteria
Context
Identified during PR #292 code review by Copilot.