Skip to content

Overview redesign: usage chart, spend, quotas, past-year heatmap - #384

Merged
fylorn merged 10 commits into
devfrom
feat/overview-redesign
Oct 28, 2026
Merged

fylorn merged 10 commits into
devfrom
feat/overview-redesign

Conversation

@fylorn

@fylorn fylorn commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

What this changes

The overview is rebuilt around one usage card and adds spend, quota and long-term views:

  • Usage: the six metrics (tokens, cost, requests, cache hits, first token, traffic) sit in a row of tabs over one large chart with axes, grid lines and a per-slot tooltip that lists the top models. Quantities are bars (failures and download stacked on top), the hit rate and first-token P50/P95 are lines. Cost qualifiers stay visible on the tile. Live mode keeps the ten-minute flowing chart for tokens, cost and requests. Replaces the six small cards.
  • Spend (by model, upstream or key, following the selected metric) and Quotas and balances (subscription windows and wallet balances, read the same way as the Upstreams page), side by side; the quota card only appears when an upstream reports something.
  • Past year: a day-by-day heatmap of tokens, cost or requests from core's new usage history (UsageHistory, core v0.84.0), with totals, daily average, busiest day and streaks. Days before recording started are drawn as not recorded. The selected range is outlined; clicking a day switches the overview to that day (a new day range with an end). Days older than the oldest request record cannot be opened.
  • Breakdown rows get model, upstream and client logos. The status line shows the current generation speed while requests run.
  • The dashboard command takes an optional end and reads /quota.

Why

The overview was a grid of small cards and a table. The usage chart, the spend split and the remaining quota are what most people check, and the year view needs a history that outlives the request retention, which core now keeps.

How it was verified

  • pnpm typecheck, pnpm test (125 files, 1381 tests), cargo fmt --check, cargo clippy --all-targets -D warnings, cargo test --lib, and the ts_bindings test against v0.84.0.
  • In the preview harness, dark and light, at 1100 and 820 px wide: the tile row and its 3 x 2 layout, chart tooltips and the hover border, spend and quota cards side by side and stacked, the heatmap tooltip, clicking a day (and a day past the retention not opening), and the 7-day, 30-day and live ranges.
  • Not seen running: the generation speed in the status line; the harness did not produce in-flight requests during the check.

🤖 Generated with Claude Code

fylorn and others added 10 commits October 28, 2026 22:30
Lay out the overview as usage, spend and quota side by side, the past year,
then the breakdown table, with placeholder components for the new parts.
The metric chosen in the usage card lives on the page so it survives range
changes. A day range (from one local midnight to the next) lets the past-year
heatmap open a single day; the dashboard command takes an optional end.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Replace the six metric cards with one usage card. The six metrics sit side
by side as tabs (three by two on a narrow page); each shows its figure and
the change from the prior period with the same rules as before. The
selected metric is drawn below as a large chart with a four-step axis,
grid lines, date and time ticks, and a tooltip per slot that lists the top
models for tokens and cost. Requests and traffic stack their two parts;
cache hit rate and first-token percentiles are lines. The slot still in
progress is drawn fainter, and a day range ends at that day's end rather
than now.

The cost qualifier (estimated, unpriced, no usage, still being priced)
stays visible on the metric and in full in the detail line, not only on
hover. The live range keeps tokens, cost and requests to ten minutes and
labels the 24-hour metrics.

The old card and sparkline components are removed; axis, tick and model
ranking helpers are pure functions with tests.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Add the past-year card: one cell per day over 53 weeks (Monday on top, the
current week on the right), cells that scale with the card width, month and
weekday labels, and a Tokens / Cost / Requests switch. Cells are shaded in five
levels cut at the quartiles of the days with usage; days before recording began
are drawn as dashed "not recorded" cells. Four figures sit above the grid: the
total, the daily average over days with usage, the busiest day and the current
and longest streaks, with cost qualifiers (estimated, unpriced) always shown.
Days covered by the selected range are outlined. Hovering or focusing a day
shows its figures; clicking it or pressing Enter opens that day. The grid takes
one tab stop and moves with the arrow keys.

Data comes from the new UsageHistory endpoint, one bucket per day from the
first day of the grid, matched to local dates by the moment twelve hours into
each bucket so daylight-saving shifts do not move a day. The endpoint's type
and table entries are written by hand until core ships it; the screenshot
mocks answer it.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
- dashboard: fetch /quota alongside the rest; Dashboard.quotas is null when the read fails.
- Distribution card ranks models, upstreams or keys by the selected metric (sums for
  tokens, cost, requests and traffic; each item's own cache hit rate and first-token P50),
  shows the top five with shares and a wash bar, says how many more there are, and opens
  Traffic filtered to the row.
- Quotas and balances card lists enabled upstreams with subscription windows or a balance,
  reading them the way the Upstreams page does; it is absent when there is nothing to show.
- The status line shows the current generation speed while requests are running.
- Breakdown rows carry logos; models are matched to their vendor by name (modelGlyph).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… spend and breakdown

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…etention are not clickable

The cost tile wrote the qualifier marks at the big number's size, so an
estimated, partly unpriced amount did not fit. They are now set small in
front of the amount, and amounts from $1,000 drop the cents.

The past-year heatmap keeps usage beyond the request retention, but the
overview for a single day is computed from request rows. Days before the
oldest row (detail_since_ms, new in UsageHistory) can no longer be opened;
their tooltip says the day's details are past the retention period.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Pin core v0.84.0 (control API 55) and regenerate tw-api.ts, which replaces
the hand-written UsageHistory type. UsageHistory joins the webview call
allowlist on the Rust side. The UI kit notes describe the new usage chart
and the heatmap instead of the old card sparklines.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn
fylorn merged commit 0047c7e into dev Oct 28, 2026
6 checks passed
@fylorn
fylorn deleted the feat/overview-redesign branch October 28, 2026 17:35
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant