exlab_wizard.ui.pages.wizard_run#

New Run Wizard (Frontend Spec §5).

Six-step wizard with mode bound at construction (experimental vs test). The mode is a single flag and cannot be changed mid-session; a misclicked mode is resolved by closing and reopening the wizard.

Steps:

  1. Project + Equipment.

  2. Template Selection (filtered by _exlab_run_scope).

  3. Variable Form.

  4. README Form.

  5. Preview (validator gate).

  6. Confirm & Create.

Functions

can_advance(state)

Return True when the active step's preconditions hold.

preview_path_segments(state, *, run_date)

Compute the destination-path segments for the Preview step.

primary_button_color(state)

Primary button color hint per Frontend §5.3.

primary_button_label(state)

Primary button label on the Confirm & Create step (Frontend §5.2).

render_run_wizard(*, state[, templates, ...])

Render the six-step run wizard.

title_text(state)

Title-bar text per Frontend §5.1.

Classes

RunWizardState(run_kind[, active_step, ...])

Mutable state for the in-flight run wizard.

class exlab_wizard.ui.pages.wizard_run.RunWizardState(run_kind, active_step='project_equipment', selected_project_name=None, selected_equipment=None, selected_template=None, selected_template_path=None, template_variables=<factory>, readme_fields=<factory>, validator_findings=<factory>, progress=<factory>, progress_refresh=None)[source]#

Bases: object

Mutable state for the in-flight run wizard.

Parameters:
active_step: str = 'project_equipment'#
progress: SessionProgressState#
progress_refresh: Callable[[...], Any] | None = None#
readme_fields: dict[str, str]#
run_kind: RunKind#
selected_equipment: str | None = None#
selected_project_name: str | None = None#
selected_template: str | None = None#
selected_template_path: Path | None = None#
template_variables: dict[str, Any]#
validator_findings: list[dict[str, Any]]#
exlab_wizard.ui.pages.wizard_run.can_advance(state)[source]#

Return True when the active step’s preconditions hold.

Parameters:

state (RunWizardState)

Return type:

bool

exlab_wizard.ui.pages.wizard_run.preview_path_segments(state, *, run_date)[source]#

Compute the destination-path segments for the Preview step.

Test runs put the run inside a TestRuns/ folder with a TestRun_ leaf prefix that is highlighted in warning-tier color.

Parameters:
Return type:

dict[str, Any]

exlab_wizard.ui.pages.wizard_run.primary_button_color(state)[source]#

Primary button color hint per Frontend §5.3.

Parameters:

state (RunWizardState)

Return type:

str

exlab_wizard.ui.pages.wizard_run.primary_button_label(state)[source]#

Primary button label on the Confirm & Create step (Frontend §5.2).

Parameters:

state (RunWizardState)

Return type:

str

exlab_wizard.ui.pages.wizard_run.render_run_wizard(*, state, templates=None, equipment_ids=None, template_questions=None, template_paths=None, on_resolve=None, on_submit=None, on_cancel=None)[source]#

Render the six-step run wizard.

templates lists run-scope template names appropriate to the run kind; equipment_ids is the configured equipment list; template_questions maps each template name to its parsed copier.yml questions (drives the dynamic Variables step); template_paths maps each template name to the absolute path of the resolved source. Each step binds real inputs into state so the confirm step’s on_submit sees a fully-populated RunWizardState.

on_resolve enables per-instance template resolution: when supplied, the template step re-resolves the offered templates from the operator’s current project + equipment selection (step 1 precedes the template step, so both are known). It is called with (equipment_id, project_name) and returns a TemplateChoices of the names / questions / absolute paths for that context, so a per-project or per-equipment run template shadows a same-named global one. When on_resolve is None the static templates list is used unchanged (the pre-resolver behaviour).

Parameters:
Return type:

Any

exlab_wizard.ui.pages.wizard_run.title_text(state)[source]#

Title-bar text per Frontend §5.1.

Parameters:

state (RunWizardState)

Return type:

str