feat: add optional menu-bar reset countdown rings - #62
Open
KurtGood wants to merge 2 commits into
Open
Conversation
Adds an optional pair of reset-countdown rings to the menu bar (5-hour red, 7-day orange) interleaved with the usage rings. Each fills with the percentage of its window elapsed and shows the remaining time in its center, so the time ring races alongside its neighbouring usage ring. Adds a "Reset countdown" toggle in General settings (on by default), localized in all six supported languages. When off, no time rings are drawn, the 30s repaint timer is stopped, and the countdown text is excluded from the icon cache key. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
German localization landed upstream in v3.3.0 after the countdown strings were written; backfill de.lproj so German users don't fall back to English. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
KurtGood
force-pushed
the
feature/menubar-countdown
branch
from
July 31, 2026 22:59
7b36a4a to
ad24106
Compare
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.
What this adds
Two reset-countdown rings in the menu bar, interleaved with the existing usage rings so each usage ring is immediately followed by its time ring:
(5h usage)(5h countdown – red)(weekly usage)(7d countdown – orange)Each time ring fills with the percentage of its window already elapsed — same scale and drawing as the usage rings — so the time ring visibly races its neighbour. If the usage ring is ahead of the time ring, you're spending that window's quota faster than the clock is running it down. The ring's center shows the remaining time in a compact, adaptive unit:
Reset edge case: right after a window resets, the API returns no
resets_at(the timer only starts on first token use). During that gap the ring shows an empty ring + a full-window placeholder (5h/7d) instead of vanishing, then transitions to the live countdown once usage starts — so the time ring always stays paired with its usage ring.Setting + i18n
UserSettings.init/resetToDefaults().timeCircleForreturnsnil(no rings drawn), the 30 s repaint timer is stopped, and the countdown text is dropped from the icon cache key (so toggling busts the cache cleanly).Implementation notes
MenuBarIconRenderer—timeCircleFor/makeTimeCircle/timeCircleText; acenterTextparameter added to the existing circle-drawing helpers so time rings reuse the usage-ring rendering path.UsageData+Formatting—menuBarCountdowntext + cache-key contribution.DataRefreshManager— a 30 smenuBarCountdownrepaint timer (local repaint only, no network request).MenuBarManager— starts/stops that timer according to the setting.UserSettings/GeneralSettingsView/LocalizationHelper/ 6×Localizable.strings— the toggle and its strings.Rebased on
main(v3.2.0). Builds and runs locally on macOS (ad-hoc signed).🤖 Generated with Claude Code