Skip to content

fix(usage): a limit only one account reports fills the whole bar - #40451

Open
Bean0-0 wants to merge 1 commit into
pingdotgg:mainfrom
Bean0-0:fix/usage-limits-bar-layout
Open

Bean0-0 wants to merge 1 commit into
pingdotgg:mainfrom
Bean0-0:fix/usage-limits-bar-layout

Conversation

@Bean0-0

@Bean0-0 Bean0-0 commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Problem

In Usage → Limits, a provider with two accounts that report different windows gets a page of half-width bars. I hit this with two Antigravity accounts: one reports the 5-hour and weekly buckets, the other only the older "Reported quota" windows. Each row kept an empty slot for the account that doesn't report it, so its bar jumped between the left and right half of the card.

Fix

Pooled rows keep one column per account so the same account lines up across rows. A row only one account reports has nothing to line up with, so collectLimitPools now gives that account the whole row. Rows shared by several accounts keep their gaps, and the monthly $0 cap placeholder still keeps its slot. The fix is in shared code, so web, mobile, and the widget all get it.

On web, a lone bar in a multi-account pool still shows the account's name, so you can tell which account it belongs to. It drops the percentage, which only repeated the headline.

Evidence

Same component rendered in Chromium with two Antigravity accounts reporting different windows, before and after:

Before After
before after

New case in usageLimits.test.ts (pooled account columns) fails on main and passes here. vp run check:changed passes.

Created with Claude Opus 5.5 in Claude Code (T3 Code).

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Single-member usage limit pools now use only their reporting account as a column, except for monthly pools when any account has a zero-spend cap. Pooled bars now control account-name and percentage labels separately.

Changes: Pooled usage limit rows

Layer / File(s) Summary
Pool column selection and regression coverage
packages/shared/src/usageLimits.ts, packages/shared/src/usageLimits.test.ts
Single-member pools use their members as columns unless a monthly zero-spend cap requires account-wide columns. A regression test checks single-account session rows and shared weekly rows.
Pooled bar labels
apps/web/src/components/usage/UsageLimitsPooled.tsx
Account names display when a provider has multiple accounts. Percentage labels display when a pool has multiple columns.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • Issue 23916: The change gives a row reported by only one account a full-width bar. The monthly-spend case still keeps account-wide columns when any account has a zero-spend cap, so that part may remain unresolved.

Suggested reviewers: maria-rcks

Merge Risk: Minimal · up to bf76b

This change fixes half-width usage bars when accounts report different quota windows. It affects display layout only, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a limit that only one account reports now fills the whole bar. It matches the changeset in usageLimits.ts (single-member pools get no alignment columns) and the UsageL…
Description check Passed The description follows the template sections (Problem, Change, Scope, Verification). The Problem section gives the bug, the reproduction context (two Antigravity accounts, Usage → Limits), and the ex…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a limit that only one account reports now fills the whole bar. It matches the changeset in usageLimits.ts (single-member pools get no alignment columns) and the UsageLimitsPooled.tsx rendering. The conventional commit prefix 'fix(usage)' fits the bug-fix nature of the change. Under 'fix(usage)', the wording is plain and specific.

Full details: Description check

Explanation

The description follows the template sections (Problem, Change, Scope, Verification). The Problem section gives the bug, the reproduction context (two Antigravity accounts, Usage → Limits), and the expected behavior. The Change section explains the shared-code fix and why web, mobile, and widget are affected. Verification names a new regression test that fails on main and passes on the branch, plus a check command, and includes before/after screenshots. Gaps: the Scope section is missing. It does not link an issue showing the bug, and it does not explain why no issue is needed for this small fix. The template also asks for the model and harness used, and the author did add that line. The description is mostly complete, so the check passes, but the Scope gap should be addressed.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e203593 and bf76bd8.

Files selected for processing: 3

  • apps/web/src/components/usage/UsageLimitsPooled.tsx
  • packages/shared/src/usageLimits.test.ts
  • packages/shared/src/usageLimits.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@juliusmarminge juliusmarminge added takeover:in-progress A takeover lead is working on this PR takeover:blocked Takeover blocked; reason in the PR body and removed takeover:in-progress A takeover lead is working on this PR labels Nov 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). takeover:blocked Takeover blocked; reason in the PR body vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants