Fix transcript render retention for long TUI sessions#4841
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 044d0863ad
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (segment === undefined) continue; | ||
| segment.startRow -= dropRows; | ||
| } | ||
| this.#compactedChildStart = dropUntil; |
There was a problem hiding this comment.
Preserve compacted transcript rows for full repaints
When this advances #compactedChildStart, subsequent render() calls start walking children from that index, so the compacted prefix is no longer available in the rendered frame. That only works while the terminal's native scrollback still contains those rows; on a non-multiplexer resize settle the TUI explicitly requests a full repaint that clears scrollback (packages/tui/src/tui.ts:3295), and reset-display paths do the same, but the transcript can now replay only the retained tail. After a long session has compacted history, any such resize/reset permanently drops the compacted transcript rows from the terminal history instead of re-emitting the full transcript.
Useful? React with 👍 / 👎.
|
I built on this approach in #5239 and kept the original attribution. The replacement adds a |
Summary
Fixes #4820.
Tests
bun test packages/coding-agent/test/modes/components/transcript-container.test.ts packages/tui/test/markdown.test.tsbun run checkinpackages/coding-agentbun run checkinpackages/tui