Remeasure dynamic cells in the transcript overlay (#34232)

## Why

The transcript overlay cached every committed cell's height. Cells whose content changes after insertion, such as refreshed status output or newly available visualizations, could outgrow that cached height and be clipped.

## What changed

- Let history cells declare whether their transcript height is stable, and remeasure dynamic cells on later overlay renders.
- Preserve cached heights for stable cells when appending a committed cell instead of rebuilding all renderables.

## Testing

- Cover status output growing after a rate-limit refresh.
- Cover a visualization link replacing its unavailable placeholder.
- Verify that appending a cell preserves cached measurements for stable cells.

GitOrigin-RevId: 03e7166cb94d7353c9b89bff8abb3b7ccb84a6bb
This commit is contained in:
Charlie Marsh authored and copyberry committed 2026-07-19 21:34:05 +00:00
1 parent 5a208c1fc3
commit a97ae65362
8 files changed
+385 -32

No files matched your search

+4
View File
@@ -162,4 +162,8 @@ impl HistoryCell for CompositeHistoryCell {
}
out
}
fn has_stable_transcript_height(&self) -> bool {
false
}
}
@@ -449,6 +449,10 @@ impl HistoryCell for AgentMarkdownCell {
fn raw_lines(&self) -> Vec<Line<'static>> {
raw_lines_from_source(&self.markdown_source)
}
fn has_stable_transcript_height(&self) -> bool {
self.rendered_lines.is_some()
}
}
#[cfg(test)]
+8
View File
@@ -279,6 +279,14 @@ pub(crate) trait HistoryCell: std::fmt::Debug + Send + Sync + Any {
.unwrap_or(0)
}
/// Whether the transcript height remains valid across later overlay renders.
///
/// Cells backed by external state should return `false` so the pager remeasures them before
/// rendering instead of reusing a height that may now clip their content.
fn has_stable_transcript_height(&self) -> bool {
true
}
fn is_stream_continuation(&self) -> bool {
false
}