compose/cmd
Nicolas De Loof 9fc38cce0e refactor(display): rebuild the TTY progress renderer on a model/layout/screen split
The TTY renderer accumulated display-corruption fixes (truncation of
details, then progress sizes, then task ids; timer alignment; rune-based
measurement) that each patched one symptom of the same structural gap:
nothing guaranteed a rendered line fits the terminal, and once a line
wraps, cursor arithmetic desyncs and the block corrupts.

Replace it with three separable units:

- tty_model.go: pure event reducer with an injected clock, preserving
  first-parent-wins updates, monotonic progress and header counters
- tty_layout.go: pure (model, size, now) -> lines function; all widths
  are measured in terminal cells (go-runewidth, so CJK is correct) on
  plain text before coloring, and every line is clipped to the terminal
  width by construction, status text included
- tty_screen.go: diff-based repaint; unchanged rows are skipped,
  identical frames write nothing, a frame is a single Write; a shrinking
  terminal abandons the block instead of moving the cursor over reflowed
  rows

The writer coordinates them behind a mutex and stops the refresh
goroutine through context cancellation, so Done cannot block when the
operation context was cancelled first (Ctrl-C during pull). The spinner
frame is derived from the clock instead of advancing on every call, and
truncation can no longer split multi-byte runes. Visual output is
unchanged: the snapshot test reproduces the previous renderer's golden
output character for character.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2026-09-09 16:50:05 +02:00
..
cmdtrace feat(tracing): surface otel shutdown errors via --debug 2026-09-02 17:12:12 +02:00
compatibility modernize some code 2026-02-12 15:31:35 +01:00
compose refactor(display): rebuild the TTY progress renderer on a model/layout/screen split 2026-09-09 16:50:05 +02:00
display refactor(display): rebuild the TTY progress renderer on a model/layout/screen split 2026-09-09 16:50:05 +02:00
formatter feat(ps): add ENGINE column gated on label presence 2026-08-17 10:34:46 +02:00
prompt golangci-lint: use gci formatter instead of goimports 2025-12-01 12:21:50 +01:00
main.go feat: add Docker Desktop Logs view hints and navigation shortcut 2026-04-10 15:26:08 +02:00