Configurable menubar status period#302
Open
ozymandiashh wants to merge 1 commit into
Open
Conversation
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
CodeBurnMenubarPeriodsetting for the macOS status item, with Settings choices for Today, Week, Month, and 6 Months$42 / wk,$42 / mo,$42 / 6mo; compact mode uses$42/wk,$42/mo,$42/6mo)defaults write org.agentseal.codeburn-menubar CodeBurnMenubarPeriod -string month), and add a changelog entryCloses #291.
Details
The old implementation treated
todayPayloadas special for the status item, regardless of which period the user had selected in the popover. This PR replaces that hard-coded status metric with a separatemenubarPeriodinAppStore, loaded fromUserDefaultson launch and persisted underCodeBurnMenubarPeriod.The status item still uses all-provider totals, but now it reads
menubarPayloadinstead oftodayPayload. The refresh path was centralized throughrefreshUsagePayloads(force:showLoading:), which avoids duplicate work when the popover is already showing the same all-provider period and quietly fetches the configured status period when the visible popover state differs.The Settings picker intentionally exposes only the four values requested in the issue: Today, Week, Month, and 6 Months. The existing popover still keeps its 30 Days segment, but
30daysis not accepted as a persisted status metric; malformed or unsupported defaults fall back to Today.Validation
swift buildnpm run buildnpx vitest run(47 files / 661 tests)git diff --checkNote
swift teststill fails locally before running tests because the Swift test target cannot import theTestingmodule, including the pre-existingCapacityEstimatorTests.swiftimport. The app target itself builds successfully withswift build.