Detail a hovered token-meter column as bars per model - #1217
Merged
Conversation
Hovering a meter column listed its models as one line of comma-separated figures. A column is a stack, and the questions asked of it — what was this mostly, how much of it was real work — are about proportion, so the division was left to be done by eye; past two models the line read as a run of text with no shape at all. The detail is now a small panel: the span and the column's total, then one row per model with its name, a horizontal bar of that model's share, and its exact figures (cache-served volume marked as the subset it is). The bars are the column's own paint laid along a row instead of up one — one hue per model, the cache-served part in the darker tone at the bar's start, boundaries carried at eighth resolution — so the detail describes the graph under the pointer rather than a second vocabulary for it. Rows follow series order, the order the column stacks them and the legend names them, so a row's position matches its band. Bars scale to the hovered column's total, and a model that did any work keeps a visible bar however small its share. A terminal too narrow for a bar that would still separate a tenth from a fifth falls back to the previous text detail rather than drawing a stub bar. The project dashboard's meter had no hover detail at all; it now records its graph rect and shares this one renderer, since scoping the meter to a project changes which sessions are counted, not what the graph means. Column paint gains a horizontal axis (`bar_cells`) rather than a second implementation: same eighth arithmetic and the same fg-over-bg encoding for a boundary inside a cell, only the glyph table differs.
Two fixes to the hover detail. The cached figure was marked with `↺`, which reads as "refresh" and has to be learned before the row can be read. It now says the word: `18k · 9.0k cached`. The box was already sized from its rows, so it just gets wider. The bars ended on a partial block glyph, inherited from the column paint. That cost a square edge: cells a band fills outright are painted as background, and a foreground block beside them is only drawn where the font puts ink — a font that draws it short of the line box (#1183) notches the bar's corner, which reads as damage rather than precision. Bars now spend whole cells only, every one a background fill, so the rectangle is clean on any font. Largest-remainder apportionment keeps the cached and fresh parts summing to exactly the bar's length and keeps a band with volume from rounding away. A column still needs its eighths — it is a few cells tall and buys resolution there, against empty background where the glyph's leading doesn't show. A twenty-cell bar doesn't need them, so the horizontal axis machinery added for it is gone again; what remains of the sharing is `split_units`, the largest-remainder split both resolutions use.
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
Hovering a token-meter column used to list its models as one line of comma-separated figures. A column is a stack, and the question asked of it — what was this mostly, and how much of it was real work — is about proportion, so the division was left to the eye; past two models the line read as a run of text with no shape.
The detail is now a small panel: the span and the column's total, then one row per model — name, a horizontal bar of that model's share, and the exact figures.
(
▓= the model's darker cache-served tone,█= full-strength fresh. Both are painted as cell backgrounds, so in a text dump the bars are invisible — the sketch above stands in for them.)Design notes
cachedrather than a glyph, since a symbol has to be learned and a borrowed one (a refresh arrow) actively misleads.token_metergains onlysplit_units, the largest-remainder split shared by the column's eighths and the bar's cells;column_cells/band_cellare untouched.Specs
specs/0167-fleet-token-meter.md— new "The hover detail restates the column as bars" section (including why resolution legitimately differs between the two orientations), plus consequences and examples.specs/0191-project-dashboard-pane.md— the project meter hovers like the fleet meter.Tests
token_meter:split_unitshands out whole cells exactly and never starves a band with volume;stacked_eighthsis the same split at eighth resolution.ui: figures name cached as a subset in words; layout gives the bar the slack and never clips names/figures for it; declines a too-narrow terminal; header widens the box; segments split into whole cells cached-first, keep a tiny share visible, and omit a zero-volume part.app: end-to-end — hover the newest column, then assert the header total, the per-row figures, and that the opus row painted exactly 15 contiguous background-filled cells (18k of 24k over 20) in two tones, with no glyph anywhere in the bar.project_dashboard: the meter records its graph rect only on frames that draw columns (and clears it otherwise, so a stale rect can't answer hovers over whatever replaced it).constructsuite: 1382 pass. Onepty_renderwall-clock perf threshold (smith_tool_expand_collapse_rebuilds_only_retained_suffix) fails on this machine under parallel load — it fails identically on unmodifiedmain, and that file isn't touched here. No new rustfmt or clippy findings.Binary
Only
crates/clichanged → the relevant binary isconstruct:/Users/moon/construct/.claude/worktrees/token-hover-bars/target/debug/construct🤖 Generated with Claude Code