Expand description
§Widget Fragments (experimental_)
Mechanism for plugins to inject UI fragments into existing TUI widgets.
§Stability
Experimental as of SDK 0.3. Promote to stable after progit-pr-stacker
v0.1 ships and exercises the API in production.
§Design constraints
- Trait Firewall. Fragments produce typed
RenderFragmentdata; the TUI does the actual drawing. Nocrossterm::Printfrom plugins. - Bounded slot set. Each widget exposes a finite set of named slots
(see
FRAGMENT_SLOT_REGISTRY). Plugins register against existing slots, they do NOT invent new ones. - Bounded performance. Fragments rendering on every frame must be
fast (< 1 ms). Slower fragments declare themselves async-friendly via
RenderFragment::ready = false; the TUI shows a placeholder until ready. - Conflict resolution. If two plugins claim the same slot, higher
prioritywins; ties broken lexicographically; conflicts logged once.
Structs§
- Fragment
Action - A user-actionable hotkey scoped to a fragment.
- Fragment
Context - Context the host passes to the plugin when asking it to render a fragment.
- Render
Fragment - What the plugin returns.
Constants§
- FRAGMENT_
SLOT_ REGISTRY - Registry of all valid slot identifiers in SDK 0.3.
Traits§
- Fragment
Renderer - Trait plugins implement.
Functions§
- slot_
is_ valid - Validate that a fragment slot is recognized.
Type Aliases§
- Fragment
Slot - Slot identifier —
<widget_name>.<slot_name>(e.g."mr_detail.stack_panel").