feat(tui): right-align the token meter legend's rates in their column - #1064
Merged
Conversation
The rate trailed its name, so it started wherever that name happened to
stop — a different offset on every row, and comparing throughputs meant
finding each figure before reading it. It now hangs off its cell's right
edge, one gutter column short, so the rates form a column of their own:
● 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
The slack lands between name and rate, separating two things that are read
differently rather than misaligning either. A cell too narrow for both still
drops the rate and keeps the name, as before — an unnamed color can't be
matched to a band, a missing rate only costs a number.
Spec 0167 updated.
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.
Follow-up to #1063. The grid aligned the names; the rates still trailed them, so each figure started wherever its name happened to stop.
(Layout code's own output at 64 columns, printed from a throwaway test — not a screenshot.)
The rate now hangs off its cell's right edge, one gutter column short so it never butts against the next cell's dot. The slack lands between name and rate, where it separates two things read differently rather than misaligning either.
idleright-aligns with the numbers for the same reason — it occupies the same slot.Cell contents are split out into a small
legend_cellhelper so the placement is unit-testable rather than only observable on screen. Behaviour that did not change: a cell too narrow for both still drops the rate and keeps the name, truncating the name before dropping the entry; the row's+Noverflow marker and the right-alignedΣfleet total sit after the last cell as before.Testing
cargo test --workspacegreen (exit 0, 0 failures). New tests assert the rate ends one gutter short of the cell edge for names of any length with a gap of at least one column, and that a cramped cell drops the rate before the name.Spec 0167 updated.
Binaries
Only
crates/clichanged → the relevant binary isconstruct:/Users/moon/agentd/.claude/worktrees/legend-rate-right-align/target/debug/construct