Skip to content

feat: show the AI spend detailed report breakdown and export it as CSV - #32482

Merged
ssncferreira merged 3 commits into
ssncf/ai-spend-report-cancelfrom
ssncf/ai-spend-report-columns
Nov 24, 2026
Merged

ssncferreira merged 3 commits into
ssncf/ai-spend-report-cancelfrom
ssncf/ai-spend-report-columns

Conversation

@ssncferreira

@ssncferreira ssncferreira commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Adds the Providers, Models, and Clients columns to the Detailed report, a row menu with Cost details and User AI session logs, and Export CSV, which downloads the last run of the report.

Changes

  • Move the Top spenders row menu into UserSpendMenu, used by both tabs.
  • Make CostDetailsDialog take only the user's name, username, avatar, and spend, so both Top spenders and report rows can open it.
  • Read the cost details from the report row, so no extra request is needed.
  • Rename the DetailedReportTab prop canFilter to canViewSessions, since it now also gates the session logs.
  • Move the User and Group lookup into resolveAISpendReportFilter, shared by the report and the export.
  • Add getOrganizationAISpendExport and the exportOrganizationAISpend mutation, which requests the export with the last run's days and filter. The endpoint has no client filter yet, so the export ignores it (TODO(AIGOV-733)).
  • Save the CSV with saveAs, named after the organization and the picked days, and show a toast when the export fails.
  • Enable Export CSV only after a run that returned users, and show a spinner on it while the export loads.
  • Run detailed report in the cost details dialog opens the Detailed report tab with the filter set to that user, without running the report. The dialog hides that button when it opens from the report.
  • Add tests for the export request and opening the report for a user.

Closes AIGOV-731

Note

Generated by Coder Agents on behalf of @ssncferreira.

@linear-code

linear-code Bot commented Nov 19, 2026

Copy link
Copy Markdown

AIGOV-731

@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-report-columns branch from ded979c to 3aa11de Compare November 20, 2026 09:05
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-report-columns branch from 3aa11de to aee21db Compare November 20, 2026 09:23
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-report-columns branch from aee21db to d4cd4f7 Compare November 20, 2026 09:33
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-report-columns branch from d4cd4f7 to 3d5e8ad Compare November 20, 2026 09:51
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-report-columns branch from 3d5e8ad to 6672923 Compare November 20, 2026 10:50
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-report-columns branch from 6672923 to 67a6a25 Compare November 20, 2026 11:04
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-report-columns branch from 67a6a25 to 9ee1808 Compare November 20, 2026 11:16
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-report-columns branch from 9ee1808 to fcf59ef Compare November 20, 2026 11:26
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-report-columns branch from fcf59ef to 0e05371 Compare November 20, 2026 11:34
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-report-columns branch from 0e05371 to ffd849b Compare November 20, 2026 11:39
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-report-columns branch from ffd849b to a8aab12 Compare November 20, 2026 11:52
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-report-columns branch from a8aab12 to 4dddfc7 Compare November 20, 2026 12:00
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-report-columns branch from 4dddfc7 to c700780 Compare November 20, 2026 12:09
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-report-columns branch from c700780 to 24cf452 Compare November 20, 2026 12:17

This branch had an error being deployed

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

3 participants