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

mount_ui(app, *, storage_secret)

Register every wizard page on app and mount NiceGUI at /.

exlab_wizard.ui.mount.mount_ui(app, *, storage_secret)[source]#

Register every wizard page on app and mount NiceGUI at /.

storage_secret is the per-installation token from exlab_wizard.tray.storage_secret; NiceGUI uses it to sign the Starlette SessionMiddleware cookie that backs app.storage.user. The codebase doesn’t read app.storage.* today but NiceGUI refuses to mount without a non-empty value.

Parameters:
Return type:

None