Expand description
Author intent for custom Ratatui widgets, without replacing their render.
Annotated implements Ratatui’s ordinary Widget and
StatefulWidget traits and delegates to the wrapped widget exactly once.
The zero-config build probe still owns geometry, frame boundaries,
collection state and occlusion. This crate can add role, name, description,
test id, application-domain JSON, descriptive actions, relationships and an
explicit stable semantic key.
use ratatui::{buffer::Buffer, layout::Rect, widgets::Widget};
use termwright_ratatui::{Action, Annotate, Role, Semantics};
struct Deploy;
impl Widget for Deploy {
fn render(self, area: Rect, buffer: &mut Buffer) {
"Deploy".render(area, buffer);
}
}
let widget = Deploy.annotated(
Semantics::new()
.role(Role::Button)
.name("Deploy")
.test_id("deploy-release")
.semantic_key("deployment-control")
.action(Action::Activate)
.domain("deploymentStatus", "ready"),
);
widget.render(area, &mut buffer);Macros§
- json
- Construct a
serde_json::Valuefrom a JSON literal.
Structs§
- Annotated
- A widget paired with author intent.
- Evidence
Context - Immutable coordinates identifying the provider observation being requested.
- Evidence
Registration - Handle whose disposal marks a negotiated provider as lost.
- Pointer
Evidence Observation - Exact production pointer-router facts returned for one revision.
- Provider
Pointer Region - Pointer-only application region; never layout or clipping geometry.
- Provider
Pointer Span - One canonical half-open pointer row run.
- Provider
Rect - Zero-based viewport cell rectangle.
- Semantics
- Author intent attached to one immediate-mode render call.
Enums§
- Action
- A descriptive capability hint: a diagnostic, never a callback endpoint.
- Evidence
Method - Method used to produce a known observation.
- Role
- A semantic role. ARIA-aligned and closed: unknown roles fail validation.
- Value
- Represents any valid JSON value.
Constants§
- RATATUI_
VERSION - Exact Ratatui release whose traits this SDK implements.
Traits§
- Annotate
- Extension trait for idiomatic
widget.annotated(semantics)construction. - Pointer
Evidence Provider - Closed application provider family for production pointer evidence.
Functions§
- register_
pointer_ evidence_ provider - Register a production evidence provider in the process-wide registry.
Type Aliases§
- Pointer
HitTest - Thread-safe production pointer hit-test in
(column, row)order.