exlab_wizard.ui.pages.staging#

Orchestrator staging panel (Frontend Spec §3.9, Backend §13.8).

A bottom-dock panel rendered below the main content when orchestrator mode is enabled. The panel is ~120 px tall, non-collapsible, and always visible while the orchestrator is active so the operator sees pending staging activity without an extra navigation step.

Each row shows:

State | Run | Equipment | Files | Bytes | Elapsed | Actions |

Per-row actions:

  • [Force sync] – POST /staging/{run_path}/force-sync.

  • [Clear] – POST /staging/{run_path}/clear (only enabled for sync_verified runs).

  • [View log] – open the run’s wizard.<hostname>.log in the detail pane.

A toolbar action [Clear verified runs] clears every run currently in sync_verified. The row data is supplied by the caller as a list of StagedRunSummary from exlab_wizard.orchestrator.staging_query.list_staged_runs().

Module Attributes

STAGING_DOCK_HEIGHT_PX

~120 px, non-collapsible bottom dock.

STAGING_TABLE_COLUMNS

The seven columns displayed (column order is part of the spec).

Functions

format_bytes(value)

Render value as a binary unit string (KiB / MiB / ...).

format_elapsed(seconds)

Render seconds as a compact "Hh Mm Ss" / "Mm Ss" / "Ss" string.

render_staging_dock(state)

Render the bottom-dock staging panel.

row_props(row)

Render-ready dict for one table row.

state_pill_props(state)

Static badge props for a staging-state pill.

Classes

StagingDockState(rows[, on_force_sync, ...])

Render state for the staging panel.

exlab_wizard.ui.pages.staging.STAGING_DOCK_HEIGHT_PX: int = 120#

~120 px, non-collapsible bottom dock.

Type:

Per the brief

exlab_wizard.ui.pages.staging.STAGING_TABLE_COLUMNS: tuple[str, ...] = ('State', 'Run', 'Equipment', 'Files', 'Bytes', 'Elapsed', 'Actions')#

The seven columns displayed (column order is part of the spec).

class exlab_wizard.ui.pages.staging.StagingDockState(rows, on_force_sync=None, on_clear=None, on_view_log=None, on_clear_verified=None)[source]#

Bases: object

Render state for the staging panel.

rows is the list of staging rows pulled from the API; the callbacks are invoked when the operator clicks the row / toolbar buttons. Pages mutate rows in-place when refreshing.

Parameters:
on_clear: Callable[[str], None] | None = None#
on_clear_verified: Callable[[], None] | None = None#
on_force_sync: Callable[[str], None] | None = None#
on_view_log: Callable[[str], None] | None = None#
rows: list[StagedRunSummary]#
exlab_wizard.ui.pages.staging.format_bytes(value)[source]#

Render value as a binary unit string (KiB / MiB / …).

Returns a compact string suitable for table cells. The output uses the same notation across the codebase (see ui/components/tree.py) so the column reads consistently with the rest of the app.

Parameters:

value (int)

Return type:

str

exlab_wizard.ui.pages.staging.format_elapsed(seconds)[source]#

Render seconds as a compact “Hh Mm Ss” / “Mm Ss” / “Ss” string.

Parameters:

seconds (int)

Return type:

str

exlab_wizard.ui.pages.staging.render_staging_dock(state)[source]#

Render the bottom-dock staging panel.

Returns the NiceGUI element when the framework is importable (the common runtime case), or a plain dict describing the rendered shape when NiceGUI is unavailable (the unit-test path – avoids forcing a headless Chromium just to check column ordering).

Parameters:

state (StagingDockState)

Return type:

Any

exlab_wizard.ui.pages.staging.row_props(row)[source]#

Render-ready dict for one table row.

Exposed for unit tests so the pure formatters can be asserted without instantiating NiceGUI elements.

Parameters:

row (StagedRunSummary)

Return type:

dict[str, Any]

exlab_wizard.ui.pages.staging.state_pill_props(state)[source]#

Static badge props for a staging-state pill.

Returns {label, color, background} so the renderer can build the badge without re-deriving colors. color defaults to the muted text token for unrecognised states (defensive – the Pydantic Literal already constrains the values).

Parameters:

state (str)

Return type:

dict[str, str]