fix(mac): keep (today, all) cache fresh for menubar title and tab labels#94
Merged
Merged
Conversation
The refresh loop previously skipped `refreshQuietly(.today)` when the user was already viewing the Today period. That guard meant while the user was on (today, claude) or any other non-.all provider, the (today, all) cache went stale. The menubar title and the agent tab strip both read from that cache, so they displayed stale costs while the hero section (which reads the currently-viewed payload) showed the correct fresh value. Remove the guard so the (today, all) cache refreshes every cycle regardless of the currently selected period/provider. Shipped as mac-v0.7.4.
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
Bug reported live: Mac menubar title and agent tab strip show stale costs when the user is viewing the Today period and a specific provider (e.g., Claude tab). Hero section updates correctly, but menubar icon + tab labels lag.
Root cause:
startRefreshLoop()only calledrefreshQuietly(period: .today)when the selected period was NOT Today. On Today, only the currently-viewed payload refreshed, leaving(today, all)stale. That's the cache both the menubar title and tab labels read from.Fix: drop the guard, always refresh
(today, all)every cycle.Validator verdict
Fresh-session validator checked:
Flagged one polish issue (duplicate CLI spawn when user is on Today+All) as non-blocking. Follow-up work.
Test plan
.appviamac/Scripts/package-app.sh, install locally, verify menubar title + tab labels update when provider cost changesmac-v0.7.4after merge to ship to customers vianpx codeburn menubar