feat: history view (1-week default) + rename to claude-dashboard.py#6
Open
dgjlindsay wants to merge 5 commits into
Open
feat: history view (1-week default) + rename to claude-dashboard.py#6dgjlindsay wants to merge 5 commits into
dgjlindsay wants to merge 5 commits into
Conversation
History view (press H, or click "H history" in the footer): - same 3 charts over a configurable window (--history-hours, default 168 = 1 week) with an auto-scaled bucket and a day-by-day X-axis - SUMMARY scoped to the window + a $ cost estimate (effective tokens × --price-per-mtok, default 5.0 = Opus 4.8 input) and a cache-hit rate - no active-sessions / allowance panels (per request); click a bar to drill into that slice by session - collected on demand, cached, refreshed on --interval and on resize collect() now takes (window, bucket, num_buckets) so one scan feeds both views. Footer "H history"/"H live" and "⌃C to exit" spans are clickable. Renamed claude-cache-monitor.py -> claude-dashboard.py (matches the project); log file and references updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a 4th always-on chart to the history view stacking effective tokens by
model (opus=blue, sonnet=green, haiku=amber, fable=purple, unknown=grey) with a
per-model legend — "what did the week run on".
- collect(track_models=True) accumulates per-bucket {model: eff} under an extra
"models" key (skipped by the fixed-key aggregation loops, so live is untouched)
- render_chart gains series_of/legend_str to stack arbitrary pre-coloured series
(model series aren't in the fixed CO palette)
- chart_block(model_chart=True) appends the 4th chart; plan_layout sizes the
history view for 4 charts; bars stay click-to-drill-down
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Press M in the history view (or click "M heatmap") for a full-page activity heatmap: effective tokens by local weekday (Mon..Sun) × hour-of-day (0..23), colour-ramped less→more, with per-day totals. M / q returns to the charts. - collect(track_heatmap=True) builds the 7×24 grid in the same history scan (module global HIST_HEAT); no extra pass - render_heatmap() draws the full page; footer M/H/⌃C spans are clickable - process_input gains show_heatmap (key m, footer span); q/esc unwinds heatmap → history → live - footer "⌃C to exit" is now clickable everywhere (quits) — consistency Help overlay updated for the model-mix chart, the heatmap, and the new keys. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per review: the activity heatmap was a full-page M toggle; move it into the history view's main layout instead — rendered as a panel beside the SUMMARY (hjoin). When the width can't hold both or the charts would drop below the minimum bar height, both panels fall back to popups: S = summary, M = heatmap (mirrors the live view's s/e/w degradation). - render_heatmap (full page) -> heatmap_content()/heatmap_panel() reused by the inline panel and the popup - plan_layout(history) decides inline vs popup (width + chart-height budget); render_frame draws SUMMARY | ACTIVITY side by side when inline - render_panel_popup gains "hsummary"/"heatmap"; process_input maps S/M to them in history (s/e/w stay live-only); removed the show_heatmap full-page mode - footer shows "click a bar" when inline, "S summary · M heatmap" when popped Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the implicit H-toggle with an explicit menu bar in the title row: a highlighted active tab, the L/H accelerator letter underlined (SGR-4). Tabs and the L/H keys are now deterministic (select, not toggle): H -> History, L -> Live. Tabs are clickable; footer span in history is now "L live". - styled(): rgb() plus optional background + underline - view_tabs()/_menu_cell(): the menu-bar tabs + click hit segments - render_frame: brand + tabs left, context + clock right; tab hits mapped - process_input: __live__/__history__ deterministic; H/L keys select - help text + README + module docstring updated Co-Authored-By: Claude Opus 4.8 (1M context) <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.
What
Adds a HISTORY view to the dashboard with a Win3.1-style Live / History menu bar, and renames the script to match the project.
Live / History tabs
Live/Historywith the accelerator letter underlined (SGR-4) and the active tab highlighted.L(Live) /H(History) or click a tab — deterministic select, not a toggle.History view
$cost estimate = effective tokens ×--price-per-mtok, default 5.0 = Opus 4.8 input, and a cache-hit rate) beside an ACTIVITY heatmap (effective tokens by local weekday × hour, colour-ramped less→more, per-day totals).S= summary,M= heatmap (mirrors the live view'ss/e/wdegradation).q/escunwinds popups → history → live;Ljumps straight back to Live.Other
H history/L live,S summary/M heatmap(popup mode), and⌃C to exitspans are all clickable.claude-cache-monitor.py→claude-dashboard.py(log + refs updated).Config
--history-hours(168) ·--history-bucket-minutes(override auto-scale) ·--price-per-mtok(5.0).How
collect()now takes(window, bucket, num_buckets, track_models, track_heatmap)so one scan feeds both views and builds the model-mix + heatmap data (extra keys the live aggregation loops ignore → live untouched); history is collected on demand, cached, refreshed on--intervaland on resize.VIEW_WINDOW/VIEW_BUCKET/VIEW_DAILY) so the chart axis, bucket-popup span, and summary label follow the current view.render_chartgainedseries_of/legend_strto stack arbitrary pre-coloured series (model series aren't in the fixedCOpalette).styled()adds optional background + underline torgb();view_tabs()/_menu_cell()build the menu bar + click hit segments;process_inputroutes__live__/__history__and theL/Hkeys deterministically.Commits (separable for review/rollback)
Verified
Single-frame renders of live / history (inline + popup tiers); tab + footer hit columns land on their labels; underline/highlight SGR correct per mode; bar drill-down; S/M/e + L/H key routing; small-terminal height + width fallbacks fit (or fall back to the too-small notice);
--history-bucket-minutesoverride; footer-span click parsing.🤖 Generated with Claude Code