What it looks like
crates/launchbound-tui/tests/golden/overview-80x24.txt, line 5 — the recorded frame, so this is the shipped behaviour:
│CHOSEN c1-0000000000000009 block_x=32 tile=512 unroll=4 0.0400 ms [0.0398, │
The interval is cut mid-value. The same frame at 110 columns:
│CHOSEN c1-0000000000000009 block_x=32 tile=512 unroll=4 0.0400 ms [0.0398, 0.0402] │
Why this is worse than dropping it
A truncated [0.0398, is not a shortened interval — it is a number with no upper bound and a dangling comma. A reader cannot tell whether the frame is mis-rendered, whether the value is wrong, or whether the tool ran out of data. The one line in the view that carries the result the user came for is the one that breaks.
80×24 is not an edge case here: it is the default terminal size, it is the geometry the TUI's own golden suite mandates, and overview-80x24.txt is the first golden in the directory.
Fix
The line has a natural precedence order — the chosen configuration and its time matter more than the interval — so the interval is the part to drop when the width is not there:
CHOSEN c1-0000000000000009 block_x=32 tile=512 unroll=4 0.0400 ms
Options, roughly in order of preference:
- Drop the interval when it does not fit whole. Measure before rendering; show
[lo, hi] only if the full token fits. Nothing is misleading, and the wide case is unchanged.
- Shorten it —
±0.0002 is 8 characters against 18, and fits at 80 with room left.
- Wrap onto a second line, which the panel has space for (rows 6 and 10 of that golden are blank).
Whichever, please re-bless overview-80x24.txt so the golden records the fixed frame — and consider a test that fails on any rendered line reaching the right border with a character that cannot end a field (, [ alphanumeric), which is what would have caught this and will catch the next one.
Done when
Nothing in the overview at 80 columns is cut mid-value.
What it looks like
crates/launchbound-tui/tests/golden/overview-80x24.txt, line 5 — the recorded frame, so this is the shipped behaviour:The interval is cut mid-value. The same frame at 110 columns:
Why this is worse than dropping it
A truncated
[0.0398,is not a shortened interval — it is a number with no upper bound and a dangling comma. A reader cannot tell whether the frame is mis-rendered, whether the value is wrong, or whether the tool ran out of data. The one line in the view that carries the result the user came for is the one that breaks.80×24 is not an edge case here: it is the default terminal size, it is the geometry the TUI's own golden suite mandates, and
overview-80x24.txtis the first golden in the directory.Fix
The line has a natural precedence order — the chosen configuration and its time matter more than the interval — so the interval is the part to drop when the width is not there:
Options, roughly in order of preference:
[lo, hi]only if the full token fits. Nothing is misleading, and the wide case is unchanged.±0.0002is 8 characters against 18, and fits at 80 with room left.Whichever, please re-bless
overview-80x24.txtso the golden records the fixed frame — and consider a test that fails on any rendered line reaching the right border with a character that cannot end a field (,[alphanumeric), which is what would have caught this and will catch the next one.Done when
Nothing in the overview at 80 columns is cut mid-value.