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
|
Compute |
Classes
|
Render properties for a single tree node's badge. |
|
A validator finding pinned to a tree-node path. |
- class exlab_wizard.ui.components.travelling_badge.BadgeProps(color, count)[source]#
Bases:
objectRender properties for a single tree node’s badge.
- class exlab_wizard.ui.components.travelling_badge.FindingLocation(path, tier)[source]#
Bases:
objectA validator finding pinned to a tree-node path.
pathis 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").tieris “hard” or “soft”.
- 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] == Truemeans 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:
findings (
Iterable[FindingLocation])
- Return type: