Skip to content

feat(tui): lay the token meter legend out in aligned columns - #1063

Merged
edwin-zvs merged 1 commit into
mainfrom
legend-columns
Aug 1, 2026
Merged

feat(tui): lay the token meter legend out in aligned columns#1063
edwin-zvs merged 1 commit into
mainfrom
legend-columns

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Two legend readability fixes, both about a row that names a band in the graph above it.

Aligned columns

The legend flowed entries end-to-end, so every row started its names at a different offset. Past a handful of models the dots and names scattered into a block of text with no line to read down.

It now lays out as a grid of equal-width cells, sized to the widest entry, so column n starts at the same x on every row:

--- before (flow) ---
|● claude-opus-5 4.8k/s ● claude-sonnet-5 1.2k/s |
|● gpt-5.5-codex idle ● grok-4 310/s ● gemini-3-pro 90/s |
|● claude-haiku-4-5 idle ● qwen3-coder 2.4k/s |

--- after (grid, col_w=25) ---
|● claude-opus-5 4.8k/s   ● claude-sonnet-5 1.2k/s |
|● gpt-5.5-codex idle     ● grok-4 310/s           |
|● gemini-3-pro 90/s      ● claude-haiku-4-5 idle  |
|● qwen3-coder 2.4k/s     |

(That block is the layout code's own output for a 64-column panel, printed from a throwaway test — not a screenshot. Seven models at once is hard to stage in a demo daemon; the alignment is what the diff is about.)

Tradeoffs taken deliberately:

  • Cells are sized to the widest entry, packing left. Spreading them to fill the width would squeeze the right-aligned Σ fleet total off a full row; the slack at the right edge is where it lives.
  • A cell never spills into its neighbour — one long name shifting the column below it undoes the alignment the grid exists for. It truncates within its cell instead, dropping the rate before the name as before.
  • It can cost a row. Flow fit the seven above in three rows, the grid takes four. The legend's row budget (everything above the graph's 3-row floor) is unchanged, and anything past it is still counted as +N.
  • An entry wider than the whole panel still gets one column and is truncated — zero columns would name nothing.

idle keeps the model's color

Follow-up to #1061, which dimmed idle by blending 70% toward the neutral gray. Half-graying the word made a quiet model's row stop pointing at its band. It now uses the model name's exact color with Modifier::DIM, so only the weight changes. IDLE_RATE_DIM and the blend_color call are gone.

Testing

cargo test --workspace green (0 failures). New/updated unit tests cover column alignment, the row budget, the one-column floor, and the idle style keeping its fg while gaining DIM.

Spec 0167 updated for both decisions.

Binaries

Only crates/cli changed → the relevant binary is construct:

/Users/moon/agentd/.claude/worktrees/idle-rate-same-color/target/debug/construct

Two readability fixes to the meter's legend, both about a row that names a
band in the graph above it.

The legend flowed entries end-to-end, so each row started its names at a
different offset. With a handful of models on a narrow panel the dots and
names scattered into a block of text with no line to read down. It now lays
out as a grid of equal-width cells sized to the widest entry, so column n
starts at the same x on every row and the legend scans vertically — the way
a list of models is read. A cell never spills into its neighbour, since one
long name shifting the column below it undoes the alignment. The cost is
trailing space inside narrower cells, and occasionally one more row.

And `idle` now dims by attribute on the model's own color rather than
blending toward the neutral gray. Half-graying the word made a quiet
model's row stop pointing at its band; only the weight should change.

Spec 0167 updated for both.
@edwin-zvs
edwin-zvs merged commit 8f61acb into main Aug 1, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the legend-columns branch August 1, 2026 03:42
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.

1 participant