Skip to content

feat(site/src): show spend for unlimited and zero AI budgets#27458

Open
EhabY wants to merge 1 commit into
mainfrom
feat/group-member-budget-spend-display
Open

feat(site/src): show spend for unlimited and zero AI budgets#27458
EhabY wants to merge 1 commit into
mainfrom
feat/group-member-budget-spend-display

Conversation

@EhabY

@EhabY EhabY commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The group members table hid a member's spend behind a bare Unlimited label 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 USD by reusing the existing AIBudgetUsage component, matching the user dropdown, and keeps the "usage isn't restricted" tooltip.

A $0 budget previously rendered as a special None label with its own tooltip. That branch is deleted; $0 now renders like any other limit through the regular branch: the spend amount with a Group limit $0 / Custom limit $0 sub-label. getSeverity already treats a zero budget as exceeded only when spend is above zero, so $0 stays the normal color and, e.g., $100 over a $0 budget takes the destructive color. No new color logic.

Storybook coverage: Unlimited / UnlimitedThisGroup assert the new $X / Unlimited USD format, None is replaced by ZeroBudget (normal color) and ZeroBudgetExceeded (destructive visual variant), and AIBudgetUsage gains a ZeroBudgetNoSpend story asserting $0 / $0 USD.

Implementation plan and decision log

Scope

site/src/pages/GroupsPage/GroupMemberBudgetCells.tsx and its stories. This is the only surface that shows Unlimited (or None) without the spend. The groups list (GroupsPageView) already renders $X / Unlimited USD through AIBudgetUsage, and the Limits tab tables (GroupLimitsTable, UserOverridesTable) are pure limit-configuration tables with no spend data, so they stay as-is.

Changes

  1. Unlimited branch (limit === null): replace the bare Unlimited label with AIBudgetUsage, rendering $SPEND / Unlimited USD like the Avatar dropdown (UserDropdownAISpend).
  2. Zero-budget branch (limit === 0): delete the special None branch and let $0 flow through the regular branch like any other set limit, keeping the Group limit $X / Custom limit $X source sub-label consistent with nonzero limits. getSeverity already colors a zero budget as exceeded only when spend > 0.
  3. Dead code removal: the None branch and its tooltip message. LabelWithInfo stays (still used by Unlimited and the other-org states).

Decisions

  • Keep the Unlimited info tooltip (explains why no limit applies); drop the $0 tooltip as no longer needed once the value is shown as-is.
  • $0 uses the regular-branch rendering (spend + limit sub-label) rather than the inline $0 / $0 form, for consistency with every other configured limit; the inline / form remains only where no limit line exists (Unlimited).
  • UserDropdownAISpend intentionally keeps its own spend / Unlimited formatting: its colors differ from AIBudgetUsage, so consolidating would change visuals.

Validation

  • pnpm test:storybook for both touched story files (17 tests pass).
  • pnpm lint (Biome, tsc, knip, circular deps, compiler) clean; pnpm format applied.
  • Frontend self-review against FE1-FE10: all pass.

🤖 This PR was generated by Coder Agents on behalf of @EhabY.

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.
@EhabY
EhabY requested a review from ssncferreira July 23, 2026 12:33
@EhabY
EhabY marked this pull request as ready for review July 23, 2026 12:37
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.

1 participant