feat(site/src): show spend for unlimited and zero AI budgets#27458
Open
EhabY wants to merge 1 commit into
Open
feat(site/src): show spend for unlimited and zero AI budgets#27458EhabY wants to merge 1 commit into
EhabY wants to merge 1 commit into
Conversation
The group members table showed a bare Unlimited label when a member's budget resolves to a group with no limit, hiding their spend. It now renders the spend against the limit as "$X / Unlimited USD", matching the user dropdown, keeping the info tooltip. A $0 budget previously rendered as a special "None" label. It now renders like any other limit: the spend amount with a "Group limit $0" sub-label, taking the exceeded color only when spend is above zero.
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.
The group members table hid a member's spend behind a bare
Unlimitedlabel when their budget resolves to a group with no limit (typically the Everyone fallback). It now shows the spend against the limit as$X / Unlimited USDby reusing the existingAIBudgetUsagecomponent, matching the user dropdown, and keeps the "usage isn't restricted" tooltip.A
$0budget previously rendered as a specialNonelabel with its own tooltip. That branch is deleted;$0now renders like any other limit through the regular branch: the spend amount with aGroup limit $0/Custom limit $0sub-label.getSeverityalready treats a zero budget as exceeded only when spend is above zero, so$0stays the normal color and, e.g.,$100over a$0budget takes the destructive color. No new color logic.Storybook coverage:
Unlimited/UnlimitedThisGroupassert the new$X / Unlimited USDformat,Noneis replaced byZeroBudget(normal color) andZeroBudgetExceeded(destructive visual variant), andAIBudgetUsagegains aZeroBudgetNoSpendstory asserting$0 / $0 USD.Implementation plan and decision log
Scope
site/src/pages/GroupsPage/GroupMemberBudgetCells.tsxand its stories. This is the only surface that showsUnlimited(orNone) without the spend. The groups list (GroupsPageView) already renders$X / Unlimited USDthroughAIBudgetUsage, and the Limits tab tables (GroupLimitsTable,UserOverridesTable) are pure limit-configuration tables with no spend data, so they stay as-is.Changes
limit === null): replace the bareUnlimitedlabel withAIBudgetUsage, rendering$SPEND / Unlimited USDlike the Avatar dropdown (UserDropdownAISpend).limit === 0): delete the specialNonebranch and let$0flow through the regular branch like any other set limit, keeping theGroup limit $X/Custom limit $Xsource sub-label consistent with nonzero limits.getSeverityalready colors a zero budget as exceeded only when spend > 0.Nonebranch and its tooltip message.LabelWithInfostays (still used by Unlimited and the other-org states).Decisions
$0tooltip as no longer needed once the value is shown as-is.$0uses the regular-branch rendering (spend + limit sub-label) rather than the inline$0 / $0form, for consistency with every other configured limit; the inline/form remains only where no limit line exists (Unlimited).UserDropdownAISpendintentionally keeps its ownspend / Unlimitedformatting: its colors differ fromAIBudgetUsage, so consolidating would change visuals.Validation
pnpm test:storybookfor both touched story files (17 tests pass).pnpm lint(Biome, tsc, knip, circular deps, compiler) clean;pnpm formatapplied.🤖 This PR was generated by Coder Agents on behalf of @EhabY.