Repository navigation
feat(tui): blitz-tui, a Blitz document painted into a terminal's cells - #12
Merged
Merged
Conversation
…cells A sibling of blitz-paint and blitz-shell: Blitz's DOM, Stylo and taffy as they are, and the laid-out tree walked into cells instead of pixels. Text is read off each inline root's parley layout, a cell to a cluster; backgrounds fill the cells their centres cover; borders are box-drawing characters; an img is drawn through the terminal's graphics protocol (ratatui-image), from the image data Blitz loaded, an SVG data URL, or a host's decoder. input turns crossterm's keys and mouse into Blitz's events, and run drives any Document with them. Moved from leaf's terminal editor prototype (apps/leaf-dioxus-tui), with its leaf-specific parts made options: caret boxes by class, a click's sideways shift, a picture decoder. A horizontal border now takes the row boundary nearest it, so a box whose bottom edge falls just into a row still gets its bottom side.
…rkspace parses on Rust 1.91
adammharris
marked this pull request as ready for review
October 22, 2026 02:56
adammharris
added a commit
to diaryx-org/leaf
that referenced
this pull request
Oct 22, 2026
…tui has merged diaryx-org/blitz#12 merged the tui branch into leaf, so the prototype takes every Blitz crate from leaf, as apps/leaf-dioxus does. The proposal marks decision 6 as settled, apart from offering blitz-tui upstream.
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.
A new package,
packages/blitz-tui, beside blitz-paint and blitz-shell. Blitz's DOM, Stylo and taffy work exactly as they do for a window. Only the last step changes: the laid-out tree is walked into character cells instead of pixels.paint). Text comes from each inline root's parley layout, one cell per cluster. A background fills the cells whose centres it covers. A border is drawn in box-drawing characters. An app's own caret box, named by class, becomes the terminal's cursor.data:URL, or a decoder the host supplies.run. Drives anyblitz_dom::Document.TermWindow(behind thewinitfeature), for apps that ask their window for its size and theme.examples/tui_counteris the Dioxus counter running through it. Its tests click the buttons and send keys to a focused element, all headlessly.The package was moved from leaf's terminal editor prototype (diaryx-org/leaf#20), which now depends on this branch.
The package's README lists what it does not draw yet:
<input>text,::marker, outlines, shadows, gradients, transforms and scrollbars.Checked locally on macOS:
cargo fmt --all --checkcargo clippy --workspace -- -D warnings-D warningson the new packages with all their targetscargo doc -p blitz-tuicargo checkforaarch64-apple-iosNot run locally: Windows, Linux and Android. The tests expect a monospace system font.