exlab_wizard.ui.mount#
NiceGUI mount helper. Backend Spec §4.3, §15.3.2.
mount_ui is the single entry point the tray calls after
create_app returns: it registers @ui.page(...) handlers for every
wizard route and binds the NiceGUI ASGI sub-app onto the FastAPI app at
/ via ui.run_with. Page handlers pull live components from
app.state.dependencies – the API surface and the GUI share the same
dependency bundle.
The handlers are deliberately defensive: every dependency access is
wrapped in try/except so a half-wired backend (LIMS not reachable, sync
queue absent, validator not yet vetted) degrades to a structured
“unavailable” banner instead of leaking a stack trace into pywebview.
The factory in exlab_wizard.tray.dependencies follows the same
pattern at construction time; the two layers together let the operator
see a usable GUI even when individual collaborators are unavailable.
Functions
|
Register every wizard page on |
- exlab_wizard.ui.mount.mount_ui(app, *, storage_secret)[source]#
Register every wizard page on
appand mount NiceGUI at/.storage_secretis the per-installation token fromexlab_wizard.tray.storage_secret; NiceGUI uses it to sign the StarletteSessionMiddlewarecookie that backsapp.storage.user. The codebase doesn’t readapp.storage.*today but NiceGUI refuses to mount without a non-empty value.