Repository navigation
feat(site/src): add the AI spend total spend card - #32338
Draft
ssncferreira wants to merge 1 commit into
Draft
ssncferreira wants to merge 1 commit into
ssncferreira wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the Total spend card to the AI spend Overview tab. The total comes from the fast overview endpoint, and the "N models not set up" warning from
GET /api/experimental/organizations/{organization}/ai/model-prices/unpriced, which is slower, so the total renders first and the warning follows with its own loading state.Changes
API.experimental.getOrganizationUnpricedAIModels, theorganizationUnpricedAIModelsquery, andcanReadOrganizationAIModelPrices. The endpoint requires read on the organization's model prices, so the page only requests it for viewers who pass that check.StatCard, the labeled figure the overview cards share, andTotalSpendCard, which shows a skeleton until the total loads and a spinner while the unpriced models load.MockUnpricedAIModels, tests for the unpriced models requests and the permission gate, and stories for the card states.Related to AIGOV-732
Note
Generated by Coder Agents on behalf of @ssncferreira.