Skip to content

tui: a frame-rate cap, print after the turn's Static items, quit's last frame under mount, a color depth for mount, and the truncating row — each used by test:tui - #410

Merged
shreeve merged 7 commits into
mainfrom
tui/runner-needs
Sep 22, 2026

Conversation

@shreeve

@shreeve shreeve commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Five things bun run test:tui found packages/tui made harder than it should. Each lands with a pin that fails without it, and each commit removes the runner's workaround for it.

  • pace: on run and mount sets the least time between frames (default 8 ms); changes inside it draw as one frame; under mount the frames follow view.tick. The runner drops the model it repainted once per clock tick and runs at pace: 100, its state bound directly: about 10 frames a second.
  • print writes the Static items its turn added first (Screen.above runs the turn's queued effects before writing), so the screen reads in the program's order. The runner drops its one-tick delay before the ending.
  • A mount closed by quit draws its last frame, as run does; a close() by hand still draws nothing. The runner's tests drop their view.frame() before a quit.
  • mount App, colors: 0, 16, 256 or 16777216 sets the depth the painter downsamples to. test/live.rip holds the runner's strip, bars, card and scrollback to named colors at 16 and to no escape at 0.
  • The truncating row — one Text of styled runs with wrap: 'truncate' — is in the README's text section, pinned to render as the README says; the runner's rows are that pattern. No helper: it would be Text wrap: 'truncate' under another name.

bun run test:tui under a real pty through a full run: exit 0, "✓ All 29 lanes green · 12,699 tests · 76.0s", nothing left running. Suites: test 137, events 234, terminal 80, live 16, the rest unchanged. bun run test:all: 29 lanes, 12,699 tests.

@shreeve
shreeve merged commit f10db0d into main Sep 22, 2026
2 checks passed
@shreeve
shreeve deleted the tui/runner-needs branch September 22, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant