Repository navigation
feat(menubar): switch the Capacity Dock gauge between usage windows - #1288
Closed
ozymandiashh wants to merge 1 commit into
Closed
ozymandiashh wants to merge 1 commit into
ozymandiashh wants to merge 1 commit into
Conversation
The resting rail shows one number per provider, and that number was always the weekly (else monthly) billing window. A user watching Claude's 5-hour limit had to expand the dock and read the glance card every time, which defeats the point of an always-visible usage monitor. Clicking the provider that already rests in the rail now switches its gauge to the provider's short rolling window and back. The preference is stored per provider rather than as a Claude-only switch: the dock's collapsed row is provider-agnostic, and Codex publishes a 5-hour and a weekly window too, so the question is "which horizon for this provider", stored under CodeBurnCapacityDockGlanceWindows alongside the other dock preferences. The two horizons are named rather than labelled, so the policy works for any adapter: billing reuses QuotaSummary.headlineWindow, the app's single definition of the weekly/monthly glance, and burst matches the short rolling rows the adapters emit (5-hour, Hourly, Daily, session) while excluding anything weekly or monthly, so Claude's per-model "Weekly · Opus" row can never be read as a short window. CapacityDockGlanceWindow keeps that policy pure and testable, including the fallbacks: a provider with one window shows it whichever horizon is stored, and a stored horizon the provider stops reporting resolves to the one it does report instead of blanking the gauge. The click cannot fight the hover expansion: this branch only ever pins, never collapses, and it is reached only when the provider actually has two windows, so a single-window provider keeps the existing click-to-pin toggle. Escape and an outside click still unpin. Keyboard and VoiceOver users get the same switch as a named accessibility action on the provider cell, and the cell's accessibility value now names the window feeding the ring. The rail's geometry is untouched. Closes getagentseal#1243
Member
|
Landed as #1309 (b0e53cf) with your commit and authorship intact, rebased onto current main after #1308; changelog conflict only. Verified before merging: single call-site blast radius on the resting gauge, every adapter's real label shape checked, click writes a preference only with no fetch, persistence normalized, mutation-verified tests, 473/473. Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
billing window. Clicking the provider that already rests in the rail now
switches that gauge to the provider's short rolling window — Claude's 5-hour
limit, Codex's 5-hour or daily window, any
Hourly/Daily/ session row anadapter reports — and clicking again switches back. Closes Feature Request: Allow switching Claude usage periods in the collapsed Capacity Dock #1243.
CodeBurnCapacityDockGlanceWindowsalongside the other dock preferences, so Claude can sit on its 5-hour window
while Codex stays weekly, and it survives relaunch. It is deliberately not a
Claude-only switch: the dock's collapsed row is provider-agnostic.
CapacityDockGlanceWindowpolicy decides which window is drawn.billingreusesQuotaSummary.headlineWindowso the app keeps one definitionof the weekly glance;
burstmatches short-horizon labels only afterexcluding weekly/monthly ones, so a per-model row like
Weekly · Opusisnever mistaken for a 5-hour window. A provider reporting one window keeps the
existing click-to-pin behaviour, and a stored horizon the provider stops
reporting falls back to the window it does report instead of blanking the
gauge to
--.(so hover expansion, the drag suppression window and Escape / outside-click
dismissal all behave as before), and keyboard and VoiceOver users get the same
switch as a named action on the provider cell, whose accessibility value now
names the window feeding the ring.
Testing
npm testpassesnpm run buildsucceedsmac/change only; no TypeScript touched.cd mac && swift build— passes.cd mac && swift test --filter CapacityDock— could not run on this machine:every test file, including ones this branch does not touch, fails with
error: no such module 'Testing'on a CLT-only toolchain. Relying on CI forthe suite.
mac/Tests/CodeBurnMenubarTests/CapacityDockGlanceWindowTests.swift:the per-provider preference round-trip (including defaults and rejection of
foreign stored values) and the toggle policy — which window is shown for a
given stored preference and set of published windows, that
Weekly · Opusisnot a short window, and the fallbacks when only one window exists or the
stored horizon disappears.