Skip to main content

Module experimental_fragments

Module experimental_fragments 

Source
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

  1. Trait Firewall. Fragments produce typed RenderFragment data; the TUI does the actual drawing. No crossterm::Print from plugins.
  2. 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.
  3. 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.
  4. Conflict resolution. If two plugins claim the same slot, higher priority wins; ties broken lexicographically; conflicts logged once.

Structs§

FragmentAction
A user-actionable hotkey scoped to a fragment.
FragmentContext
Context the host passes to the plugin when asking it to render a fragment.
RenderFragment
What the plugin returns.

Constants§

FRAGMENT_SLOT_REGISTRY
Registry of all valid slot identifiers in SDK 0.3.

Traits§

FragmentRenderer
Trait plugins implement.

Functions§

slot_is_valid
Validate that a fragment slot is recognized.

Type Aliases§

FragmentSlot
Slot identifier — <widget_name>.<slot_name> (e.g. "mr_detail.stack_panel").