Skip to main content

Crate termwright_probe_ratatui

Crate termwright_probe_ratatui 

Source
Expand description

What a patched ratatui-core calls, and what it is allowed to claim.

Ratatui is immediate mode. There is no retained tree, no widget that outlives the call that drew it, and no record of which widget owns which cell. The Phase 0 audit (docs/architecture/audit/ratatui.md) settled what follows from that, and this crate is written to respect it rather than to paper over it:

  • Identity is frame-local by default. Widget::render takes self by value, so the widget is consumed by the call and nothing survives to be named again. Ordinals within a frame are honest; a custom widget may opt into an explicit author-owned semantic key, but the probe never invents one for ordinary widgets.
  • area is intent, not ownership. A later write silently wins and nothing records that it happened, so the rectangle a widget was drawn into is not the cells it ended up with. It is reported as the intended rectangle and never as a visible one.
  • Paint order is unavailable, so the snapshot reports pointer hit-grid support as unavailable. Intended geometry is never promoted to pointer ownership.

The crate is deliberately small. It is a hook, a buffer of what one frame contained, and the protocol client — everything that needs std, kept out of the no_std crate that calls it.

Modules§

launch
Everything a build needs to compile against the instrumented framework.
patchset
Turning a pristine ratatui-core into the instrumented copy, reproducibly.
session
Publishing one instrumented Ratatui application’s frames.
tree
Turning one frame’s intercepted calls into a semantic tree.

Structs§

AnnotatedRenderGuard
RAII boundary for one authoritative Annotated<W> render call.
Annotation
Author intent attached to one immediate-mode render call.
Collection
What a collection widget reported about its own contents.
FrameBuffer
What the probe collected for the frame currently being drawn.
FrameGuard
Owns one synchronous Ratatui render context on the current thread.
RenderCall
One render_widget call, as the patched crate reported it.

Enums§

Action
A descriptive capability hint: a diagnostic, never a callback endpoint.
Role
A semantic role. ARIA-aligned and closed: unknown roles fail validation.

Constants§

MAX_ITEMS
How many items of a collection the probe will carry per frame.

Functions§

active
Whether the probe is collecting. For tests and diagnostics.
begin_annotated_render
Begin an annotated render, including direct Widget::render calls.
begin_frame
Begin one certified Terminal::try_draw lifecycle.
frame_guard_active
Whether the current thread is inside the certified full-frame lifecycle.
on_collection
Called by a patched ratatui-widgets once a collection has rendered.
on_render
Called by the patched ratatui-core for every Frame::render_widget.
probe_info
What this probe tells the driver it can observe.
take_frame
Take the frame’s calls and reset the buffer for the next one.