Offer the weekly limit as the main ring - #336
Conversation
For a provider with a weekly limit beside a shorter one, the big ring was the short window: a Claude account read 1% on the notch while its week stood at 94%, and the week -- the limit that actually runs out, and the one that decides when to switch account -- sat in the hover card or a thin second ring. A new "Weekly limit as the main ring" switch, off by default, leads with the week instead: the big ring becomes the weekly window, the thin ring (where one is on) the shorter one, and nothing leaves the card. It is decided by how long the window runs, not by what it is called. A provider's weeklyID is whatever it draws as the second ring, and that is not always a week: Grok's is its credits, and Codex can report the week as its primary window with the five hours second. So the swap happens only when the second window runs about a week and is longer than the one leading; anything else is returned as the vendor sent it. Like DailyPace it is laid over the snapshots on the way out (AppDelegate.drawn), and applied first, so Claude's daily pace ring still leads where both are on. It reaches the rings only -- the notch and the phone. The menu bar and the alert watchers keep the vendor's own order: the menu bar already shows the week beside the short window under a "Weekly Limit" label that would name the session after a swap, and the watchers track one headline per provider and tell session from week by which window leads, so a swap under them re-fired thresholds, announced a weekly reset that had not happened, and left a spent session with no "available again" to follow it. Alerts are exactly what they were. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # Sources/Localizable.xcstrings
|
Merged as The thing that made this easy to take: it's off by default, so nobody's rings move unless they ask. And the selection is by duration rather than by name ( The part I appreciated most is the scoping: One follow-up worth doing: the Windows port is now divergent. Nit: |
Offer the weekly limit as the main ring
For a provider with a weekly limit beside a shorter one, the big ring is the
short window. On the machine this was built on, a Claude account read 1% on
the notch while its week stood at 94% — and the week is the limit that
actually runs out, the one that decides when to switch account. It sat in the
hover card, or in the optional thin ring.
A new switch in Appearance, Weekly limit as the main ring, off by default,
leads with the week instead: the big ring becomes the weekly window, the thin
ring (where one is on) the shorter one, and nothing leaves the card. Independent
of #321 and #331.
Decided by length, not by name
A provider's
weeklyIDis whatever it draws as the second ring, and that is notalways a week — Grok's is its credits, and Codex can report the week as its
primary window with the five hours second (your own
testStillReadsACountdownIfABuildEmitsOne). So the swap happens only when thesecond window runs about a week (6–8 days) and is longer than the one
leading. Anything else is returned exactly as the vendor sent it: a Codex plan
that reports only the week, Cursor's monthly cycle, Grok's credits.
I know
weeklyWindow's doc prefers declared ids over durations. The check hereis a guard on top of the declared id, not a replacement for it: the swap changes
what the big ring means, so it wants proof the window is a week, and a
provider that declares one without a duration is simply left alone.
Rings only
Like
DailyPace, it is laid over the snapshots on the way out, in one place(
AppDelegate.drawn), applied first so Claude's daily pace ring still leadswhere both are on. It reaches the notch and the phone only.
The menu bar and the alert watchers keep the vendor's own order, on purpose — my
first version fed them the swapped snapshots too, and review found:
the session after a swap;
UsageResetWatcherandThresholdNotifiertrack one headline per providerand have no notion of which window it was, so flipping the switch re-fired
threshold alerts and could announce a weekly reset that had not happened
(stale session deadline vs. the week's);
UsageLimitWatchertells session from week by which one leads, so it had tobe fed the unswapped order anyway — which left a spent session announced with
no "available again" to follow it.
So alerts and the menu bar are byte-for-byte what they were. (The same
stale-state weakness exists today when the daily pace ring is flipped on — out of
scope here, happy to look at it separately.)
Copy
Two new strings through
L10n.t, with pt-BR added toLocalizable.xcstrings.The catalog was re-serialized with its own formatting, so the diff is the new
entries only.
Tests
8 in
WeeklyHeadlineTests(inDailyPaceTests.swift, same concern): the weekleads and the session moves to the thin ring; off leaves every snapshot as sent;
a week already leading is left alone; a second window that is absent, is not a
week, or is monthly is left alone; a provider with no second window is
unchanged; the daily pace still leads where both are on; the preference is off
by default and remembered. Full suite 1742 / 0 failures on this branch alone.
🤖 Generated with Claude Code