Commit a8be4f8
committed
feat: display enterprise account credit and spend usage rows
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 crash1 parent 9b29972 commit a8be4f8
5 files changed
Lines changed: 397 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
15 | 24 | | |
16 | 25 | | |
17 | 26 | | |
18 | 27 | | |
19 | 28 | | |
| 29 | + | |
20 | 30 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
7 | 12 | | |
8 | 13 | | |
9 | 14 | | |
| |||
181 | 186 | | |
182 | 187 | | |
183 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
184 | 224 | | |
185 | 225 | | |
186 | 226 | | |
| |||
0 commit comments