I am happy to announce the release of ratatui_ruby v0.10.0.
This release brings professional debugging tools and static type checking to the library. It also standardizes the codebase on the Rust architecture.
What is new:
* **Debug Mode.**
Debug your TUI with confidence. `RR_DEBUG=1` enables backtraces. Rust errors now inspect the Ruby object that caused them. Remote debugging integrates with the `debug` gem.
* **Type Safety.**
Catch errors before you run. RBS signatures now cover the entire library. Use Steep to verify your code.
* **Fluent Tables.**
Define tables with integers. `widths: [10, 20]` works. Verbose constraints are optional. The API focuses on the data.
* **Duck-Typed Hash Inputs.**
Pass hashes directly. `tui.table(rows: ...)` now works like `tui.table(**hash)`. The method handles the splatting. You write terser code.
* **Geometry Primitives.**
`Rect` now converts to `Position` and `Size`. Constraints apply themselves (`constraint.call(100)`). `Rect#outer`, `Rect#resize`, and `Rect#centered` simplify geometry math.
* **Enhanced Layouts.**
Layouts now support `margin:` and `spacing:`. `Layout.split_with_spacers` returns content and spacers separately. Custom rendering of dividers is now trivial.
* **Rich Text Manipulation.**
Align lines with `.right_aligned` or `.centered`. Calculate display widths with `Span#width`. Patch styles onto existing text. The `Text` module is now a full powered string manipulation library.
* **Color Module.**
Create colors from Hex (`Color.from_u32`) or HSL (`Color.from_hsl`). Use the new `Style(underline_color: ...)` to separate text and underline colors.
* **Symbol Constants.**
Draw with precision. New constants for `Line`, `Block`, and `Shade` characters replace magic strings. Build custom components with standard symbols.
* **Canvas Interaction.**
Build interactive maps. `Canvas#get_point` converts mouse clicks to grid coordinates. Terse aliases like `circle()` and `map()` make drawing shapes natural.
* **List and Gauge Shortcuts.**
Build lists faster with `tui.item` (alias for `list_item`). Set gauges with integers using `percent: 50`.
* **Styling Precision.**
Strike out deleted items with `Row#strikethrough`. Reset inherited styles with `remove_modifiers: [:bold]`. Control every pixel.
* **Ruby Idioms.**
Aliases create programmer happiness. Use `Buffer[x, y]`. Call constraints with `constraint.(n)`. Use `rect.size` and `rect.position`. Write Ruby, not translated Rust.
* **State Navigation.**
Traverse your data. `TableState` now selects cells and columns. `List` knows its `len`. `Buffer` reveals its `content`. Tests can now inspect every cell.
Breaking changes:
- **Explicit Namespaces.**
Classes moved to `Widgets`, `Layout`, and `Text` modules. The `schema` directory is gone. Update your class references.
- **Strict Drawing.**
`tui.draw` mandates strict arguments. Provide a block or a tree, not neither or both.
- **Media Key Renaming.**
Keys are now `media_play`, `media_stop`, etc. This prevents collisions with standard keys.
- **Cell Modifiers.**
`Buffer::Cell#modifiers` returns Symbols (`[:bold]`) instead of Strings.
Migration guide: https://man.sr.ht/~kerrick/ratatui_ruby/history/migrations/v0_10_0.md
Full changelog: https://git.sr.ht/~kerrick/ratatui_ruby/tree/v0.10.0/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