Fix transcript viewer restoration and half-page scrolling (#43889)

## Why

Repeated alternate-screen entry can overwrite the saved inline viewport, and half-page scrolling can use a different height from the rendered transcript.

## What changed

- Make alternate-screen entry idempotent to preserve the inline viewport for restoration.
- Defer transcript reflow after raw output mode changes while an overlay is open, preserving queued history until the overlay closes.
- Use the last rendered content height for half-page scrolling, matching full-page scrolling.

## Testing

Add regression coverage for restoring the inline viewport and draft after closing the transcript with pending history and a raw output mode change, plus half-page scrolling when the rendered height differs from the terminal viewport.

GitOrigin-RevId: 30847df4b6383db26791ebda20470c9b169f9680
This commit is contained in:
Benjamin Carlsson authored and copyberry committed 2026-09-08 19:06:42 +00:00
1 parent 5a65fd87d8
commit 095da4b7e8
7 files changed
+150 -19

No files matched your search

@@ -0,0 +1,9 @@
---
source: tui/src/app/tests/transcript_composer.rs
expression: "buffer_text(crate::custom_terminal::test_support::last_rendered_buffer(&tui.terminal))"
---
› EDGE-DRAFT-MUST-SURVIVE
gpt-5.6-sol default · /tmp/project