feat(tui2): coalesce transcript scroll redraws (#8295)

Problem
- Mouse wheel events were scheduling a redraw on every event, which
could backlog and create lag during fast scrolling.

Solution
- Schedule transcript scroll redraws with a short delay (16ms) so the
frame requester coalesces bursts into fewer draws.

Why
- Smooths rapid wheel scrolling while keeping the UI responsive.

Testing
- Manual: Scrolled in iTerm and Ghostty; no lag observed.
- `cargo clippy --fix --all-features --tests --allow-dirty
--allow-no-vcs -p codex-tui2`
This commit is contained in:
Josh McKinney 2025-12-19 12:19:01 -08:00 committed by GitHub
parent e3d3445748
commit 1d4463ba81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -953,7 +953,9 @@ impl App {
self.transcript_scroll
.scrolled_by(delta_lines, &line_meta, visible_lines);
tui.frame_requester().schedule_frame();
// Delay redraws slightly so scroll bursts coalesce into a single frame.
tui.frame_requester()
.schedule_frame_in(Duration::from_millis(16));
}
/// Convert a `ToBottom` (auto-follow) scroll state into a fixed anchor at the current view.