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

+5 -2
View File
@@ -917,19 +917,22 @@ impl BottomPane {
/// Update the status indicator header (defaults to "Working") and details below it.
///
/// Passing `None` clears any existing details. No-ops if the status indicator is not active.
/// Passing `None` clears any existing details. Returns whether the active status indicator
/// was updated and requested a redraw.
pub(crate) fn update_status(
&mut self,
header: String,
details: Option<String>,
details_capitalization: StatusDetailsCapitalization,
details_max_lines: usize,
) {
) -> bool {
if let Some(status) = self.status.as_mut() {
status.update_header(header);
status.update_details(details, details_capitalization, details_max_lines.max(1));
self.request_redraw();
return true;
}
false
}
/// Show the transient "press again to quit" hint for `key`.