Avoid redundant TUI redraws while streaming (#34049)

## What changed

- Redraw assistant and plan stream tails only when a completed line changes the visible tail.
- Cache the first reasoning header and update the status indicator only when its visible state changes, while restoring the cached header if the indicator is recreated.
- Keep regular commit ticks able to clear stale stream tails.

## Testing

- Add coverage for unchanged partial deltas, changed newline-delimited tails, reasoning-header redraws, recreated status indicators, stale plan tails, and history-line draw scheduling.

GitOrigin-RevId: 9016175f97ef2db2edc2fd5ba13a4d731dc2d98c
This commit is contained in:
Charlie Marsh authored and copyberry committed 2026-07-18 18:19:39 +00:00
1 parent 028edf8c1e
commit 35eaf3ffb0
18 files changed
+359 -44

No files matched your search

+2 -2
View File
@@ -438,8 +438,8 @@ impl HistoryCell for AgentMarkdownCell {
///
/// During streaming, lines that have not yet been committed to scrollback because they belong to
/// an in-progress table are displayed via this cell in the `active_cell` slot. It is replaced on
/// every delta and cleared when the stream finalizes.
#[derive(Debug)]
/// deltas that change the visible tail and cleared when the stream finalizes.
#[derive(Debug, Eq, PartialEq)]
pub(crate) struct StreamingAgentTailCell {
lines: Vec<HyperlinkLine>,
is_first_line: bool,
+1 -1
View File
@@ -7,7 +7,7 @@ use super::*;
/// The controller prepares the full styled plan lines because plan tails need the same header,
/// padding, and background treatment as committed `ProposedPlanStreamCell`s while remaining
/// preview-only during streaming.
#[derive(Debug)]
#[derive(Debug, Eq, PartialEq)]
pub(crate) struct StreamingPlanTailCell {
lines: Vec<HyperlinkLine>,
is_stream_continuation: bool,