Skip to content

feat: session/weekly time window selection for menu bar percent & pace#21

Merged
johnlarkin1 merged 1 commit into
mainfrom
feat-menu-bar-time-window
May 30, 2026
Merged

feat: session/weekly time window selection for menu bar percent & pace#21
johnlarkin1 merged 1 commit into
mainfrom
feat-menu-bar-time-window

Conversation

@johnlarkin1

Copy link
Copy Markdown
Owner

Summary

Restores the session vs weekly time-window picker for the menu-bar percent and pace values. This fork feature was originally added in #6 (commit 3c947f1c) and was silently dropped during the sync to upstream 0.31.1 (commit eb255aba, "normalize merged Sources to upstream baseline"). The MenuBarDisplayMode Both/Percent/Pace dropdown survived, but the separate Session/Weekly control did not.

Re-applied onto the new upstream baseline (upstream refactored displayText/paceText to take a UsagePace? directly, so the integration is cleaner than the original).

What it does

Under Settings → Display, below the Display-mode and Separator rows, a new Time windows block with two segmented pickers:

  • Percent: Session / Weekly
  • Pace: Session / Weekly

Each value can independently track the rolling session window (~5h for Claude/Codex) or the weekly window. Defaults preserve prior behavior: percent = Session, pace = Weekly.

Changes

  • MenuBarTimeWindow enum (session / weekly)
  • Two persisted settings (menuBarPercentTimeWindow, menuBarPaceTimeWindow) with backward-compatible defaults, wired through SettingsStore (+ +Defaults, +MenuObservation, state, load)
  • Segmented pickers in PreferencesDisplayPane, gated on display mode (percent picker dims in pace-only mode and vice-versa)
  • StatusItemController+Animation selects the percent/pace window per setting
    • session → menuBarPercentWindow / UsagePaceText.sessionPace
    • weekly → secondary (with codex projection / abacus fallbacks) / UsageStore.weeklyPace
  • Round-trip test for the new settings

Verification

  • swift build
  • swift test --filter StatusItemAnimationTests (27 tests) ✅
  • ./Scripts/lint.sh lint — 0 violations ✅

🤖 Generated with Claude Code

…nd pace

Restores the time-window picker dropped during the upstream 0.31.1 sync.
Lets the percent and pace values in the menu bar each track either the
session or the weekly window independently.

- MenuBarTimeWindow enum (session/weekly)
- Two persisted settings with backward-compatible defaults
  (percent=session, pace=weekly)
- Segmented pickers in the Display preferences pane, gated on display mode
- StatusItemController selects the percent/pace window per setting
  (session -> menuBarPercentWindow / UsagePaceText.sessionPace,
   weekly -> secondary / UsageStore.weeklyPace)
- Round-trip test for the new settings

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@johnlarkin1
johnlarkin1 force-pushed the feat-menu-bar-time-window branch from 0318302 to 7b95964 Compare May 30, 2026 14:12
@johnlarkin1
johnlarkin1 merged commit 9d43cb6 into main May 30, 2026
6 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