Add weekly menubar limit preference#466
Open
Whiteknight07 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new global preference that, when enabled, makes the menubar/tray primary usage metric prefer a provider’s weekly overview progress line (when available), while preserving the current default behavior.
Changes:
- Added a persisted app preference (
preferMenubarWeeklyLimit) with load/save plumbing and bootstrap hydration. - Updated tray primary progress selection logic to prefer a “weekly” overview progress line when the preference is enabled.
- Extended Settings UI and updated affected hooks/tests to wire the preference through to tray rendering.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/stores/app-preferences-store.ts | Adds preferMenubarWeeklyLimit to the app preferences zustand store and exposes a setter. |
| src/pages/settings.tsx | Adds a new checkbox in Menubar Icon settings to toggle weekly preference. |
| src/pages/settings.test.tsx | Adds a UI test verifying the new checkbox triggers the change handler. |
| src/lib/tray-primary-progress.ts | Adds preferWeeklyLimit option and weekly-overview selection logic before primaryCandidates fallback. |
| src/lib/tray-primary-progress.test.ts | Adds tests for “prefer weekly” behavior and fallback when weekly isn’t available. |
| src/lib/settings.ts | Adds storage key + default + load/save functions for the new preference. |
| src/lib/settings.test.ts | Adds unit tests for loading default/stored value and saving the preference. |
| src/hooks/app/use-tray-icon.ts | Threads the preference into tray preview/provider bars/tooltip bar calculations via getTrayPrimaryBars. |
| src/hooks/app/use-settings-display-actions.ts | Adds handler to update store, schedule tray refresh, and persist the preference. |
| src/hooks/app/use-settings-display-actions.test.ts | Extends hook tests to cover saving/logging behavior for the new preference. |
| src/hooks/app/use-settings-bootstrap.ts | Loads preference during bootstrap and hydrates it into the app preference store. |
| src/hooks/app/use-settings-bootstrap.test.ts | Adds coverage for successful load and fallback-to-default on load failure. |
| src/components/app/app-content.tsx | Passes the preference and its change handler through to SettingsPage. |
| src/components/app/app-content.test.tsx | Updates test props to include the new settings handler/preview props. |
| src/App.tsx | Wires the preference from the store into tray icon hook and settings action handlers. |
| src/App.test.tsx | Updates settings module mocks to include load/save for the new preference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
Adds a global setting to prefer weekly limits in the menubar when a provider exposes a weekly overview progress line.
This keeps the current primary metric behavior by default. When enabled, providers like Claude and Codex can show their weekly usage in the menubar instead of the shorter session/window metric.
Related Issue
Fixes #393
Type of Change
Testing
bun run buildand it succeededbun run testand all tests passbun tauri devTest results:
bun run test: 60 files passed, 1083 tests passedbun run build: passedbun tauri dev: launched locally and setting worked in manual testingScreenshots
View screenshots
Before:
After, unchecked:
After, checked:
Checklist
mainbranchSummary by cubic
Adds a “Prefer weekly limits” menubar setting that, when enabled, shows weekly usage for providers that expose a weekly overview line (e.g., Claude, Codex). Default is off; existing primary metric behavior remains unchanged. Fixes #393.
preferMenubarWeeklyLimit(defaultfalse).getTrayPrimaryBarsto prefer weekly overview lines when enabled and fall back to primary candidates otherwise; menubar icon, provider view, and tooltip respect the setting.Written for commit 8b0b27a. Summary will update on new commits.