Expand description
Small presentation helpers shared across readouts.
Duration formatting, rate auto-scaling, the braille
progress bar, and the spinner frame cycle. These were
private to nmbrs-runtime::activity before Push 2 and
now live next to the readouts that consume them.
Functions§
- ballot_
bar - Per-cell completion bar — variant of
braille_barused when the phase’s total extent is small enough that each cell can represent ONE operation rather than a percentage slice. Renders ballot-box glyphs: - braille_
bar - 10-character braille completion bar.
pctis clamped to [0, 100]; each char represents 10 percentage points with 8 within-char sub-levels via the standard bottom-up braille fill pattern, so the bar fills smoothly at ~1.25-percent resolution. - format_
compact_ session_ elapsed - Compact 8-char session-elapsed clock with a unit suffix
(
s/m/h) that scales as the run gets longer. The fractional precision shrinks step-by-step so the integer part stays bounded and the total width is constant — log rows column-align cleanly even when the suffix changes underneath them. - format_
eta - Compact ETA ladder: under a minute →
Ns; under an hour →NmMMs; otherwise →NhMMm. Returns—for non-finite / negative inputs so a stalled rate doesn’t produce a misleading number. - format_
rate - Auto-scaled throughput rate.
- session_
elapsed_ color - ANSI color span surrounding a compact session-elapsed string. Color tracks magnitude so a quick glance reveals how deep into the run the log line was:
- spinner_
frame - Standard 10-frame braille spinner cycle. Picks a frame
deterministically from
tick % 10so a refresh actor firing at a steady cadence renders smooth animation.