exlab_wizard.ui.components.filter_chips#

Filter-chip strip component (Frontend Spec §3.5.4, §11.1).

A row of toggleable chips with optional default-on / default-off state. Used in:

  • The main-window left tree (Active default-on, Archived default-off, Test runs default-on; Frontend §3.5.4).

  • The Problems tab header (Severity, Class, State, Scope; Frontend §11.1).

Functions

filter_chips(chips, *[, on_change, state])

Build the chip strip.

initial_state(chips)

Build a ChipState from each chip's default_on.

is_active(state, chip_id)

Return True when chip_id is currently toggled on.

list_active(state, chips)

Return the ids of currently-active chips, preserving definition order.

toggle(state, chip_id)

Flip the state of chip_id and return the new ChipState.

Classes

ChipDefinition(chip_id, label, default_on)

One chip in a chip group.

ChipState(active)

Mutable state for a chip group.

class exlab_wizard.ui.components.filter_chips.ChipDefinition(chip_id, label, default_on)[source]#

Bases: object

One chip in a chip group.

Parameters:
chip_id: str#
default_on: bool#
label: str#
class exlab_wizard.ui.components.filter_chips.ChipState(active)[source]#

Bases: object

Mutable state for a chip group.

Parameters:

active (set[str])

active: set[str]#
exlab_wizard.ui.components.filter_chips.filter_chips(chips, *, on_change=None, state=None)[source]#

Build the chip strip.

Returns the NiceGUI row, or the immutable props dict in test contexts.

Parameters:
Return type:

Any

exlab_wizard.ui.components.filter_chips.initial_state(chips)[source]#

Build a ChipState from each chip’s default_on.

Parameters:

chips (Sequence[ChipDefinition])

Return type:

ChipState

exlab_wizard.ui.components.filter_chips.is_active(state, chip_id)[source]#

Return True when chip_id is currently toggled on.

Parameters:
Return type:

bool

exlab_wizard.ui.components.filter_chips.list_active(state, chips)[source]#

Return the ids of currently-active chips, preserving definition order.

Parameters:
Return type:

list[str]

exlab_wizard.ui.components.filter_chips.toggle(state, chip_id)[source]#

Flip the state of chip_id and return the new ChipState.

Parameters:
Return type:

ChipState