Skip to content

feat(site/src/pages/AISettingsPage/SpendPage): compose the spend page view - #29629

Merged
ibetitsmike merged 4 commits into
mainfrom
mike/ai-spend/view
Sep 22, 2026
Merged

ibetitsmike merged 4 commits into
mainfrom
mike/ai-spend/view

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

Adds SpendPageView, the presentational page: paywall and not-enabled states, the organizations loading, error, and empty states, a warning when the requested organization is unavailable, and the filters row (SpendFilters: organization picker hidden with a single organization, optional provider, model, and client menus, and the date range picker or a non-interactive Current budget period label when no explicit range is applied).

Why

Keeping the view stateless lets its stories cover every page-level state without network mocks; the container PR above wires the data.

What to scrutinize

  • SpendFilters passes MaxAISpendPeriodDays and minDate to the picker. This layer shows a skeleton while the report is loading; feat(site/src): map the spend reporting period to selectable days within retention #29631 separates the initial retention-bound load from subsequent report loads so the picker stays mounted. The container decides when dateRange is undefined.
  • SpendPageView.stories.tsx holds only page-level states; table states moved to the table PR below.

Validation

pnpm test:storybook on SpendPageView.stories.tsx, repository pre-commit.

Delivery record

Published head c462e135906 passed per-layer integration checks and commit hooks. The composed head d899228f798 passed format, check, full frontend lint, 125 unit tests, and 86 story tests. Pre-push hooks were skipped as requested. See #28964 for audit findings, their disposition, and historical UAT limits. No exact-head live UAT or new independent re-review is claimed.

Stack context

PR 5 of 9. The stack adds a User spend page under Admin settings > AI > User spend: total and per-user AI Gateway spend for one organization over a reporting period, read from GET /api/v2/organizations/{organization}/ai/spend/users (#29129, merged). It is #28964 split into one-concern PRs. Historical UAT covers earlier heads only; live UAT has not been rerun after these review fixes. Bottom to top: DateRangePicker limits, shared dimension badge, API client method, spend table, page view, page container, reporting period, dimension filters, route and navigation (#28964).

Xum prepared this PR on behalf of @ibetitsmike.

@ibetitsmike
ibetitsmike marked this pull request as ready for review September 21, 2026 08:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 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-21T12:02:20.223167Z 6ce4541 Manual request
ℹ️ 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: fa1846b785

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: a609b6e4fa

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: cc8aca9a60

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: a4d2a0aafd

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 53cd7ea0e1

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: bcef253cbe

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 6ce4541b70

ℹ️ 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".

@ibetitsmike
ibetitsmike removed this pull request from stack #29634 September 22, 2026 11:13
@ibetitsmike
ibetitsmike force-pushed the mike/ai-spend/view branch 3 times, most recently from 15ec00c to 1359bfa Compare September 22, 2026 12:45
Base automatically changed from mike/ai-spend/table to main September 22, 2026 12:54
…rganization picker by its prompt

Drop the aria-label that hid the visible "Select an organization" prompt
from the trigger's accessible name, render the budget-period placeholder
as status text instead of a disabled button, and cover organization
selection in both flows with a view test asserting onOrganizationChange.
…he report has no data

The date picker was mounted disabled while a fresh or refiltered report
was still loading, before the retention bound that limits it had
arrived. Show a skeleton in its place until the report resolves, and
drop the story that only captured the disabled picker; the Loading
story now covers the pending state.
@ibetitsmike
ibetitsmike merged commit e101ceb into main Sep 22, 2026
25 of 26 checks passed
@ibetitsmike
ibetitsmike deleted the mike/ai-spend/view branch September 22, 2026 13:03
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 22, 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.

2 participants