Skip to content

feat(site/src): use the search filter on the AI Gateway sessions list - #31040

Draft
tracyjohnsonux wants to merge 2 commits into
mainfrom
ai-sessions-search-filter
Draft

tracyjohnsonux wants to merge 2 commits into
mainfrom
ai-sessions-search-filter

Conversation

@tracyjohnsonux

Copy link
Copy Markdown
Contributor

Replaces the AI Gateway sessions list filter (search box plus User, Provider, Client, and Model dropdowns) with the FilterCombobox search filter used on the Workspaces page.

  • Each former dropdown is now a filter category: initiator (User), provider_name, client, model. Option loaders live in ListSessionsPage/categoryOptions.tsx and go through new React Query definitions in api/queries/aiBridge.ts. The User category reuses the Workspaces getUserFilterOptions (sessions are admin-only, so all users are listed).
  • The date range keeps its own DateTimeRangePicker, now to the right of the search input. started_after/started_before are stripped from the combobox value and merged back on change (withoutTimeRange, queryWithSearch, queryWithTimeRange in timeRange.ts). A bound typed in the search overrides only that bound.
  • Non-validation errors render as an ErrorAlert above the filter, matching WorkspacesPageView. Validation errors show under the search input.
  • The old ProviderFilter/ClientFilter/ModelFilter components stay because the Spend page still uses them.

Known limitation (accepted for now): the sessions search backend has no default key, so typed free text returns no search key specified, shown under the input.

Decision log
  1. Date range stays a separate control; its tokens never appear in the search input.
  2. Free text: keep the backend validation error for now (no backend change, no FilterCombobox change).
  3. Option loaders: plain async functions per category, as on the Workspaces page.
  4. User category lists all users without the viewDeploymentConfig gate, since only admins can view sessions.
  5. Page view shows ErrorAlert for non-validation errors.
  6. Bedrock model IDs with colons (...-v2:0) are quoted; covered by ListSessionsFilter.test.tsx.
  7. Every former dropdown becomes a category; provider (type) and session_id are not added as categories.

Frontend review: frontend-review (FE1 to FE10) and frontend-deep-review pass after fixes. One DF6 finding (category array identity) was dropped because src/pages/AIBridgePage/ is compiled by React Compiler, which memoizes it.


Generated by Coder Agents on behalf of @tracyjohnsonux.

Replace the sessions list search box and User, Provider, Client, and
Model dropdowns with the FilterCombobox search filter used on the
Workspaces page. Each former dropdown becomes a filter category. The
date range keeps its own picker; its bounds are kept out of the search
input and merged back into the query on change.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant