Make transcript list spacing uniform after streaming (#46899)

## Why

Adding blank lines only after multiline items gives lists uneven spacing. Completed lists in redrawable transcript views can use consistent spacing based on their rendered width.

## What changed

- Keep assistant and plan lists compact while streaming in the fullscreen transcript, without holding back completed list rows.
- On completion or interruption, separate all sibling items if any item spans multiple rows; keep single-line lists compact and recompute spacing on resize.
- Preserve the reader's displayed content when consolidating streamed cells, and include spacing policy in the Markdown render cache key.
- Retain existing list spacing for native terminal scrollback.

## Testing

Add regression and snapshot coverage for streaming completion and interruption, width-dependent reflow, reader position, nested and quoted lists, item paragraphs, and preservation of links and source metadata.

GitOrigin-RevId: b2230aaf76ae798ebb6bf15563f8b8dcb6f3d19d
This commit is contained in:
Felipe Coury
2026-09-20 22:55:19 +00:00
committed by copyberry
parent d99213289f
commit 4ca8e7afff
25 changed files with 789 additions and 68 deletions
+6 -2
View File
@@ -798,12 +798,16 @@ impl App {
if start < end {
self.native_history.consolidate(&self.transcript_cells[start..end], &consolidated);
self.transcript_view.replace_range(&self.transcript_cells, start..end, &consolidated);
if tui.is_owned_screen() {
self.transcript_view.replace_group(&self.transcript_cells, start..end, &consolidated);
} else {
self.transcript_view.replace_range(&self.transcript_cells, start..end, &consolidated);
}
self.transcript_cells
.splice(start..end, std::iter::once(consolidated.clone()));
if let Some(Overlay::Transcript(t)) = &mut self.overlay {
t.consolidate_cells(start..end, consolidated.clone());
t.regroup_cells(start..end, consolidated.clone());
tui.frame_requester().schedule_frame();
}