Skip to main content

Module progress

Module progress 

Source
Expand description

Live step-progress UI.

A step engine emits ProgressEvents through a ProgressSink (cheap to clone, a no-op when no renderer is attached). A renderer thread consumes them and draws one of: a full-screen split dashboard (RenderMode::Fullscreen), an inline sticky block on stderr (RenderMode::Rich), or clean line transitions (RenderMode::Plain). The durable log keeps flowing to the tool’s own subscriber; this UI is purely additive operator feedback.

Mode is chosen from stderr (where the inline UI renders) plus the environment, so it behaves correctly under curl … | sudo bash (stdin is a pipe, stderr is the operator’s terminal) and degrades to plain text in CI / piped / TERM=dumb contexts.

Re-exports§

pub use events::group_index_for_step;
pub use events::GroupMap;
pub use events::ProgressEvent;
pub use events::ProgressSpec;
pub use events::SummaryView;

Modules§

events
Progress events, the step→group map, and the per-flow wording.
export
Terminal-UI asset export: turn a real composed grid (from crate::frame::compose or crate::progress::fullscreen::sample_grid) into standalone SVG and HTML assets for documentation. Because it consumes the same styled grid the live terminal renders, the asset IS the real UI.
fullscreen
The full-screen progress renderer.
model
The renderer’s view model: the checklist groups and their live state.
plain
The plain renderer: one escape-free line per group transition.
rich
The rich renderer: a live, pinned status block with logs scrolling above it.

Structs§

ChannelLayer
A tracing layer that forwards each log line to the renderer (when a log-forwarding renderer is attached). Add it alongside the tool’s durable log layer so that log keeps the full record regardless.
ModeFlags
The output flags a tool’s command line carries.
ProgressSink
A cheap, clonable handle the step engine emits events through. A sink with no channel (the default, or RenderMode::Json) silently drops events.
RenderHandle
Owns the renderer thread; RenderHandle::finish joins it (call after sending ProgressSink::summary + ProgressSink::finish).

Enums§

RenderMode
Which renderer to drive, decided once at startup.

Functions§

detect_mode
Decide the render mode from the flags + environment. Gates on stderr because that is where the inline UI draws.
resolve_live_mode
Resolve the live render mode + terminal, upgrading Rich to Fullscreen when a terminal can be opened. carried is a still-open Tty (a wizard → progress handoff keeps one alternate-screen session); when it is None but the base mode is Rich, open is tried (pass Tty::open_controlling or Tty::open_stdio). Plain / Quiet / Json drop any carried Tty (leaving the alternate screen) and keep the base renderer.
start
Create the progress sink + spawn the renderer thread for mode. header is the one-line banner the renderer prints first. tty is the terminal for Fullscreen (from resolve_live_mode); the other modes ignore it (it is dropped, leaving the alternate screen if one was carried). interactive holds a non-failed closing card full-screen until a key press.