Skip to content

feat(tui): add /usage stats screen with Overview and Models subviews#3

Merged
TTK95 merged 2 commits into
devfrom
claude/add-stats-window-LymQp
Apr 21, 2026
Merged

feat(tui): add /usage stats screen with Overview and Models subviews#3
TTK95 merged 2 commits into
devfrom
claude/add-stats-window-LymQp

Conversation

@TTK95
Copy link
Copy Markdown
Owner

@TTK95 TTK95 commented Apr 21, 2026

Adds a terminal-first stats screen reachable via /usage (alias /stats).
The screen renders a GitHub-style year heatmap plus KPI block on the
Overview tab, and a stacked per-day tokens chart with per-model
breakdown on the Models tab. Date range (All time, Last 7 days, Last 30
days) cycles with r and filters all KPIs; the heatmap stays
year-wide to match the mockup. ctrl+s copies a plain-text summary to
the clipboard. Pure derivation logic lives in util/usage-stats.ts and
is covered by unit tests.

claude added 2 commits April 21, 2026 12:38
Adds a terminal-first stats screen reachable via /usage (alias /stats).
The screen renders a GitHub-style year heatmap plus KPI block on the
Overview tab, and a stacked per-day tokens chart with per-model
breakdown on the Models tab. Date range (All time, Last 7 days, Last 30
days) cycles with `r` and filters all KPIs; the heatmap stays
year-wide to match the mockup. ctrl+s copies a plain-text summary to
the clipboard. Pure derivation logic lives in util/usage-stats.ts and
is covered by unit tests.
- hoist HEIGHT/ROW_INDICES/LEGEND_LEVELS out of render to avoid
  allocating fresh arrays every frame
- render the heatmap month header as a single <text> instead of one
  element per character
- drop the unused `filtered`/`range` props from Overview and the
  unused `sub` branch from summarizeStats
- fold the two identical formatMultiplier branches
- replace the redundant `const assistant = msg` alias in
  recordsFromMessages
- deduplicate `selectedForeground` into one `contrastingFg` helper
- remove the undocumented `q` keybind so only the footer hints are
  live (escape still exits)
@TTK95 TTK95 merged commit 0508e51 into dev Apr 21, 2026
@TTK95 TTK95 deleted the claude/add-stats-window-LymQp branch April 21, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants