exlab_wizard.ui.components.session_progress#

Wizard session-progress bar (Frontend Spec §10.1, §9.3).

Drives a phase indicator on the wizard’s Confirm & Create step from the Backend §4.6.2 progress WebSocket event. The phase enum is fixed by Backend §4.7; the labels come from Frontend §10.1.

When the active phase is running_plugins and the event carries current/total, a sub-row is rendered per Frontend §9.3.

Functions

apply_frame(state, frame)

Fold one controller WS frame into state in place.

compute_phase_rows(*, active_phase[, completed])

Return one PhaseRow per phase, in canonical order.

session_progress(*, active_phase[, ...])

Build the progress bar for the Confirm & Create step.

Classes

PhaseRow(phase, label, fraction, is_active, ...)

One renderable row in the session-progress component.

SessionProgressState([active_phase, ...])

Mutable phase/sub-progress state folded from controller WS frames.

class exlab_wizard.ui.components.session_progress.PhaseRow(phase, label, fraction, is_active, is_done)[source]#

Bases: object

One renderable row in the session-progress component.

Parameters:
fraction: float#
is_active: bool#
is_done: bool#
label: str#
phase: str#
class exlab_wizard.ui.components.session_progress.SessionProgressState(active_phase=None, completed=<factory>, plugin_current=None, plugin_total=None, plugin_name=None)[source]#

Bases: object

Mutable phase/sub-progress state folded from controller WS frames.

The wizard’s Confirm & Create step renders session_progress() from this object inside a @ui.refreshable and re-renders it as the creation pipeline publishes frames over CreationController.subscribe().

Parameters:
active_phase: str | None = None#
completed: list[str]#
plugin_current: int | None = None#
plugin_name: str | None = None#
plugin_total: int | None = None#
exlab_wizard.ui.components.session_progress.apply_frame(state, frame)[source]#

Fold one controller WS frame into state in place.

Returns True when the visible progress changed (the caller should re-render). Recognises phase and progress frames plus the terminal done; failed and input_required are left to the caller (the wizard surfaces those out-of-band).

Parameters:
Return type:

bool

exlab_wizard.ui.components.session_progress.compute_phase_rows(*, active_phase, completed=())[source]#

Return one PhaseRow per phase, in canonical order.

A phase is done when it appears in completed; active when it matches active_phase; pending otherwise.

The fractional value is 1.0 for done, 0.5 for active (a soft visual cue while the indeterminate sub-progress fills in), 0.0 for pending.

Parameters:
Return type:

list[PhaseRow]

exlab_wizard.ui.components.session_progress.session_progress(*, active_phase, completed=(), plugin_current=None, plugin_total=None, plugin_name=None)[source]#

Build the progress bar for the Confirm & Create step.

The wizard reaches into this and re-renders it on every progress event; in tests we just call compute_phase_rows() and assert on the data shape.

Parameters:
Return type:

Any