fix(ui): billing-shape-aware quota chip and modal #43
Reference in New Issue
Block a user
Delete Branch "fix/quota-ui-billing-shape-clarity"
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?
What this PR does
Follow-up UI polish on #40: the admin quota chip and modal plus the TUI quota panel now tell two separate, honest stories instead of one flattened and misleading dollar headline.
Chip
XX.X% · N.NN kWh plan. No more alternating between a dollar balance and a percentage depending on provider state.Modal — "Provider accounts" section
quota.by_provider, labeled by billing shape viabalance_source:$X credits (N min old)for polled/prepaid providers (OpenRouter),$X overage allowancefor telemetry providers (NeuralWatt),account balance not configuredotherwise.balance_atso a stalled poller is visible.Signed small-balance rendering
~$0.00 (slight overage)(NeuralWatt's normal -$0.004 overage reading keeps its sign — overage vs under-credit remain distinguishable).<$0.01. Exact zero renders as$0.00.TUI mirrors the same shape: kWh plan rows up top, labeled per-provider rows below; the
total_balance_usdheadline is gone.Out of scope / deliberately untouched
/metricsshape unchanged since #40.Verification
python -m pytest -qin the worktree: 1463 passed, 0 failures./metricsand/admin/api/snapshotcarry both providers with correctbalance_sourcevalues; served admin HTML contains all new rendering strings; TUI renders the new strings against live data. Pre-existing user TUI processes were left running (read-only from them; nothing killed on 8080).Post-merge action
Restart the production dispatcher to serve the new admin HTML:
systemctl --user restart llm-router.service.