Repository navigation
feat(usage): rebuild Usage as a cost cockpit with a rhythm heatmap - #317
Merged
Merged
Conversation
…ythm heatmap Replace the token-centric dashboard (stacked token trend, model donut, annual token heatmap) with a cost-first layout decided from the /proto/usage exploration: period selector (7D/30D/90D/All), four KPI tiles with sparkline and period-over-period delta, a daily cost line with crosshair tooltip, a weekday × hour rhythm heatmap in local time, and rank rows by project / model / tool / skill. - entities/session/usage-aggregation: new read model (splitUsagePeriod, summarizeUsage, usageDelta, aggregateDailyCost, rank*ByCost, aggregateWeekdayHourCost, rankLevels); old token/heatmap helpers removed - shared/ui: add PiLineChart + PiSparkline and PiHeatmap; PiKpi gains a footer slot and lets long stacked deltas wrap; PiBarChart removed (nothing else used it); registered on /design with tests - dev mock: serve list_sessions so /usage renders under bun run dev:mock - docs: self-built-ui ledger and design usage rules updated; decision record in .scratch/usage-redesign/DECISION.md Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
shared/uiprimitivesPiLineChart/PiSparkline/PiHeatmap;PiKpigains afooterslot.PiBarChartand the old token trend / annual heatmap code are deleted.usage-aggregation.tswith tests (period windows, deltas, daily cost, ranks, weekday×hour grid with injected clock, rank-based levels).list_sessions, so/usagerenders underbun run dev:mock..scratch/usage-redesign/DECISION.md(chosen Cockpit + Rhythm; rejected Ledger / Digest / Calendar / Drill and why).Screenshots
Light and dark verified in the browser mock at 1440×960; KPI deltas wrap under the value, empty heatmap cells stay visible in dark mode.
Test plan
bunx tsc --noEmitbun run test— 137 files / 1494 tests green (before the last two CSS tweaks; the 43 affected files re-run green after)/usageindev:mock, light + dark, no console errorsKnown follow-ups
🤖 Generated with Claude Code