Skip to content

feat: replace the AI spend page with the redesigned one - #32686

Merged
ssncferreira merged 1 commit into
mainfrom
ssncf/ai-spend-page-replace
Nov 24, 2026
Merged

ssncferreira merged 1 commit into
mainfrom
ssncf/ai-spend-page-replace

Conversation

@ssncferreira

@ssncferreira ssncferreira commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Description

The redesigned AI spend page now replaces the old one at /ai/settings/spend.

Changes

  • Point the spend route at the redesigned page and remove the unlisted spend/experimental route.
  • Remove the page's Experimental badge, and the now unused ExperimentalBadge.
  • Remove the old spend page with its components, stories and tests, and its paginatedOrganizationAISpend query.
  • Move spendAccess and SpendAmount, which the rest of the app still uses, into AISpendPage/.
  • Rename SpendAmount to TotalSpendAmount and remove its per-user variant, which only the old page used.

Closes AIGOV-729

Note

Generated by Coder Agents on behalf of @ssncferreira.

@linear-code

linear-code Bot commented Nov 24, 2026

Copy link
Copy Markdown

AIGOV-729

@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-page-replace branch from 67835c5 to 5b5f9bc Compare November 24, 2026 17:30
@ssncferreira
ssncferreira marked this pull request as ready for review November 24, 2026 17:31

@mollymaefraser mollymaefraser 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.

LGTM 🚀 few non blocking nits

Comment thread site/src/router.tsx
@@ -783,11 +780,6 @@ export const router = createBrowserRouter(
element={<AISettingsGatewayKeysPage />}
/>
<Route path="spend" element={<AISettingsSpendPage />} />

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.

Q: Old /ai/settings/spend links used ISO timestamps for startDate/endDate and separate provider_name/client/model params. The new page silently ignores those and falls back to the last 7 days with no filter. Is that acceptable since the old page was marked experimental, or is it worth mapping the old params (or at least taking the date part of the ISO value)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think that's fine, since the old page was experimental. Old links still open the page, they just lose the dates and filters.

});

const now = new Date("2026-03-12T15:30:00Z");
const path = "/ai/settings/spend/experimental";

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.

/ai/settings/spend/experimental could forward to /ai/settings/spend? or nobody should have been using it anyway?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

/ai/settings/spend/experimental never shipped in a release, so only internal links point to it.

@ssncferreira
ssncferreira merged commit 4bfd2e1 into main Nov 24, 2026
41 checks passed
@ssncferreira
ssncferreira deleted the ssncf/ai-spend-page-replace branch November 24, 2026 18:11
ssncferreira added a commit that referenced this pull request Nov 24, 2026
…32687)

## Description

Only the old spend page read `retention_start` from the per-user AI
spend response, to limit its date picker. That page is gone, and the AI
Gateway retention endpoint now serves this purpose, so the field is
removed. The server still narrows a default period to the retention and
rejects an explicit one that starts before it.

Related to AIGOV-729

## Changes

- Remove `RetentionStart` from `codersdk.OrganizationAISpendReport`.
- Keep the retention start local to `aiSpendRetainedPeriod`, its only
reader.
- Regenerate the API docs and TypeScript types, and update the tests and
mocks.

Depends on #32686.

> [!NOTE]
> Generated by Coder Agents on behalf of @ssncferreira.
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 24, 2026

This branch had an error being deployed

1 failed deployment
docs-preview — 5b5f9bce Deployed Nov 24, 2026 by ssncferreira via cleanup #443
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