Skip to content

fix(usage): pooled Limits bars show each account's mark instead of a position number - #40029

Open
juliusmarminge wants to merge 3 commits into
mainfrom
factory/issue-11880-a1794473605
Open

juliusmarminge wants to merge 3 commits into
mainfrom
factory/issue-11880-a1794473605

Conversation

@juliusmarminge

Copy link
Copy Markdown
Member

All three review items were correct. AccountAvatar (web and mobile) chose the provider glyph whenever account.redeem was set (every native account, and hub accounts with a nextCreditId), while the new web AccountLabel hid the name for email && !displayName accounts. So redeemable accounts with an email and no display name lost the email chip that told them apart on main and showed identical unbadged glyphs on the strip, the legend and the wide segment. On mobile the wide inline label was affected the same way; the mobile legend kept its name text. Fix, one condition on each client: AccountAvatar now renders AccountChip whenever account.email && !account.displayName, whatever redeem is, and otherwise the ProviderInstanceIcon (badged when there is a display name). On web this matches AccountLabel's suppression condition, so the chip is always drawn exactly once. The segment popover uses the same AccountAvatar, so for these accounts it now shows the email chip instead of a bare glyph, consistent with the bar. Checked with a throwaway browser test of the reviewer's case (two hub Codex accounts alice@/bob@example.com with redeemable reset credits, at 420px and 900px): the strip, the wide segments and the legend rows each carry a distinct 'Account AE' / 'Account BE' chip. Mobile was read and typechecked, not run on a device. No new regex or parser.

Fixes #11880

Reproduction on main

Commit origin/main b68aedf. Ran vp i, then a throwaway browser test (vp test run --project browser, Chromium) that renders UsageLimitsPooled with one environment holding four synthetic Claude provider instances (Claude Work/Personal/Team/Side, each with a Session window), at 420px and 900px wide. Read back the DOM: at both widths each bar segment button's text starts with a bare position number ('1'..'4') and every legend row reads 'Segment N '. None of those buttons contains an svg or img (icons=0), so the account's ProviderInstanceIcon or initials chip is drawn nowhere on the bar or legend. Screenshots were unstyled, so the DOM readout is the evidence. The full app was not run, because live Claude usage limits need first-party Claude OAuth, which this VM lacks. Mobile (apps/mobile/src/features/usage/UsageLimitsPooled.tsx renders index + 1 in both the strip and the legend) was read, not run on a device.

Evidence

Being captured: before and after in the real app. This section is filled in before the pull request can merge.

Tests

Throwaway browser test with vp test run --project browser (hub Codex accounts with emails and reset credits, 420/900px, DOM readout; deleted before commit): 2 passed, distinct AE/BE chips on every segment and legend row. vp run check:changed: format, lint, knip, typecheck (3 packages), test (1 file) and react compiler (2 files) all pass.

Not in this change

Who did the work

  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
  • Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5

Run by the t3code factory in T3 Code.

…position number

Fixes #11880

AI-assisted; verified with the tests and tools listed above.
AI-assisted; verified with the tests and tools listed above.
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 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

Mobile and web pooled usage limits now show account avatars in segments and legend rows instead of numbered markers. Email-only accounts use an initials chip. Other accounts use provider icons. Web omits the adjacent account name for email-only accounts and removes the “Segment” translation entry.

Changes: Pooled account identity

Layer / File(s) Summary
Avatar rendering in segments and legends
apps/mobile/src/features/usage/UsageLimitsPooled.tsx, apps/web/src/components/usage/UsageLimitsPooled.tsx, apps/web/src/i18n/translations/*.json
Mobile and web use account avatars in pooled segments and legend rows. Email-only accounts use an initials chip; other accounts use provider icons. Web omits the adjacent name for email-only accounts and removes the unused legend color parameter. The web translation files remove the “Segment” entry.

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

Change: Bug fix · Severity of issue fixed: Low

Possibly related issues

  • #36134 reports truncated account names when five accounts share a labeled bar. This change updates account identity rendering but does not change the bar width or name truncation behavior.

Suggested reviewers: maria-rcks, macroscopeapp, yash-singh1

Merge Risk: Minimal · up to e94e0

Pooled Limits bars and legends now show each account's own mark instead of a position number. No material merge risk was found; the change is easy to revert.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: pooled Limits bars now show each account's own mark instead of a position number. It is a conventional commit with a clear scope. It matches the raw summary, which rep…
Description check Passed The description follows the template. It has a clear problem statement, a change section that explains the condition fix on each client, a scope section that links issue #11880 and explains the fix, a…
Linked Issues check Passed Issue #11880 requires the pooled Limits bar and its legend rows to show each account's own mark, not a position number. At head, apps/web/src/components/usage/UsageLimitsPooled.tsx defines AccountAvat…
Out of Scope Changes check Passed The web changes in UsageLimitsPooled.tsx (AccountAvatar condition, AccountLabel suppression, segment labels, LegendRow no longer taking a color) serve the #11880 objective. The segment popover reuses …
Full details: Title check

Explanation

The title names the main change: pooled Limits bars now show each account's own mark instead of a position number. It is a conventional commit with a clear scope. It matches the raw summary, which replaces segment numbers with account avatars in the bars and legend, and it matches the objectives, which target distinguishable accounts in the bars and legends.

Full details: Description check

Explanation

The description follows the template. It has a clear problem statement, a change section that explains the condition fix on each client, a scope section that links issue #11880 and explains the fix, and a verification section with concrete browser test results and commands. The Evidence section says before and after screenshots are still being captured and will be filled in before merge. The template asks for before/after screenshots for UI changes, so that gap must close before merge. The description also contains a few agent-run and process details that are not template content, but these do not block the check.

Resolution

Before merge, replace the placeholder under Evidence with the before and after screenshots of the real app that the template requires for UI changes. Upload them to GitHub and embed or link them.

Full details: Linked Issues check

Explanation

Issue #11880 requires the pooled Limits bar and its legend rows to show each account's own mark, not a position number. At head, apps/web/src/components/usage/UsageLimitsPooled.tsx defines AccountAvatar. It returns AccountChip when account.email && !account.displayName, regardless of redeem. Otherwise it returns ProviderInstanceIcon, badged when displayName is set. The narrow strip (aria-hidden, @2xl/pool:hidden) and the wide segment (showAccountName) both render AccountAvatar. The segment aria-label now uses the account name or email initials, not the segment index. The PR's throwaway browser test reports distinct 'Account AE' and 'Account BE' chips in the strip, wide segments, and legend rows. The legend section was truncated in the head read, so legend rendering rests on the PR test report, not on a direct read. Mobile (apps/mobile/src/features/usage/UsageLimitsPooled.tsx) applies the same avatar rule per the PR summary; it was typechecked but not run on a device. Related issues #11562, #11641, and #11515 are correctly excluded. No automated test was added; the issue does not require one. The incremental change from af28bf4 to e94e09e was not read as a diff (changed blobs unavailable), so this verdict rests on the head file read and the PR evidence.

Full details: Out of Scope Changes check

Explanation

The web changes in UsageLimitsPooled.tsx (AccountAvatar condition, AccountLabel suppression, segment labels, LegendRow no longer taking a color) serve the #11880 objective. The segment popover reuses AccountAvatar, so its chip matches the bar; the issue's suggested fix implies this shared component. The mobile change applies the same avatar rule and removes numbered labels, as the issue's suggested fix names mobile's ProviderInstanceIcon. The raw summary lists removal of the unused 'Segment' translation key in 11 locale files. This is cleanup for the removed segment label text, not an unrelated change, but the diff of those files was not read. No badge-legibility changes or unrelated files were identified in the evidence read.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • 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 af28bf4 and e94e09e.

Files selected for processing: 12

  • apps/mobile/src/features/usage/UsageLimitsPooled.tsx
  • apps/web/src/components/usage/UsageLimitsPooled.tsx
  • apps/web/src/i18n/translations/de.json
  • apps/web/src/i18n/translations/en.json
  • apps/web/src/i18n/translations/es.json
  • apps/web/src/i18n/translations/fr.json
  • apps/web/src/i18n/translations/ja.json
  • apps/web/src/i18n/translations/ko.json
  • apps/web/src/i18n/translations/pt-BR.json
  • apps/web/src/i18n/translations/ru.json
  • apps/web/src/i18n/translations/sv.json
  • apps/web/src/i18n/translations/zh.json
Files with no reviewable changes: 10

  • apps/web/src/i18n/translations/de.json
  • apps/web/src/i18n/translations/en.json
  • apps/web/src/i18n/translations/es.json
  • apps/web/src/i18n/translations/fr.json
  • apps/web/src/i18n/translations/ja.json
  • apps/web/src/i18n/translations/ko.json
  • apps/web/src/i18n/translations/pt-BR.json
  • apps/web/src/i18n/translations/ru.json
  • apps/web/src/i18n/translations/sv.json
  • apps/web/src/i18n/translations/zh.json

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

Keep main's translated pooled-bar accessibility labels and the branch's
account avatars; drop the web "Segment" catalog entry the legend no
longer uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member Author

The automated pipeline stopped on this pull request and will not merge it:

the fix is written and reviewed, but proving it needs something no worker has:

  • Permanent blocker: The reproduction requires multiple first-party Claude OAuth accounts with live Session usage readings, which the brief explicitly lists as unavailable on every VM. The scenario fixture cannot create those readings through project or thread commands. Neither the base bug nor the head fix was visually verified.
  • Mobile account marks were not verified on a device because the same required Claude account state is unavailable.

It stays open for a person to finish or close.

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:M 30-99 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Limits bar labels pooled accounts by number, so accounts cannot be told apart

1 participant