add generalized virtualized viewport element#13177
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
40dbb8a to
f2ab35d
Compare
|
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 adds a generalized TUI virtualized viewport stack, including clipping, wheel-scroll wrapping, mouse event conversion, a demo harness, tests, and an accompanying technical spec. I reviewed the attached annotated diff, PR description, and spec context; no approved repository spec context was available for implementation matching.
Concerns
- No blocking correctness, security, error-handling, or performance concerns found in the changed diff.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
707ebfa to
d914567
Compare
Adds a content-agnostic TUI viewport stack (TuiViewportedList, TuiViewportIndex/Cursor, TuiScrollable, TuiText vertical scroll, and mouse-wheel event conversion) plus an interactive warpui_core example (tui_viewport_demo) that exercises every component over a simple in-memory text-block index. No terminal/AI coupling. Co-Authored-By: Oz <oz-agent@warp.dev>
a2a99b5 to
9547813
Compare
d49da1b to
99c98bf
Compare
## Description
<!-- Please remember to add your design buddy onto the PR for review, if
it contains any UI changes! -->
This PR adds a generalized viewport element that takes caller-owned
ordered-height index/cursor, and handles rendering only the visible rows
in an efficient way (and keeping scroll position stable through
resizes). This viewport will serve as the backing element to render the
blocklist, without being blocklist-specific (any other caller could
provide a sum tree and set of items and get the same efficient rendering
for free). This PR also adds some smaller helpers to allow for
generalized item clipping and scrollable behavior, and handling for
scroll mouse events.
The big things to read in this PR are:
* crates/warpui_core/src/elements/tui/viewported_list.rs
* New generic virtualized list / viewport.
* crates/warpui_core/src/elements/tui/scrollable.rs
* New wheel-scroll wrapper.
* crates/warpui_core/src/elements/tui/clipped.rs
* New vertical row clipping wrapper.
* crates/warpui_core/src/runtime/event_conversion.rs
* Adds crossterm mouse/wheel conversion into Warp’s shared Event.
* crates/warpui_core/src/elements/tui/event.rs
* Changes TUI event context from queued “app updates” to view
notifications.
* crates/warpui_core/examples/tui_viewport_demo.rs
* Manual harness demonstrating the pieces together.
## Testing
<!--
How did you test this change? What automated tests did you add? If you
didn't add any new tests, what's your justification for not adding any?
Manual testing is required for changes that can be manually tested, and
almost all changes can be manually tested. If your change can be
manually tested, please include screenshots or a screen recording that
show it working end to end.
You can run the app locally using `./script/run` - see AGENTS.md for
more details on how to get set up.
-->
- [x] I have manually tested my changes locally with `./script/run`
### Screenshots / Videos
<!-- Attach screenshots or a short video demonstrating the change, where
appropriate. Remove this section if it is not relevant to your PR. -->
Running the demo added in this PR:
https://www.loom.com/share/dd626bbe4c2e470da975b44c5d80ab15
## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode
---------
Co-authored-by: Oz <oz-agent@warp.dev>

Description
This PR adds a generalized viewport element that takes caller-owned ordered-height index/cursor, and handles rendering only the visible rows in an efficient way (and keeping scroll position stable through resizes). This viewport will serve as the backing element to render the blocklist, without being blocklist-specific (any other caller could provide a sum tree and set of items and get the same efficient rendering for free). This PR also adds some smaller helpers to allow for generalized item clipping and scrollable behavior, and handling for scroll mouse events.
The big things to read in this PR are:
Testing
./script/runScreenshots / Videos
Running the demo added in this PR:
https://www.loom.com/share/dd626bbe4c2e470da975b44c5d80ab15
Agent Mode