Skip to content

The chosen configuration's confidence interval is cut in half at eighty columns #24

Description

@vyncint

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:

  1. 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.
  2. Shorten it±0.0002 is 8 characters against 18, and fits at 80 with room left.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions