From bc9460951a867f73b6cf25a9eaf970837f736f23 Mon Sep 17 00:00:00 2001 From: iamtoruk Date: Fri, 4 Sep 2026 01:38:08 -0700 Subject: [PATCH] fix(mac): scope Grok's omitted-percent-is-zero rule to unified billing; finish the fixture scrub An omitted creditUsagePercent inside an open billing window was read as 0% for every Grok account. That contract only holds for unified-billing users; for anyone else it now stays unknown instead of showing a fabricated 0%. The wireframe mockup still carried the one device name #1250 replaced everywhere else. --- codeburn-desktop-wireframes.html | 2 +- .../CodeBurnMenubar/Data/GrokBuildSubscriptionService.swift | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/codeburn-desktop-wireframes.html b/codeburn-desktop-wireframes.html index bebb5d6e..fc0283e2 100644 --- a/codeburn-desktop-wireframes.html +++ b/codeburn-desktop-wireframes.html @@ -659,7 +659,7 @@
Paired
-
toruk-minilast pull 2h ago · 34 sessions · $41.20 this month
Pull now
+
studio-minilast pull 2h ago · 34 sessions · $41.20 this month
Pull now
Combine usage from paired devicesscope captions gain “· 2 devices” when on
diff --git a/mac/Sources/CodeBurnMenubar/Data/GrokBuildSubscriptionService.swift b/mac/Sources/CodeBurnMenubar/Data/GrokBuildSubscriptionService.swift index f97cbf56..5c0a7e74 100644 --- a/mac/Sources/CodeBurnMenubar/Data/GrokBuildSubscriptionService.swift +++ b/mac/Sources/CodeBurnMenubar/Data/GrokBuildSubscriptionService.swift @@ -278,10 +278,13 @@ enum GrokBuildSubscriptionService { let cap = config.monthlyLimit?.val, used.isFinite, cap.isFinite, used >= 0, cap > 0 { rawPercent = used / cap * 100 - } else if isActiveBillingPeriod(config.currentPeriod, now: now) { + } else if config.isUnifiedBillingUser == true, + isActiveBillingPeriod(config.currentPeriod, now: now) { // Grok's web client and proto3 both treat an omitted // creditUsagePercent as 0 during an active window. After a weekly // reset the field is simply absent — that is 0% used, not unknown. + // Only unified-billing accounts carry that contract; for anyone + // else an omitted field stays unknown rather than a fabricated 0%. rawPercent = 0 } else { rawPercent = nil