From 8794ddeb835bc23d606bbe354b2b85b0d714c792 Mon Sep 17 00:00:00 2001 From: Resham Joshi <65915470+iamtoruk@users.noreply.github.com> Date: Thu, 18 Jun 2026 13:23:57 +0200 Subject: [PATCH] fix(menubar): track isOverDailyBudget so the flame re-tints on budget crossings (#507) The menubar refresh observation block read displayMetric and the two budget values, but not the derived isOverDailyBudget (which also depends on todayPayload). It worked only because payload/menubarPayload happened to touch the same cache storage. Read isOverDailyBudget explicitly so the flame re-tints when today's usage crosses the budget, and so the dependency survives any future cache refactor. --- mac/Sources/CodeBurnMenubar/CodeBurnApp.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mac/Sources/CodeBurnMenubar/CodeBurnApp.swift b/mac/Sources/CodeBurnMenubar/CodeBurnApp.swift index e3fbab43..85ad75a4 100644 --- a/mac/Sources/CodeBurnMenubar/CodeBurnApp.swift +++ b/mac/Sources/CodeBurnMenubar/CodeBurnApp.swift @@ -590,6 +590,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSPopoverDelegate { _ = self.store.displayMetric _ = self.store.dailyBudget _ = self.store.dailyTokenBudget + // Read the derived flag so the flame re-tints when today's usage + // crosses the budget, not only when the budget value itself changes. + // This also makes the dependency on todayPayload explicit instead of + // relying on payload/menubarPayload happening to touch the same cache. + _ = self.store.isOverDailyBudget // Track the live-quota state too so the flame icon re-tints on // every subscription / codex usage update, not just every 30s. _ = self.store.subscription