Skip to content

fix(tui): coalesce resize bursts without dropping updates - #1038

Merged
iamtoruk merged 1 commit into
getagentseal:mainfrom
avs-io:fix/tui-resize-coalesce
Aug 19, 2026
Merged

fix(tui): coalesce resize bursts without dropping updates#1038
iamtoruk merged 1 commit into
getagentseal:mainfrom
avs-io:fix/tui-resize-coalesce

Conversation

@avs-io

@avs-io avs-io commented Aug 19, 2026

Copy link
Copy Markdown
Member

Problem

Terminal font zoom and window-resize bursts made the interactive dashboard repaint at intermediate widths. Draft #993 fixed the root cause (Ink has its own resize handler) but its write() interceptor could drop a mid-burst state update forever when net size was unchanged.

Root cause

CodeBurn listened on process.stdout resize and rerendered immediately with live columns/rows. A local debounce of that listener alone cannot stop Ink painting. #993 then swallowed BSU/ESU frames in write(); Ink still advanced lastOutput, so a settle that produced the same string wrote zero bytes.

Change

This replaces the closed #993 shape. It does not reopen that PR.

User impact

Zooming the font or dragging the window produces one settled reflow. Mid-burst content is not dropped. One transient old-width frame during a burst is accepted.

Preservation and out of scope

Testing

  • I have tested this locally against real data (not just unit tests)

  • Focused dashboard suites pass

  • Full npm test not re-run (TUI-only)

  • npx vitest run tests/dashboard-resize.test.ts tests/dashboard.test.ts: 67/67, including mid-burst no-net-size-change and identical-dim SIGWINCH + state update.

  • Local TUI launched from this worktree (npx tsx src/cli.ts report --refresh 0).

Fixes #977.

Hold Ink stdout columns/rows frozen during a SIGWINCH burst and emit
one settled resize, then rerender. Do not intercept writes, so a
mid-burst state update still paints even when net size is unchanged.

Fixes getagentseal#977.
@iamtoruk
iamtoruk merged commit cab937c into getagentseal:main Aug 19, 2026
9 checks passed
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.

TUI: terminal zoom/resize causes repeated full-screen redraws

2 participants