You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tidy, well-scoped fix that surfaces where a file search actually looked by rendering the searched_locations the API already returns. The wiring is correct end-to-end: backend field exists and is clamped to 10 (src/gaia/ui/routers/files.py:501), is typed in api.ts, and the new state is cleared on every reset path (load, empty query, clear button, "Back to browsing"). No backend change needed, no new dependencies, and the integration tests for searched_locations already exist (tests/integration/test_files_router.py:726). Nothing blocking — this is good to merge.
Issues
🟢 "(+N more)" count reflects the clamped list, not the true total (FileBrowser.tsx:45)
The backend already truncates to searched_locations[:10], so when a search spans more than 10 roots, formatSearchScope shows at most first (+9 more) and the tooltip lists at most 10 — silently undercounting. Purely cosmetic and arguably fine (the header is "scope," not an audit), so no change required. If you want the count to stay honest, the backend could pass the pre-clamp len(searched_locations) as a separate total_locations field. Worth a follow-up only if users will search broad scopes.
🟢 searchResults / results typed as any[] (FileBrowser.tsx:182)
Pre-existing, not introduced here — flagging only so it isn't lost: the search result rows are any[] while the API response is fully typed in searchFiles. Reusing that return type would catch field renames at compile time. Out of scope for this PR.
Strengths
State hygiene is complete — setSearchedLocations([]) is added to every reset path (initial load, empty-query early return, clear button, back button), so the scope label can't go stale. Easy to get wrong; this got it right.
Reuses existing API data instead of adding an endpoint — ?? [] guards against an older backend, and the title={searchedLocations.join('\n')} tooltip exposes the full list without cluttering the header.
CSS is self-contained and uses existing design tokens (--text-muted, --font-mono), with min-width: 0 + ellipsis so long paths truncate cleanly rather than blowing out the layout.
Verdict
Approve. Clean, correctly-wired, no blocking issues; the two 🟢 notes are optional follow-ups, not merge gates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
searched_locationsalready returned by the file search APICloses #581
Testing
npm run build