Skip to content

feat(site): adopt the workspaces-style filter combobox - #29274

Merged
jakehwll merged 12 commits into
mainfrom
jakehwll/ai-spend-filter-combobox
Sep 28, 2026
Merged

jakehwll merged 12 commits into
mainfrom
jakehwll/ai-spend-filter-combobox

Conversation

@jakehwll

@jakehwll jakehwll commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

🤖 This PR was modified by Coder Agents on behalf of Jake Howell.

Replace the User spend page's provider, client, and model dropdowns with the Workspaces-style FilterCombobox. Keep discrete URL parameters canonical, reset pagination when dimensions change, and preserve the current organization selector, permission gates, retention bounds, and date/time picker.

Originally stacked on #28964. That work has landed with a redesigned organization-scoped spend API, so this branch now merges main and contains only the combobox changes, not the obsolete stack. The current API has no user-name search: unsupported free text stays local with an explicit validation message and does not change report requests or pagination.

Implementation plan and conflict-resolution decisions
  1. Use the current organization-scoped Spend page from main as the baseline; discard obsolete stacked backend, generated API, documentation, and drill-in changes.
  2. Adapt provider/client/model URL parameters to the shared combobox grammar, including quoted multi-word values.
  3. Load options through the combobox's React Query integration using the existing AI Gateway endpoints and icons. Only session viewers receive dimension controls.
  4. Preserve organization selection, date/time presets, retention limits, and pagination. Keep unsupported free text local rather than restoring removed API behavior.
  5. Update existing interaction tests and stories for chip selection/removal, permission gates, and narrow/mobile layouts.

PR #27330 removed the admin Spend page together with the native
per-message cost tracking it displayed. This restores the page at
/ai/settings/spend on top of the AI Gateway spend endpoints, gated the
same way as AI Sessions: the aibridge entitlement plus permission to
read any AI Gateway interception.

The page defaults to the last 30 days. A filter row with provider,
client, and model dropdowns and the date range picker applies to the
user table and deployment summary alike, while user search leaves the
deployment totals unchanged. All eight user-table columns are sortable.
The user drill-in shows the same filter row, preserves filtering and
sorting on Back, and links to that user's AI sessions with the same
filters and applied period. Unentitled deployments see the AI Governance
paywall, and entitled deployments with the gateway disabled see the
setup alert. The spend management and cost controls docs point to the
page.

Also adds the shared API mocks (inbox notifications, template version
presets) and the date-time range picker dropdown-close wait that the
pre-push checks uncovered in existing tests.

> Xum acted on Mike's behalf.
@ibetitsmike
ibetitsmike force-pushed the mike/ai-spend-overview branch from 4e0f1a1 to eb7d257 Compare September 14, 2026 08:03
…AI navbar entry

Show the cached drill-in profile with an inline error and Retry when a
refetch fails, matching the users and summary views. Add a Vitest that
a spend-only viewer reaches AI settings from the Admin settings menu.
@jakehwll jakehwll changed the title feat(site/src/pages/AISettingsPage/SpendPage): adopt the workspaces-style filter combobox feat(site): adopt the workspaces-style filter combobox Sep 14, 2026
@jakehwll
jakehwll force-pushed the jakehwll/ai-spend-filter-combobox branch 3 times, most recently from 7b905e6 to 716b497 Compare September 15, 2026 02:56
@jakehwll
jakehwll added this pull request to stack #29225 September 15, 2026 03:31
@jakehwll
jakehwll marked this pull request as ready for review September 15, 2026 03:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-15T03:36:38.532086Z 716b497 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 716b4977f1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

/>
</div>
<div className="flex flex-wrap items-start gap-2">
<FilterCombobox

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the SpendPage tests for the combobox controls

The existing SpendPage.test.tsx still queries the removed textbox named Search spend by name or username and buttons named Select provider in four tests, while this replacement exposes a combobox named Search and filter spend… and a Toggle filters button. Those tests will fail before reaching their assertions, leaving the frontend test suite red and the new page-level search/filter behavior uncovered; update their interactions and debounce expectations to use the new combobox.

AGENTS.md reference: site/AGENTS.md:L7-L7

Useful? React with 👍 / 👎.

@jakehwll
jakehwll force-pushed the jakehwll/ai-spend-filter-combobox branch from 716b497 to 9c351dd Compare September 15, 2026 03:40
@ibetitsmike
ibetitsmike removed this pull request from stack #29225 September 15, 2026 18:49
@ibetitsmike
ibetitsmike force-pushed the mike/ai-spend-overview branch 4 times, most recently from d929af4 to 8ef8a7e Compare September 15, 2026 21:48
@ibetitsmike
ibetitsmike force-pushed the mike/ai-spend-overview branch 20 times, most recently from d0c4760 to de5bf43 Compare September 22, 2026 13:33
Base automatically changed from mike/ai-spend-overview to main September 22, 2026 13:42

@DanielleMaywood DanielleMaywood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7k lines is a bit much

Preserve the current organization-scoped spend page and port only the filter combobox. Drop obsolete stacked changes already superseded on main.
@jakehwll
jakehwll merged commit 739c27f into main Sep 28, 2026
32 checks passed
@jakehwll
jakehwll deleted the jakehwll/ai-spend-filter-combobox branch September 28, 2026 09:46
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants