Skip to content

feat: display enterprise account credit and spend usage rows#39

Open
oyardena wants to merge 1 commit into
CodeZeno:mainfrom
oyardena:feat/account-usage-rows
Open

feat: display enterprise account credit and spend usage rows#39
oyardena wants to merge 1 commit into
CodeZeno:mainfrom
oyardena:feat/account-usage-rows

Conversation

@oyardena

Copy link
Copy Markdown

Summary

@oyardena oyardena force-pushed the feat/account-usage-rows branch from c87c9e6 to fa5c927 Compare June 20, 2026 15:54
For users on an enterprise Claude plan (no five-hour / seven-day rate-limit
buckets), the widget now shows two dedicated rows:

  Cr  9%·20/6   — credit remaining (%) and expiry date in system locale format
  Sp  $12/$50   — spend used / spend limit

For personal (Pro/Free) accounts the rows continue to show the normal 5h/7d
rate-limit bars.

Implementation notes:
- Parses `cinder_cove` and `spend` fields from the usage endpoint response
- Locale-aware date format via GetLocaleInfoW (respects separator and D/M order)
- Disk cache at %APPDATA%\ClaudeCodeUsageMonitor\account_cache.json survives
  widget restarts; cleared when plan has no enterprise fields (prevents stale
  enterprise rows appearing for Pro users after a 429)
- Tray tooltip uses dynamic row labels ("Cr"/"Sp" vs "5h"/"7d")
- tray_icon.rs: guard empty text before DrawTextW to avoid GDI crash
@oyardena oyardena force-pushed the feat/account-usage-rows branch from fa5c927 to a8be4f8 Compare June 21, 2026 20:08
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