Repository navigation
revert(site/src/pages/AISettingsPage/SpendPage): restore provider, model, and client dropdowns - #30128
Conversation
…del, and client dropdowns
|
/coder-agents-review |
|
Chat: Review posted | View chat Review history
deep-review v0.13.0 | Round 1 | Last posted: Round 1, 6 findings (3 P3, 3 P4), COMMENT. Review Finding inventoryFindings
Contested and acknowledgedRound logRound 1Netero first pass: 2 P3, no P0, so the panel ran. Law skipped (86 effective additions). Full panel, focused (TSX/TS only): ging-ts, ging-react, nami (specialists), pariston, mafuuu (core), bisky (tests changed), gon, leorio (once-per-PR floor), zoro (wildcard, random draw). ging-ts, ging-react: no findings. pariston, leorio, zoro: notes only. Orchestrator checks: Cross-check:
About deep-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
There was a problem hiding this comment.
This PR replaces the Spend page's filter combobox with the Provider, Model, and Client dropdowns from before #29274, keeping the "Spend" title. Findings: 3 P3, 3 P4.
Out of scope (needs a ticket or explicit acceptance by a human):
site/src/components/Filter/menu.ts:32andgetSelectedOptioninsite/src/pages/AIBridgePage/filters/{Provider,Client,Model}Filter.tsx: a URL value the lookup cannot match shows the "All ..." placeholder, and neither query exposes its error, on every page that uses these filters, including the AI Bridge sessions list.site/src/pages/AIBridgePage/filters/ProviderFilter.tsx:27:getSelectedOptionandgetOptionsfetch the same provider list under two query keys, so every page that usesuseProviderFilterMenuwith a value set, including this one, requests/providerstwice on load.site/src/pages/AISettingsPage/SpendPage/components/SpendUsersTable.stories.tsx:178: viewport"mobile2"is not configured and falls back toipad, so the mobile story renders at 768px.site/src/pages/AgentsPage/components/AgentChatInput.stories.tsx:1381(also 1421, 1598, 1652):viewport: { defaultViewport: "mobile2" }uses a parameter Storybook 10 no longer reads and an unconfigured key, so these stories render at the default viewport.codersdk/aibridge.go:496:OrganizationAISpendFilterhas no user field, so finding one user's spend means paging through the table; the description names this gap but links no ticket.
site/src/pages/AISettingsPage/SpendPage/SpendPage.stories.tsx:146
P4 [CRF-6] FilteredByProvider loads with provider_name=openai in the URL, but its play function never checks that the Provider dropdown shows OpenAI. (Bisky)
value: dimensions.provider_name at SpendPage.tsx:113 is what makes the dropdown show the URL's provider, and neither this story nor applies the provider filter and resets pagination checks the button text, so both still pass with value removed. In the play function, get the "Select provider" button and assert toHaveTextContent("OpenAI").
🤖
🤖 This review was automatically generated with Coder Agents.
| }); | ||
| } | ||
| const filterMenus = { | ||
| provider: useProviderFilterMenu({ |
There was a problem hiding this comment.
P3 [CRF-3] A provider_name, client, or model URL value that the option lookup cannot match still filters the report, but its dropdown shows "All providers", "All clients", or "All models". (Nami, Mafuuu)
dimensions goes into the spend request unchanged, while getSelectedOption in useProviderFilterMenu and the Client and Model hooks returns null when nothing matches, so SelectFilter shows its placeholder; a scratch test rendering &provider_name=removed sent provider_name: "removed" to getOrganizationAISpendUsers while the button read "All providers". A user who opens a stale link, for example to a provider since removed from the config, reads a filtered report as unfiltered and cannot clear the filter from the dropdown, because there is no selected item to deselect; the combobox this PR removes showed the raw value as a removable chip. The root cause is getSelectedOption in the shared filter hooks, listed in the review body, so accepting this on the Spend page needs a human decision.
🤖
There was a problem hiding this comment.
Leaving this open for a human decision. This PR restores the pre-#29274 behavior as-is, and the root cause is getSelectedOption in the shared AI Bridge filter hooks, which the sessions list also uses. It is better handled in a follow-up to those hooks than in this revert.
Generated by Coder Agents on behalf of @tracyjohnsonux.
…wns and the paywall gate
Brings back the Provider, Model, and Client dropdowns on the AI settings Spend page, replacing the
FilterComboboxsearch from #29274.The search box made it look like you could type a user's name, but the spend report has no user or free-text filter. Typed text only showed a "Free-text search isn't supported" warning. The dropdowns show only the filters that actually exist.
SpendPage,SpendPageView,SpendFilters, and their tests and stories to their state before feat(site): adopt the workspaces-style filter combobox #29274, and removesspendFilterCategories.tsxandspendFilterQuery.ts.provider_name,model,client) and the permission check (viewAnyAIBridgeInterception) are the same as before.A User filter still needs backend support (a
user_idfilter onGET /organizations/{org}/ai/spend/users) and is not in this PR.Verified with
pnpm test(17 tests) and the Storybook tests (33) for the SpendPage directory, pluspnpm lint:typesandbiome check.Generated by Coder Agents on behalf of @tracyjohnsonux.