I am happy to announce the release of ratatui_ruby v0.5.0.
This release brings the Frame API.
You now control exactly where widgets render.
Hit testing no longer requires duplicating layout logic.
What is new:
* **Frame API.**
`RatatuiRuby.draw { |frame| ... }` yields a Frame object.
Call `frame.render_widget(widget, rect)` to place widgets precisely.
Calculate layout once. Store the rects. Check clicks against them later.
The legacy `draw(tree)` API still works.
* **Mouse Injection.**
New test helpers simulate mouse input.
`inject_mouse` handles coordinates, buttons, and modifiers.
`inject_click`, `inject_right_click`, and `inject_drag` cover common cases.
* **Snapshot Testing.**
`assert_screen_matches` compares the terminal against golden files.
Store expected output. Detect visual regressions automatically.
* **Session Convenience Methods.**
Session now wraps `Layout.split`, `Constraint.percentage`, and other schema class methods.
Write `layout_split(...)` instead of `Layout.split(...)` inside `RatatuiRuby.run` blocks.
* **Event::None.**
`poll_event` returns `Event::None` when the queue is empty.
This null-object responds `false` to all event predicates.
Check `event.none?` or pattern-match on `type: :none`.
* **Example Viewer.**
Browse example source code directly in the documentation.
Every widget page links to runnable demos with syntax highlighting.
Breaking changes:
- `poll_event` returns `Event::None` instead of `nil` when no event is available. Update loops to check `!event.none?`.
Read the full changelog:
https://git.sr.ht/~kerrick/ratatui_ruby/tree/v0.5.0/item/CHANGELOG.md
Gem: https://rubygems.org/gems/ratatui_ruby
Source: https://git.sr.ht/~kerrick/ratatui_ruby