exlab_wizard.ui.components.travelling_badge#

Travelling problem-badge pure function. GUI/Orchestrator Redesign §4.5.

Given the validator finding set and per-node fold (expand) state, return for each node the badge to render. The badge for each finding sits on the shallowest collapsed node on the path to that finding, travelling inward as nodes expand. If a node aggregates both red and amber findings the red wins; the count is the total.

Pure function; no NiceGUI dependency. The tree renderer consumes the returned BadgeProps to paint the badges.

Functions

travelling_badges(findings, fold_state)

Compute {node_id: BadgeProps} for every node that gets a badge.

Classes

BadgeProps(color, count)

Render properties for a single tree node's badge.

FindingLocation(path, tier)

A validator finding pinned to a tree-node path.

class exlab_wizard.ui.components.travelling_badge.BadgeProps(color, count)[source]#

Bases: object

Render properties for a single tree node’s badge.

Parameters:
color: Literal['red', 'amber']#
count: int#
class exlab_wizard.ui.components.travelling_badge.FindingLocation(path, tier)[source]#

Bases: object

A validator finding pinned to a tree-node path.

path is the slash-joined node id of the deepest tree node the finding belongs to (e.g. "EQUIP_A/PROJ-0001/Runs/Run_2026-04-17T14-32"). tier is “hard” or “soft”.

Parameters:
path: str#
tier: str#
exlab_wizard.ui.components.travelling_badge.travelling_badges(findings, fold_state)[source]#

Compute {node_id: BadgeProps} for every node that gets a badge.

fold_state[node_id] == True means the node is expanded; False or missing means collapsed. For each finding, walk from the leaf toward the root and find the shallowest collapsed ancestor — that ancestor receives the badge contribution. If every ancestor on the path is expanded, the finding lives on its own node.

Parameters:
Return type:

dict[str, BadgeProps]