Refresh animated terminal titles without redrawing the TUI (#40618)

## Why

Terminal title animations only need to update the title, but each animation tick
previously requested a full TUI frame.

## What changed

- Track the next terminal title refresh deadline on `ChatWidget`.
- Have the foreground event loop refresh the title when that deadline expires.
- Clear the deadline when title animations are disabled or the configured title is
  empty.

## Testing

- Verify spinner and action-required animations set the expected refresh deadlines.
- Verify refreshing an animated title does not enqueue a TUI draw request.

GitOrigin-RevId: 269347cd48de4ad9ba9a0aef9ed105c25d1a7dae
This commit is contained in:
Tamir Duberstein authored and copyberry committed 2026-08-25 14:24:18 +00:00
1 parent ed42068c45
commit 6525b95dae
5 files changed
+56 -12

No files matched your search

+2
View File
@@ -740,6 +740,8 @@ pub(crate) struct ChatWidget {
terminal_title_setup_original_items: Option<Option<Vec<String>>>,
// Baseline instant used to animate spinner-prefixed title statuses.
terminal_title_animation_origin: Instant,
// The foreground loop refreshes the title at this deadline without drawing a frame.
pub(crate) terminal_title_next_refresh: Option<Instant>,
// Cached project-root display name keyed by cwd for status/title rendering.
status_line_project_root_name_cache: Option<CachedProjectRootName>,
// Cached git branch name for the status line (None if unknown).