warpui_core(tui): add ratatui-backed TUI presenter and runtime#12759
Draft
kevinyang372 wants to merge 2 commits into
Draft
warpui_core(tui): add ratatui-backed TUI presenter and runtime#12759kevinyang372 wants to merge 2 commits into
kevinyang372 wants to merge 2 commits into
Conversation
Member
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
1 task
410345a to
72f5550
Compare
9737943 to
2998c72
Compare
This was referenced Jun 18, 2026
Draft
Build the immediate-mode presenter and the draw + event runtime on top of the ratatui element layer, completing the in-core TUI backend behind the `tui` feature: - presenter::tui::TuiPresenter: measure -> arrange -> present -> paint into a ratatui Buffer, reporting child-view embeddings into the shared neutral view hierarchy. - runtime::TuiRuntime drives a TuiView window: raw mode + alt screen via a RAII guard, invalidate -> redraw, crossterm input -> shared keymap then element-tree dispatch, draining deferred app updates / typed actions. - TuiFrameRenderer flushes via ratatui's Buffer::diff + CrosstermBackend instead of a hand-rolled diff; crossterm comes from ratatui::crossterm. - event_conversion maps crossterm 0.29 input to the shared Event vocabulary. - Re-export Color/Modifier from elements::tui so consumers can style text without depending on ratatui directly. - tests/tui_integration.rs: end-to-end model -> view -> presenter -> typed action flow against the shared core.
2998c72 to
fa13e01
Compare
72f5550 to
6947675
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Add the ratatui-backed TUI presenter and runtime on top of the element layer, completing the in-core TUI rendering backend behind the
tuifeature. Stacked on #12758.What changed:
presenter::tui::TuiPresenter— immediate-mode measure → arrange → present → paint into a ratatuiBuffer, reporting child-view embeddings into the shared neutral view hierarchy.runtime::TuiRuntime— drives aTuiViewwindow: raw-mode + alternate-screen RAII guard, invalidate → redraw, crossterm input → shared keymap then element-tree dispatch, and draining of deferred app updates / typed actions.TuiFrameRendererflushes via ratatui'sBuffer::diff+CrosstermBackend(no hand-rolled diff); crossterm comes fromratatui::crossterm.event_conversionmaps crossterm 0.29 input to the sharedEventvocabulary (identical dispatch to the GUI).Color/Modifierfromelements::tuiso consumers can style text without depending on ratatui directly.examples/tui_demo.rs) for manual validation.Linked Issue
No linked issue — internal, WIP infrastructure gated behind the
tuifeature (not user-visible).Testing
cargo nextest run -p warpui_core --features tui— 360 pass, including the end-to-endtui_integrationtest (model → view → presenter → typed-action dispatch) plus renderer / runtime / event-conversion unit tests.cargo test -p warpui_core --features tui --doc— pass; default build and clippy (both default and--features tui) clean;./script/formatclean.cargo run -p warpui_core --example tui_demo --features tui— verified paragraph wrapping (resize to re-wrap), emoji / CJK / ZWJ column alignment, the buffer diff, vertical scrolling, and flicker-free resizing.Screenshots / Videos
Manual TUI smoke test is via the example above;
./script/runis not applicable here (it launches the GUI app, not the TUI backend).Agent Mode
Plan: https://staging.warp.dev/drive/notebook/RQNlhRWhQK3Djnr50YbC4G
Conversation: https://staging.warp.dev/conversation/9293e035-3939-42c7-aeee-110a5a131011
CHANGELOG-NONE