Scratchpad crate for prototyping new ono components.
This is where new visual and behavioural ideas get tried out before they earn a spot in the shipped ono crate. It exists for one reason: low-friction iteration without dragging the public API along for the ride.
Not published to crates.io. Not part of ono's semver contract. Don't depend on it from outside this repo.
Requires Rust 1.85+ and just.
just experiments # list available experiments
just experiment <name> # run in forest (default theme)
just theme <name> <theme> # run in forest|retro|minimal|cyber
just all-themes # build every experiment with every theme enabledq, Esc, or Ctrl+C to exit. Requires a true-color terminal.
The raw alias cargo experiments <name> is the same as just experiment <name>.
- Create
src/bin/<name>.rs. One binary per prototype β keep them self-contained. - Use
Theme::parse_from_args()to read--theme. - Pull colors from
theme.palette(), behavior fromtheme.knobs(). No hardcoded hex. - Make it look right under forest first; verify retro + minimal + cyber don't crash with
just all-themes. - Don't add shared abstractions to
src/lib.rsunless every existing experiment needs them. The scratchpad earns its keep by staying lightweight β duplication beats premature factoring here.
Once an experiment proves its value visually and the API shape is clear:
- Draft a spec under
ono/specs/elements/<name>.tomlorono/specs/components/<name>.toml. - Hand-write the Ratatui source under
ono/src/elements/<name>.rsorono/src/components/<name>.rs. Use relative imports (super::super::theme::...) so the same.rsfile works both as a library module in theonocrate and as a vendored copy under a user'ssrc/ono/tree. Do notuse ono::...inside component files. - Use palette roles, never hex literals.
- Register the component in the catalog so
ono list/ono preview/ono addsee it. - Add rustdoc with a minimal usage example. The crate runs
#![warn(missing_docs)]. - Verify:
ono listshows it,ono preview <name>renders it,ono add <name>copies a clean file. - Add a
CHANGELOG.mdentry under the next version.
Leave the experiment binary in place after graduation β it's a useful regression check.
The shipped ono crate is bound by semver from v0.1.0 onward. Adding a palette role, renaming a builder, changing a default β those are breaking changes. The experiments crate has none of that overhead: try a thing, throw it away, try a different thing. By the time something graduates into ono/, the shape has settled.