feat(menubar): daily budget alert respects the display metric (Cost or Tokens) (#497)#505
Merged
Merged
Conversation
…#497) The daily budget was always measured in dollars, so users tracking the Tokens or Total Tokens metric had no token-based budget alert. Add a separate token-denominated daily budget and route the flame tint and the hero "budget exceeded" banner through one metric-aware check. - New dailyTokenBudget (stored separately from the cost budget so switching metric never reinterprets a threshold). - Centralize the logic on AppStore: isTokenMetric, activeDailyBudget, todayMetricTotal, isOverDailyBudget, dailyBudgetLabel. - Settings shows a token-threshold picker (1M..100M) for token metrics and the existing dollar picker for the cost metric, with metric-aware help text. - Flame tint and the banner now use isOverDailyBudget / dailyBudgetLabel.
This was referenced Jun 18, 2026
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.
Addresses the title of #497: the daily budget alert was cost-only, so users tracking the Tokens / Total Tokens metric had no token-based budget or alert. (The issue's body — a compact combined
🔥 20Mview — is already shipped as the "Total Tokens" display metric; that part will be answered on the issue separately.)Changes (macOS menubar app)
dailyTokenBudget, stored independently from the costdailyBudget, so switching metric never reinterprets a dollar threshold as a token count.AppStore:isTokenMetric,activeDailyBudget,todayMetricTotal,isOverDailyBudget,dailyBudgetLabel. The flame tint (CodeBurnApp) and the hero "budget exceeded" banner (HeroSection) both go through these instead of duplicating a cost-only comparison.inputTokens + outputTokens, matching the "Total Tokens" display.Behavior
Validation
swift build(mac package) passes.