You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 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::Content`
previously 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:
- Expanded inline terminal content, 100 retained rows: 61.6 → 30.9
µs/frame (50% faster, 2.0×).
- Expanded inline terminal content, 1,000 retained rows: 123.8 → 36.1
µs/frame (71% faster, 3.4×).
- Baseline paint cost doubles from 100 to 1,000 retained rows; the
clipped implementation remains close to the fixed viewport cost.
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/format`
- [x] I have manually tested my changes locally with `./script/run-tui`
## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode
CHANGELOG-NONE
Co-Authored-By: Oz <oz-agent@warp.dev>
---------
Co-authored-by: Oz <oz-agent@warp.dev>
0 commit comments