TUI: skip unchanged running-command height remeasurement - #14595
TUI: skip unchanged running-command height remeasurement#14595harryalbert wants to merge 1 commit into
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR narrows TUI agent-block height polling so expanded running command blocks are remeasured only when their terminal row extent changes, with supporting tests and a benchmark fixture.
Concerns
- This is a user-visible TUI behavior change, but the PR description does not include manual testing output or acceptable TUI evidence such as a terminal transcript, render-to-lines/TuiBuffer snapshot diff, or
./script/run-tuicapture demonstrating the running-command row-growth behavior end to end.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
b621986 to
c7ed842
Compare
061ca10 to
fbdaa82
Compare
Co-Authored-By: Oz <oz-agent@warp.dev>
fbdaa82 to
8e32733
Compare

Description
Adds a targeted follow-up for expanded shell commands that are still running inside Warp Agent CLI blocks. The downstack paint fix (#14594) bounds inline terminal rendering to visible rows, but the transcript viewport still remeasured the entire agent block on every layout while an expanded command was running—even when the terminal row extent had not changed. Generic streaming status also forced repeated measurement despite agent-output updates already dirtying their rich-content item directly.
This change records each running shell command's rendered height and displayed command/output row extents after layout. Stable-width viewport layouts now reuse the cached agent-block height while those extents are unchanged; new terminal rows, width changes, disclosure changes, and normal dirty invalidations still trigger measurement. The viewport collects candidate rich-content IDs while holding the terminal-model lock, then releases it before querying child views, avoiding nested terminal-model locking when reading live command geometry. Regression coverage verifies same-row terminal updates reuse the cached height, row growth remeasures, completion stops dynamic measurement, and ordinary agent-output updates continue refreshing canonical scroll extent.
Benchmark at 120×50 versus downstack PR #14594. The fixture invalidates only the transcript viewport—not the retained agent block—so it measures the unchanged-row relayout path affected by this PR:
Agent conversation: https://staging.warp.dev/conversation/963ead54-9843-4cc1-8d8b-dbf695ee7046
Linked Issue
N/A — Warp Agent CLI transcript rendering performance.
Testing
cargo nextest run -p warpui_core --features tui— 557 passed, 7 skipped.cargo nextest run -p warp_tui— 937 passed.cargo clippy -p warp_tui --features test-util --benches -- -D warningscargo bench -p warp_tui --features test-util --bench transcript_bench -- 'tui_transcript/running_agent_command/viewport_relayout_unchanged_frame'./script/formatI have manually tested my changes locally with
./script/run-tuiAgent Mode
CHANGELOG-NONE
Co-Authored-By: Oz oz-agent@warp.dev