Skip to content

Show dimmed stale usage data instead of cost for Max/Pro users#23

Merged
himattm merged 3 commits intomainfrom
fix/stale-usage-dimmed
Mar 3, 2026
Merged

Show dimmed stale usage data instead of cost for Max/Pro users#23
himattm merged 3 commits intomainfrom
fix/stale-usage-dimmed

Conversation

@himattm
Copy link
Owner

@himattm himattm commented Mar 3, 2026

Summary

  • When the usage API is unavailable, Max/Pro users now see their last-known usage data dimmed in dark_gray instead of falling back to dollar cost display
  • Consolidates loadUsageCache + loadStaleUsageCache into a single function returning (data, stale, ok)
  • Propagates stale flag through getUsageDatarenderUsageLimitsrenderStale

Test plan

  • go build ./... compiles cleanly
  • go test ./... all pass
  • go vet ./... no issues
  • New TestUsageDiskCache_Stale verifies expired files return data with stale=true
  • New TestRenderStale verifies all colors override to dark_gray in both text and bars modes
  • Updated existing disk cache tests for 3-return signature

🤖 Generated with Claude Code

himattm and others added 3 commits March 2, 2026 19:38
When the usage API is unavailable, renderUsageLimits was falling back to
renderCost — showing dollar amounts to Max/Pro users. Now shows last-known
usage data in dark_gray to signal staleness.

Consolidates loadUsageCache + loadStaleUsageCache into a single function
returning (data, stale, ok) and propagates the stale flag through
getUsageData to renderUsageLimits.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@himattm himattm merged commit 6f12187 into main Mar 3, 2026
1 check passed
@himattm himattm deleted the fix/stale-usage-dimmed branch March 3, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant