Skip to content

fix(widget): show the weekly window when Claude reports no 5-hour one - #236

Open
hiskudin wants to merge 2 commits into
mainfrom
fix/widget-weekly-only-claude
Open

hiskudin wants to merge 2 commits into
mainfrom
fix/widget-weekly-only-claude

Conversation

@hiskudin

@hiskudin hiskudin commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

A verified Claude Ultra account has no 5-hour limit, so the usage API now reports five_hour: null. The widget then shows an empty inner ring with a "—" where the countdown goes, and the week is drawn as a thin outer ring around it. When there's no 5-hour window, the weekly window now takes the inner ring, with its reset countdown, legend and border urgency. Codex already does this when it reports only a weekly window.

Changes

  • WidgetQuota.make, Claude case: if fiveHour is nil and sevenDay is present, the week goes in the short (inner) slot, the long slot is empty, and the label comes from the window (7d). Accounts that still report a 5-hour window are unchanged.
  • Updated the shortUtilization comment: the short slot can hold the week, so a high week keeps the pill urgent until the weekly reset.
  • WidgetQuotaTests:
    • New test_claude_weekOnly_takesTheInnerRing covers the slot, the empty outer ring, the label, the countdown and the tooltip.
    • test_countdownNilWhenShortWindowMissing assumed "Claude week only → no countdown", which this change reverses. It now uses a snapshot with only a per-model week.
  • README: one sentence in the widget section.

Unaffected:

  • The Usage tab and quota alerts, which read the snapshot directly, not widgetQuota.
  • Poll cadence, which doesn't depend on utilisation.

Testing

Automated: ./build.sh (no warnings), make test-without-xcode (1470 tests, 0 failures), make typecheck-tests.

Manual, on an Ultra account with five_hour: null in ~/.claude.json's cachedUsageUtilization, widget on, widget content set to usage:

  1. The inner ring shows the weekly percentage, and the countdown beside it shows the weekly reset (e.g. 4d15h), not "—".
  2. Hovering shows Claude / 7d N%, and the tooltip reads "Inner ring: 7d weekly quota".
  3. On an account with a 5-hour window, both rings and the 5-hour countdown are unchanged.

Related issues

None. Follow-up: the usage response now also carries a limits list (per-model weekly limits), which the Usage tab doesn't read yet.

hiskudin and others added 2 commits November 2, 2026 11:58
A verified Ultra account has no session limit, so the usage API reports
`five_hour: null`. The widget left the inner ring empty with "—" for the
countdown and drew the week as a sliver round it. The week now takes the
inner ring, with its reset countdown, legend and border urgency, as
Codex's weekly-only window already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Say in the shortUtilization comment that the short slot can hold the week,
and test the no-countdown case with a snapshot Claude can actually send.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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