exlab_wizard.ui.components.status_bar_segment#

Bottom-of-window status bar segment (Frontend Spec §3.5.5).

The status bar has three segments left-to-right – Sync, Validator, LIMS – each clickable and using var(--text-xs) monospace.

The component handles two concerns:

  • Color logic – normal state uses var(--color-muted); warning states use var(--color-warning); error states use var(--color-danger).

  • Layout – a small rounded segment with optional warning glyph prefix.

Functions

derive_footer_segment_states(*[, ...])

Map live backend counts to per-segment states (Frontend §3.5.5).

segment_spec(*, label[, state])

Compute a SegmentSpec from a label and state.

status_bar_segment(*, label[, state, on_click])

Build a clickable status-bar segment.

Classes

FooterSegmentStates(validator, lims, staging)

Derived SEGMENT_* state for each footer status segment (Phase 5).

SegmentSpec(label, state, color_var, ...)

Computed render spec for a status-bar segment.

class exlab_wizard.ui.components.status_bar_segment.FooterSegmentStates(validator, lims, staging)[source]#

Bases: object

Derived SEGMENT_* state for each footer status segment (Phase 5).

Only the segments whose state varies with live backend signals are carried here – Validator, LIMS, Staging. The Sync segment keeps its own richer label/click logic in the page renderer (it doubles as the Operations entry point), so it is not duplicated in this mapping.

Parameters:
lims: str#
staging: str#
validator: str#
class exlab_wizard.ui.components.status_bar_segment.SegmentSpec(label, state, color_var, show_warning_glyph)[source]#

Bases: object

Computed render spec for a status-bar segment.

Parameters:
  • label (str)

  • state (str)

  • color_var (str)

  • show_warning_glyph (bool)

color_var: str#
label: str#
show_warning_glyph: bool#
state: str#

Map live backend counts to per-segment states (Frontend §3.5.5).

  • ValidatorWARNING when at least one hard-tier finding gates work (problems_count_hard > 0), sourced from the 30 s background audit rollup.

  • LIMSDANGER when the LIMS endpoint is unreachable (deps.lims_reachable is False).

  • StagingWARNING when runs are pending clearance. There is no cheap cached count today (a per-render list_staged_runs scan would be I/O on the render path), so the caller passes 0 and the segment stays NORMAL until a cached signal exists; the parameter is wired so that becomes a one-line change.

Pure so the mapping is unit-testable; the defaults describe a clean / half-wired backend (every segment NORMAL) so a missing signal degrades quietly rather than raising.

Parameters:
  • problems_count_hard (int)

  • lims_reachable (bool)

  • staging_pending (int)

Return type:

FooterSegmentStates

exlab_wizard.ui.components.status_bar_segment.segment_spec(*, label, state='normal')[source]#

Compute a SegmentSpec from a label and state.

The state controls the color and whether a warning glyph prefixes the label.

Parameters:
Return type:

SegmentSpec

exlab_wizard.ui.components.status_bar_segment.status_bar_segment(*, label, state='normal', on_click=None)[source]#

Build a clickable status-bar segment.

Parameters:
Return type:

Any