exlab_wizard.ui.pages.wizard_equipment#
Add-Equipment wizard (GUI/Orchestrator Redesign §6).
Three-step wizard launched from the main-window toolbar:
Identity — equipment ID (validated against
^[A-Z][A-Z0-9_]*$) + label.Paths — NAS root (the equipment’s data dir is derived from the single app root, so it is not collected here).
Review & confirm — assembles a validated EquipmentConfig via the shared
build_equipment_config()and posts it throughPOST /config/equipment.
The sync-mode step is intentionally hidden: orchestrator / staging is
hidden at the UI layer (see
docs/superpowers/specs/2026-05-29-hide-orchestrator-staging-design.md),
so every equipment is created in nas mode (sync directly to NAS via
the single nas: remote). The dormant _render_sync_mode_step is
kept so re-listing it restores the step verbatim.
The render function is pure (state + callbacks); the actual NiceGUI mount layer wires the on-confirm callback to the config router.
Functions
|
Build the final EquipmentConfig from the wizard's state. |
|
Return True if the active step has the data it needs to advance. |
|
Render the self-contained Add-Equipment wizard. |
Classes
|
Mutable state for the in-flight Add-Equipment wizard. |
- class exlab_wizard.ui.pages.wizard_equipment.EquipmentWizardState(active_step='identity', equipment_id='', label='', nas_root='', sync_mode='nas', last_error=None, confirmed=False)[source]#
Bases:
objectMutable state for the in-flight Add-Equipment wizard.
- Parameters:
- exlab_wizard.ui.pages.wizard_equipment.assemble_equipment_config(state)[source]#
Build the final EquipmentConfig from the wizard’s state.
Raises a pydantic ValidationError if the state isn’t valid; the caller surfaces that to the operator.
- Parameters:
state (
EquipmentWizardState)- Return type:
- exlab_wizard.ui.pages.wizard_equipment.can_advance(state)[source]#
Return True if the active step has the data it needs to advance.
Pure function — surfaces the per-step gate so unit tests can assert the wizard’s progression without rendering NiceGUI.
- Parameters:
state (
EquipmentWizardState)- Return type:
- exlab_wizard.ui.pages.wizard_equipment.render_wizard_equipment(*, state=None, on_confirm=None, on_cancel=None)[source]#
Render the self-contained Add-Equipment wizard.
Next / Back navigation is handled inside the render: the step body and footer live in one
@ui.refreshableso advancing mutatesstate.active_stepand re-renders in place. The wizard therefore keeps a singleEquipmentWizardStatefor its whole lifetime – the caller creates it once and never round-trips through a page navigation that would reset it. Onlyon_confirm(post the assembledEquipmentConfig) andon_cancel(leave the wizard) cross back to the host.Rendered as a full-page card since the wizard owns the
/wizard/equipmentroute.- Parameters:
state (
EquipmentWizardState|None)on_confirm (
Callable[[EquipmentConfig],None] |None)
- Return type: