Skip to content

feat(ai-accounts): show both Antigravity quota windows per group - #933

Merged
kittors merged 1 commit into
devfrom
feat/antigravity-quota-dual-window
Aug 20, 2026
Merged

feat(ai-accounts): show both Antigravity quota windows per group#933
kittors merged 1 commit into
devfrom
feat/antigravity-quota-dual-window

Conversation

@kittors

@kittors kittors commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Panel half of showing both Antigravity quota windows. Pairs with kittors/CliRelay#913 β€” merge that one first.

What was wrong

The card showed only the 5-hour window. But a group shares one weekly limit and one 5-hour limit, and hiding either leaves the account holder guessing which one is about to run out. The real Antigravity client shows both, grouped by model family, weekly first.

The layout now

Gemini Β· 周            51%
β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
Gemini Β· 5 小既        72%
β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–‘β–‘β–‘β–‘β–‘
Claude and GPT Β· 周    90%
...

Each label is composed here: the group name comes from the upstream, the window from windowSeconds. So the window is localised without translating anything the upstream owns.

Three deliberate simplifications:

  • The trailing "models" is stripped from the group name β€” it carries nothing next to a window and a percentage. This trims a generic suffix, not a list of known groups, so a group the upstream adds tomorrow is shortened the same way.
  • A group with only one window gets no window suffix. The fallback model view is entirely 5h, and appending "Β· 5 小既" to every row there is pure noise.
  • The upstream's description of a group is a full sentence. It moves behind an β“˜ hint icon next to the label, together with a short explanation of how the two limits interact. It is taken off the item as well as out of the row, so it cannot reappear in the detail line reserved for the reset countdown.

Sorting needed no change

resolveAuthFileQuotaRank ranks by the tightest quota the card actually shows, and it reuses resolveQuotaCardSlots. The weekly bucket became eligible the moment the card began showing it β€” one change, both behaviours consistent.

Its test now pins the consequence: an account at 3% weekly outranks its own roomier 5h window. Ranking by the 5h number would put a nearly-exhausted account ahead of a healthy one while the card plainly shows 3%.

File-size gate

renderQuotaBar moves into quotaBar.tsx as useQuotaBarRenderer β€” the same reason renderQuotaBarNode already lived there: the presentation hook is over the limit and may only shrink. Both touched files ended up smaller than their baselines (AuthFilesFilesTab 2579β†’2578, useAuthFilesFilesPresentation 981β†’974), and the baselines are updated to lock that in.

Verification

Full suite green: 167 files / 1231 tests. All four structure gates and lint pass.

Five new tests cover the grouped ordering, the shortened + localised label, the single-window case that must omit the suffix, and that the description reaches the hint while leaving the item.

πŸ€– Generated with Claude Code

The card showed only the 5-hour window. A group shares one weekly limit
and one 5-hour limit, so hiding either leaves the account holder guessing
which one is about to run out β€” the real client shows both, grouped, with
weekly first, and now so does this.

Rows are composed here rather than taken from the backend: the group name
comes from the upstream, the window from WindowSeconds, so "Gemini Β· 周"
is localised without translating anything the upstream owns. The group
name loses its trailing "models", which carries nothing next to a window
and a percentage. A group with only one window β€” the fallback model view
is entirely 5h β€” gets no window suffix, since there is nothing to
disambiguate against.

The upstream describes each group in a full sentence. Printed inline it
would push the numbers off the card, so it moves behind a hint icon next
to the label, together with a short explanation of how the two limits
interact. The description is taken off the item as well as out of the row,
so it cannot reappear in the detail line reserved for the reset countdown.

Sorting needed no change: resolveAuthFileQuotaRank ranks by the tightest
quota the card actually shows, and it reuses resolveQuotaCardSlots, so the
weekly bucket became eligible the moment the card began showing it. Its
test now pins that an account at 3% weekly outranks its own roomier 5h
window, which is the behaviour an operator reading the card expects.

renderQuotaBar moves into quotaBar.tsx as useQuotaBarRenderer, for the
same reason renderQuotaBarNode already lived there: the presentation hook
is over the file-size limit and may only shrink. Both touched files ended
up smaller than their baselines, which are updated to match.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@kittors
kittors merged commit 09fddb1 into dev Aug 20, 2026
4 checks passed
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