I am happy to announce the release of ratatui_ruby v0.10.2.
This release introduces experimental features through a new Labs system and adds
inline viewport support for TUIs that preserve terminal scrollback history. It
also expands the terminal API with dimension and cursor position accessors.
What is new:
* **Inline Viewport.**
Preserve terminal scrollback while running your TUI. Pass `viewport: :inline` to
`init_terminal` or `run` to occupy a fixed number of lines at the terminal
bottom. Specify `height:` to control the viewport size (default: 8 lines). The
TUI runs below scrollback history. Users retain access to previous terminal
output. Fullscreen viewports use the alternate screen as before.
* **Insert Before.**
Log to scrollback from a running inline TUI. Call `insert_before(height,
widget)` to insert content above the viewport into scrollback. Essential for
progress messages, status updates, or diagnostic output while your inline TUI
continues running. Only works with inline viewports. Raises `Error::Invariant`
in fullscreen mode.
* **Terminal Area Accessors.**
Query terminal and viewport dimensions with precision. `terminal_area` and
`get_terminal_size` return the full terminal backend size. `viewport_area` and
`get_viewport_area` return the current viewport rendering area (inline viewport
height or full terminal in fullscreen). Aliases include `terminal_size`,
`viewport_size`, `get_terminal_area`, and `get_viewport_size`. Build responsive
layouts that adapt to the rendering context.
* **Cursor Position Accessors.**
Control cursor placement programmatically. `cursor_position` and
`get_cursor_position` return the current cursor position as a `Layout::Position`
or `[x, y]` array. `cursor_position=` and `set_cursor_position` accept
`Layout::Position`, arrays, or separate x/y arguments. Build custom status bars,
input fields, or rendering effects that depend on precise cursor control.
* **Experimental Labs System.**
Opt into experimental features without risking production stability. Set
`RR_LABS=A11Y` or call `Labs.enable!(:a11y)` to activate specific labs. Check
feature status with `Labs.enabled?(:a11y)`. Labs shift and evolve between patch
releases.
* **A11Y Widget Tree Export (Lab).**
The widget tree serializes to XML at `Dir.tmpdir/ratatui_a11y.xml` every frame
when `RR_LABS=A11Y` is set. The XML captures semantic structure (`<Paragraph>`,
`<List>`, etc.) for screen readers and accessibility tools. Access
programmatically via `RatatuiRuby::Labs::A11y.dump_widget_tree(widget)` or
automatically through `RatatuiRuby.draw`.
* **Error::Internal Exception.**
This new exception class signals framework bugs. Report `Error::Internal` if
you encounter it. User errors raise different exception types.
Full changelog:
https://git.sr.ht/~kerrick/ratatui_ruby/tree/v0.10.2/item/CHANGELOG.md
Gem: https://rubygems.org/gems/ratatui_ruby
Source: https://git.sr.ht/~kerrick/ratatui_ruby
Wiki: https://man.sr.ht/~kerrick/ratatui_ruby