TUI: clip inline terminal block painting - #14594
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 optimizes TUI inline terminal block painting by exposing a visible row window from TuiPaintSurface, clipping terminal block rendering to that window, and adding targeted regression coverage plus a benchmark.
Concerns
⚠️ [IMPORTANT] This is a user-facing TUI rendering/performance change, but the PR description only lists automated tests and a benchmark. Repo review guidance requires acceptable TUI visual evidence for user-visible changes: a terminal transcript, arender_to_lines/TuiBuffer::to_linessnapshot diff, or a./script/run-tuicapture. Please attach one of those demonstrating inline terminal block rendering 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
Co-Authored-By: Oz <oz-agent@warp.dev>
b621986 to
c7ed842
Compare

Description
Adds a targeted follow-up for expanded shell commands rendered inside Warp Agent CLI blocks. Top-level terminal blocks already receive a viewport-clipped row range, but inline
TerminalBlockRows::Contentpreviously walked every retained command/output row and column on each paint while the nested paint surface discarded offscreen writes.This change exposes the element-local visible row window from
TuiPaintSurface, intersects terminal block painting with that window, and translates the source-row and cursor origins before rendering. Inline command paint work is now proportional to the visible viewport rather than total retained output; the same intersection applies defensively to already-preclipped top-level terminal blocks. Regression coverage verifies nested clip coordinates and exact inline terminal row-window rendering.Benchmark at 120×50 with a fixed 50-row viewport versus stack PR 3:
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 -E 'test(visible_rows_are_relative_to_the_element_origin) | test(widget_renders_only_visible_rows) | test(nested_surface_clip_contains_cells_styles_and_widgets)'— 3 passed.cargo nextest run -p warp_tui -E 'test(terminal_block::tests)'— 10 passed.cargo bench -p warp_tui --features test-util --bench transcript_bench -- 'tui_terminal_block/clipped_content'./script/formatI have manually tested my changes locally with
./script/run-tuiAgent Mode
CHANGELOG-NONE
Co-Authored-By: Oz oz-agent@warp.dev