Skip to main content

Module format

Module format 

Source
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_bar used 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. pct is 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 % 10 so a refresh actor firing at a steady cadence renders smooth animation.