Skip to content

fix(tui): skip unchanged footer redraws - #29

Merged
TaewoooPark merged 2 commits into
TaewoooPark:mainfrom
wooksong:fix/27-unchanged-footer-redraw
Sep 24, 2026
Merged

TaewoooPark merged 2 commits into
TaewoooPark:mainfrom
wooksong:fix/27-unchanged-footer-redraw

Conversation

@wooksong

Copy link
Copy Markdown
Contributor

Summary

  • Skip terminal writes when streaming leaves the rendered footer unchanged.
  • Avoid immediate redraws for repeated activity text while retaining the one-second activity tick.
  • Enclose changed footer paints and full redraws in synchronized output.
  • Add focused regression tests for hidden reasoning, activity updates, streamed replies, and transcript rebuild paths.

Testing

  • pnpm test (709 tests)
  • pnpm typecheck
  • pnpm build
  • pnpm lint:tools

Closes #27

Hidden reasoning and repeated activity strings no longer clear and redraw an
unchanged footer. Real footer updates, including transcript rebuild paths, are
fully enclosed in synchronized output so terminals do not show a blank frame.

Fixes TaewoooPark#27
@TaewoooPark

TaewoooPark commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Thanks again @wooksong for the focused fix! I tested the built CLI in a visible xterm.js terminal connected to a real macOS PTY, and found one resize case that needed a small follow-up. I've added commit 481247c to this branch.

Why the extra commit: after a long response settles with the composer at the bottom, resizing from 80×24 to 80×12 clips the lower composer border and status hint. At ccf79b4, the footer cache treats that display as unchanged and writes nothing; expanding back to 24 rows does not restore it either. The cache compared width/content/cursor, but terminal height can invalidate where those rows actually are.

The follow-up records the painted height and uses the existing full-screen rebuild path when height changes, both for the resize event and for a paint that happens before the debounced resize handler. Clearing relative to the old cursor position would not be sufficient after clipping. Unchanged-size hidden reasoning still produces no output, so the main benefit of your patch is preserved.

Validation: both added regression cases fail before this commit and pass afterward; all 711 tests, typecheck, build, and tool-schema lint pass locally. I also repeated 24→12→24 at 80 columns in the visible PTY-backed terminal and confirmed that the lower border, hint, and composer cursor remain correct. This used a local Motif-style SSE fixture, not a live model request. Remote CI for this exact commit also passed all five jobs (Node 20/22, Linux ARM64, Python, and goldens): https://github.com/TaewoooPark/Motifcode/actions/runs/35743315930.

Could you please review the follow-up commit and confirm that it looks good to you, ideally also trying the height-only resize in your terminal? I'll leave the PR open for your feedback before merging.

The other pre-existing findings are tracked separately in #30 (paste line endings), #31 (reasoning-toggle transcript duplication), and #32 (post-exit footer), with additional reproduction notes on #28. They are not bundled into this patch.

@wooksong

Copy link
Copy Markdown
Contributor Author

Could you please review the follow-up commit and confirm that it looks good to you, ideally also trying the height-only resize in your terminal? I'll leave the PR open for your feedback before merging.

@TaewoooPark Reproduced on ccf79b4 in WSL xterm: 80×24 to 80×12 clips the lower composer border, and returning to 24 does not restore it. Windows Terminal did not clip it. LGTM.

@TaewoooPark

Copy link
Copy Markdown
Owner

Thanks @wooksong for the focused contribution and for checking the height-resize case in WSL xterm and Windows Terminal!

I rechecked 481247c against the original ccf79b4 in a visible xterm.js terminal backed by a real macOS PTY: after a settled response, 80×24 → 80×12 → 80×24 now preserves the composer border, hint, and cursor. The unchanged-footer optimization is preserved. The 66 related tests and typecheck passed again, and all five CI jobs passed on this exact head: https://github.com/TaewoooPark/Motifcode/actions/runs/35743315930.

No further change is needed for #27. Merging this PR as a squash commit now. The separate scrollback work remains tracked in #28 / #34; this merge does not include an npm release. Thank you again!

@TaewoooPark
TaewoooPark merged commit 1acde4f into TaewoooPark:main Sep 24, 2026
5 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.

Avoid unchanged TUI footer redraws during streaming

2 participants