Skip to content

feat(tui): open on the token meter, and let the legend name every model - #1058

Merged
edwin-zvs merged 2 commits into
mainfrom
feat-token-meter-default
Aug 1, 2026
Merged

feat(tui): open on the token meter, and let the legend name every model#1058
edwin-zvs merged 2 commits into
mainfrom
feat-token-meter-default

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Follow-ups on the token meter (#1057), all about it being readable when you first meet it.

Default mode is the token meter

A client with no recorded choice now opens on the meter rather than the rain. An absent setting means "never asked" — which covers a fresh install and an upgrade from before the panel had modes at all — and the meter answers a question where the animation is ambience. Anyone who has actually picked a mode keeps it, since that choice is persisted.

Note: the panel itself still defaults to collapsed (matrix_rain_hidden: true, unchanged and long-standing), so on a fresh install this only takes effect once the panel is expanded. Say the word if you want the panel open by default too — that's a separate one-line change with a much bigger first-run footprint.

The legend can name every model

Two limits were cutting it short:

Row cap. The legend was capped at a third of the panel (clamp(h/3, 1, 4)), which is where the "max 4 items" came from — on a 14-row panel that's 4 rows, one entry each. It now takes every row above a three-row graph floor. Three is the least that still reads as a graph rather than a stripe. Naming a series costs one row; not naming it makes its band unreadable, so the trade goes that way until the floor is reached, and only then does the legend truncate.

Palette. 6 series colors → 10, so the collapsed other (N) row is reached far less often. This one can't be removed outright: the palette is the real limit on how many models a legend can name, because listing more names than there are distinguishable colors produces rows nobody can match to a band.

Seven models on a 14-row panel — all named, no +N, no collapse:

 ─⏸ operator ──────────── tokens ⇄ ─ −
             ▂           █   ▁       ▆
     ▆       █▆       ▁  █▃  █       █
    ▁█    █ █▃█  ▅    ▇  ▄▅  ▂ ▂▁    ▆
  ▃ ▇█   ▂▂▁▃▃▃▄█▇▃ ▁▅▁▇█▄█▅▇▅▃█▇ ▄▅██
  ██▃█ ▇▆▁█▂█▃█▁▆▇█▂███▅▂█▅█▄██▄▂ ▁▃▅▅
 ▆▆▃▁█▅▃█▆▄▂▃█▆██▂▃▃▅▅███▁▆▆█▆▅▆▇▆▅▂▅▄
 █▂█▅██▆▄█▅██▇█▄▃██▃█▄▇█▂███▆███████▆█
 ● grok-5 0/s ● muse-spark-1.1 0/s
 ● kimi-k3 0/s ● claude-opus-5 0/s
 ● hermes-4 0/s ● gpt-5.5-codex 0/s
 ● gemini-3-pro 0/s               Σ 0/s

A 7-row panel — graph holds its 3-row floor, legend gets the other 3:

 ─⏸ operator ──────────── tokens ⇄ ─ −
          █             ▄▁▃     ▆
  ▅   ▇   ▂▄ ▄   ▁ ▇▄▄▁▅▁▁▆▆▃▅▃ ▃▂▁  ▄
 ▆▇ ▇▇▆▅▇▁▂█ ▆▃▆▄▇▆▃▃▄▆▅▆▄▇▂▆▅▁ ▅▅█▅▃▆
 ● kimi-k3 0/s ● gemini-3-pro 0/s
 ● gpt-5.5-codex 0/s
 ● claude-opus-5 0/s              Σ 0/s

Bug: a genuine zero reported as <1/s

recent_rate returned an integer, so "computed but produced nothing" and "produced less than a token per second" both arrived as Some(0) and rendered <1/s — claiming output that didn't exist. It's fractional now, and the three states stay distinct: idle (never computed), 0/s (computed, produced nothing), <1/s (produced very little). Both snapshots above show the corrected 0/s.

Test note

matrix_rain_paints_browser_preview_wallpaper counts cells with an Rgb background on the premise that "the rain only ever sets fg" — which the meter's stacked-boundary cells violate. It's testing the rain body specifically, so it now pins the mode explicitly rather than relying on the default.

Specs

  • 0019 — records which mode a client with no recorded choice opens on.
  • 0167 — graph floor vs. legend rows, the palette as the naming limit, and the three rate states.

Binaries

Touches crates/cli only → the binary is construct.

Four changes to the ambient panel, all about the meter being readable when
you first meet it.

Default mode is the token meter. An absent setting means "never asked" —
which covers a fresh install and an upgrade from before the panel had modes
alike — and the meter answers a question where the animation is ambience.
Anyone who has actually picked a mode keeps it.

The legend may now take every row above a three-row graph floor, instead of
being capped at a third of the panel. That cap meant one legend row on a
short panel, so most series collapsed behind a "+N" and their colors named
nothing, while rows sat unused. Naming a series costs one row; not naming it
makes its band unreadable.

The series palette grows from 6 colors to 10, so the "other" collapse is
reached far less often. That palette is the real limit on how many models a
legend can name: listing more names than there are distinguishable colors
would produce rows nobody could match to a band.

Rates keep three states apart that integer division had collapsed to two:
`idle` (never computed), `0/s` (computed, produced nothing), and `<1/s`
(produced less than a token per second). The previous code reported a
genuine zero as `<1/s`, claiming output that did not exist.
The mode default only bit once someone expanded the panel, so a fresh
install still met an empty strip. Same "absent means never asked" reading
as the mode itself: a client that has collapsed the panel has that
recorded and keeps it.
@edwin-zvs
edwin-zvs merged commit 44fc8e1 into main Aug 1, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the feat-token-meter-default branch August 1, 2026 02:21
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