I am happy to announce the release of ratatui_ruby v0.6.0.
This release brings rich text support, comprehensive keyboard handling,
and stateful rendering. You can now style individual characters. You can
respond to any key the user presses. You can read scroll positions back
from widgets.
What is new:
* **Rich Text Support.**
List, Gauge, LineGauge, and BarChart now accept Text::Span and
Text::Line objects. Style individual characters. Mix colors in a
single label. The new ListItem wrapper applies row-level styles
independent of text content.
* **Non-Blocking Events.**
`poll_event` accepts a `timeout:` parameter (Float seconds). Use
`timeout: 0.0` for non-blocking checks. Use `timeout: 0.1` for fixed
timesteps. The default remains 0.016 (16ms).
* **Cursor and Text Measurement.**
`frame.set_cursor_position(x, y)` places the hardware cursor.
`RatatuiRuby::Text.width(string)` calculates display width in terminal
cells. Both are essential for input fields and responsive layouts.
* **Stateful Rendering.**
`frame.render_stateful_widget(widget, area, state)` renders with
persistent state objects. Read scroll offsets back. Track selection
across frames. State properties override widget properties.
* **Complete Keyboard Support.**
All crossterm keys now work: function keys, navigation, media
controls, modifier keys. Key categories (standard, function, media,
modifier, system) enable clean event routing. Smart predicates like
`pause?` match both system and media variants. Platform aliases work:
`command?` (macOS), `win?` (Windows), `tux?` (Linux).
* **Indexed Colors.**
Style now accepts Integer values for fg and bg (0-255). Access the
full Xterm 256-color palette. Includes standard ANSI, the 6x6x6 cube,
and the grayscale ramp.
* **Rich Testing.**
`assert_rich_snapshot` validates content and styling against ANSI
snapshots. Semantic assertions like `assert_bold` and `assert_red`
verify cell attributes. `print_buffer` outputs terminal state with
ANSI colors for debugging.
Breaking changes:
- Events and Cell objects are now deeply frozen for Ractor
compatibility. Copy before mutating.
- Replaced RuntimeError with RatatuiRuby::Error::Terminal and
RatatuiRuby::Error::Safety for finer-grained error handling.
- Media key codes now use consistent `media_` prefix (`play` becomes
`media_play`). Use smart predicates for compatibility.
- `Key#char` returns `nil` for non-printable keys instead of empty
string.
Read the full changelog:
https://git.sr.ht/~kerrick/ratatui_ruby/tree/v0.6.0/item/CHANGELOG.md
Gem: https://rubygems.org/gems/ratatui_ruby
Source: https://git.sr.ht/~kerrick/ratatui_ruby