Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
EhabY merged 2 commits into
mainfrom
feat/group-member-budget-spend-display
Jul 23, 2026
Merged

feat(site/src): show spend for unlimited and zero AI budgets#27458
EhabY merged 2 commits 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.

@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

@ssncferreira ssncferreira left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🍹 just a few improvements on storybook for the test to be correct according to the correct logic

Comment thread site/src/pages/GroupsPage/GroupMemberBudgetCells.stories.tsx Outdated
Comment thread site/src/pages/GroupsPage/GroupMemberBudgetCells.stories.tsx
Comment thread site/src/pages/GroupsPage/GroupMemberBudgetCells.stories.tsx Outdated
EhabY and others added 2 commits July 23, 2026 20:27
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 force-pushed the feat/group-member-budget-spend-display branch from 8f3a58a to d91a98d Compare July 23, 2026 17:27
@EhabY
EhabY enabled auto-merge (squash) July 23, 2026 17:37
@EhabY
EhabY merged commit 1062412 into main Jul 23, 2026
26 checks passed
@EhabY
EhabY deleted the feat/group-member-budget-spend-display branch July 23, 2026 17:38
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 23, 2026
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.

2 participants