feat: add server-side search to filter sidebar checkbox lists via debounced q query param - #3568
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds server-side search for filter dropdowns: filter-data endpoints accept optional ChangesFilter dropdown server-side search
🎯 3 (Moderate) | ⏱️ ~25 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
q query param
Confidence Score: 4/5Safe to merge after addressing the MetadataFilters search-input disappearance on empty results. The ui/components/filters/logsFilterSidebar.tsx — specifically the MetadataFilters isEmpty guard around line 924. Important Files Changed
Reviews (2): Last reviewed commit: "feat: ability to search for filters in l..." | Re-trigger Greptile |
…ies to avoid confusion when data is missing
18f5adf to
e811375
Compare
502c146 to
27d3dc2
Compare
Merge activity
|
The base branch was changed.
…ounced `q` query param (#3568) ## Summary Filter dropdowns in the logs and MCP logs sidebars previously fetched all available options upfront. This PR wires the search input in each `SearchableCheckboxList` to the backend filter data query, so that typing in a filter panel sends a debounced `q` parameter to `/logs/filterdata` or `/mcp-logs/filterdata`, narrowing results server-side rather than relying solely on client-side filtering. ## Changes - Added an optional `onSearch` callback to `SearchableCheckboxList` in both `logsFilterSidebar.tsx` and `mcpFilterSidebar.tsx`. When provided, a 300 ms debounced effect fires `onSearch` with the current trimmed query. - Each filter component (`StopReasonFilter`, `ModelsFilter`, `AliasesFilter`, `SelectedKeysFilter`, `VirtualKeysFilter`, `RoutingEnginesFilter`, `RoutingRulesFilter`, `ToolNamesFilter`, `ServersFilter`) now holds a `searchQuery` state and passes it as `q` to `useGetAvailableFilterDataQuery` / `useGetMCPLogsFilterDataQuery`. - `MetadataFilters` gets its own search input with a local debounce (since it doesn't use `SearchableCheckboxList`) and passes the debounced value as `q` to the filter data query. - The `getAvailableFilterData` and `getMCPAvailableFilterData` API query builders now accept an optional `q` field and append it as a URL query parameter when present. ## Type of change - [ ] Bug fix - [x] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [x] UI (React) - [ ] Docs ## How to test 1. Open the logs or MCP logs page and expand any filter panel (e.g. Models, Aliases, Virtual Keys). 2. Type in the search box inside the filter panel. 3. After ~300 ms, verify that the displayed options update to reflect server-filtered results matching the query. 4. Clear the search box and confirm the full list is restored. 5. Verify that the Metadata filter search input similarly narrows the displayed metadata keys. ```sh cd ui pnpm i || npm i pnpm test || npm test pnpm build || npm run build ``` ## Screenshots/Recordings _Add before/after screenshots or a short clip showing the filter search narrowing results._ ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations The `q` parameter is passed as a plain URL query string to existing authenticated endpoints. No new auth surface or PII handling is introduced beyond what the filter data endpoints already expose. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable

Summary
Filter dropdowns in the logs and MCP logs sidebars previously fetched all available options upfront. This PR wires the search input in each
SearchableCheckboxListto the backend filter data query, so that typing in a filter panel sends a debouncedqparameter to/logs/filterdataor/mcp-logs/filterdata, narrowing results server-side rather than relying solely on client-side filtering.Changes
onSearchcallback toSearchableCheckboxListin bothlogsFilterSidebar.tsxandmcpFilterSidebar.tsx. When provided, a 300 ms debounced effect firesonSearchwith the current trimmed query.StopReasonFilter,ModelsFilter,AliasesFilter,SelectedKeysFilter,VirtualKeysFilter,RoutingEnginesFilter,RoutingRulesFilter,ToolNamesFilter,ServersFilter) now holds asearchQuerystate and passes it asqtouseGetAvailableFilterDataQuery/useGetMCPLogsFilterDataQuery.MetadataFiltersgets its own search input with a local debounce (since it doesn't useSearchableCheckboxList) and passes the debounced value asqto the filter data query.getAvailableFilterDataandgetMCPAvailableFilterDataAPI query builders now accept an optionalqfield and append it as a URL query parameter when present.Type of change
Affected areas
How to test
Screenshots/Recordings
Add before/after screenshots or a short clip showing the filter search narrowing results.
Breaking changes
Related issues
Security considerations
The
qparameter is passed as a plain URL query string to existing authenticated endpoints. No new auth surface or PII handling is introduced beyond what the filter data endpoints already expose.Checklist
docs/contributing/README.mdand followed the guidelines