Panel model weeks, purchased credits left, extra usage in the credit blue #18
Loading…
Reference in a new issue
No description provided.
Delete branch "oss-oo/model-week-panel-and-credits"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three fixes the owner reported on the live 1.0.3 panel, plus what turned up on the way. Version 1.1.0.
1. Model weeks in the panel
Show model-specific limits in the panel merged every limit by window duration (
summarizeWindowskeeps the lowest value per duration), so the switch only swapped the 7d item between the all-models week and Fable.UsageFormat.selectPanelSummarieskeeps the account's 5h/7d (with both panel switches) and appends each model week as an item of its own, with the model letter on its icon, in the label when the icon is hidden, and beside the value (horizontal) or above it (vertical) when icon and labels are hidden. Without an account limit the switch lists every model week; switched off, the merged fallback keeps the panel filled. Settings tooltip added.2. Extra usage amount ($40 vs $10)
Root cause, verified with read-only probes (token in memory only, sanitized evidence outside the repo):
/api/oauth/usage→extra_usage.monthly_limitis the monthly spend limit (4000 cents = $40 on the owner's account),used_creditsthe spend this month (608). The helper showedmonthly_limit − used_creditsas "left". The purchased credits live atGET /api/oauth/organizations/<org>/prepaid/credits(amount: 392 cents = $10 − $6.08), the request Claude Code itself sends.extraUsage.activefollows Claude Code (is_enabledorout_of_credits/org_spend_cap_reached/org_level_disabled_until),limitReachedthe spend-limit flags,outOfCreditsits reason,autoReloadthe prepaid settings.<balance> left(<spent> spentwithout a balance; 1.0.3 snapshots replayed after the update fall back to spent, never to the cap-based number). Out of credits reads$0.00 left. A Monthly limit row appears only while the limit ends spending first: auto-reload on, less of it left than of the credits, or reached ($0.00 left).historyBalanceonly).amountcovers every tranche; the per-tranche remaining in the same answer read one cent less (391) in the probe, so claude.ai's per-tranche table may differ by a cent.3. Extra usage in the graph
The credit segments were mint (
normalColor) on green quota bars, the spend line warning yellow. Now the family credit style of z-usage/chatgpt-usage: one blue (#62c7f5, z's credit blue) for the balance, the 24h/12h/4h/1h spend and the graph segments, throughlegibleAccent(ported from chatgpt-usage 1.1.0) so it deepens until it reads on light popups, with a lighter top only on dark popups.Found on the way
api.anthropic.combefore their stubs were switched;make checknow runs the Python suites undertests/netguard/sitecustomize.py(loopback only, aBaseExceptionnoexcept OSErrorswallows), andtests/test_netguard.pyproves the guard is active, also in CI.NOW.Validation
make verifygreen: 140 Python tests, 17 cjs suites, translations, rights, social preview; Prettier, ruff clean. CI green on every push.77eb570, round 2 (three nits) fixed in670374e, round 3 found nothing; its one wording note is ine8a6c4a.🤖 Generated with Claude Code
The capture of the new popup showed "Extra us… $7.66 left": the shorter purchased balance left the suffix room to grow, and the fit's growth loop checked before each step, so a step across a font hinting threshold (about 11px) stayed although the line no longer fit and the box squeezed the label. Port the z-usage 1.1.0 fix ("Cred…"): growth keeps the next whole step only if the line still fits, a settled size stays, and the tail counts with the larger of its preferred and painted width. tests/test-credits-fit.js replays the measured thresholds with Claude's labels and fails on the old loop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>