exlab_wizard.ui.components.tree#
Project / equipment tree (Frontend Spec §3.5).
Renders the <equipment>/<project>/<run> hierarchy:
Equipment node – equipment ID in heading color.
Project node – human name + short_id, with optional archived / deleted-from-LIMS treatment.
Run node (experimental) –
Run_<DATE>+ label.Run node (test) – dimmed styling +
TestRun_prefix in warning-tier color + a “Test” pill.
Run rows also carry a small colour-coded rollup sync icon to the left of the label (two-icon sync-presence design, 2026-05-30):
sync_local.svgon a blue background – run data is still on local disk (not fully backed up).sync_nas.svgon a green background – the run is fully backed up on the NAS.sync_nas.svgon a red / amber background with a✕/!badge – a problem (upload failed) or a held (blocked-by-validation) run.
The run-node rollup discriminator is derived from the run’s
sync_state.json + persisted creation.json failure status by the
browse router; RunNode.sync_status carries that string, which
file_sync_view() maps
to a FileSyncView.
.exlab-wizard/ folders are hidden by default (Frontend §13.1) and
hidden filtering is the caller’s concern.
The component returns a NiceGUI ui.tree configured with a list of
node dicts; tests can assert on the data shape without spinning up
NiceGUI.
Functions
|
Translate a hierarchy into a list of |
|
Build the project / equipment tree. |
|
Return |
|
Return |
|
Convert |
Classes
|
|
|
|
|
|
|
Filter chip state passed to the tree (Frontend §3.5.4). |
|
A renderable tree node (post-filter). |
- class exlab_wizard.ui.components.tree.EquipmentNode(equipment_id, relay=False)[source]#
Bases:
object
- class exlab_wizard.ui.components.tree.ProjectNode(short_id, name, status=TreeProjectStatus.ACTIVE)[source]#
Bases:
object- status: TreeProjectStatus = 'active'#
- class exlab_wizard.ui.components.tree.RunNode(directory_name, run_kind, label=None, sync_status=None)[source]#
Bases:
object- run_kind: RunKind#
- class exlab_wizard.ui.components.tree.TreeFilters(active=True, archived=False, test_runs=True, search='')[source]#
Bases:
objectFilter chip state passed to the tree (Frontend §3.5.4).
- class exlab_wizard.ui.components.tree.TreeNode(node_id, label, kind, children=<factory>, badges=<factory>, style_hints=<factory>, sync_status=None)[source]#
Bases:
objectA renderable tree node (post-filter).
- Parameters:
- exlab_wizard.ui.components.tree.build_nodes(*, hierarchy, filters)[source]#
Translate a hierarchy into a list of
TreeNode.- Parameters:
hierarchy (
dict[EquipmentNode,dict[ProjectNode,list[RunNode]]])filters (
TreeFilters)
- Return type:
- exlab_wizard.ui.components.tree.build_tree(*, hierarchy, on_select=None, on_equipment_context_action=None, on_run_context_action=None, filters=None, expand_all=False, selected_node=None)[source]#
Build the project / equipment tree.
Returns the NiceGUI
ui.treeelement, or the immutable nodes list when called outside of a NiceGUI app context (tests).expand_alltoggles Quasar’sdefault-expand-allprop – used by e2e tests that need every node visible in the DOM without having to click expand carets.on_equipment_context_actionandon_run_context_actionreceive(node_id, action)when the operator picks an item from the per-row right-click menu (Redesign §4.6, dec. 4A). Action strings match the constants inexlab_wizard.ui.components.tree_context_menu(edit_equipment/remove_equipment/force_sync/clear_verified/view_log). Received- equipment rows never raise these callbacks (no context menu).- Parameters:
hierarchy (
dict[EquipmentNode,dict[ProjectNode,list[RunNode]]])on_equipment_context_action (
Callable[[str,str],None] |None)filters (
TreeFilters|None)expand_all (
bool)
- Return type:
- exlab_wizard.ui.components.tree.filter_project(project, filters)[source]#
Return
Truewhenprojectshould be rendered.Active default-on; Archived default-off. Deleted-from-LIMS rows always render (Frontend §3.5.3).
- Parameters:
project (
ProjectNode)filters (
TreeFilters)
- Return type:
- exlab_wizard.ui.components.tree.filter_run(run, filters)[source]#
Return
Truewhenrunshould be rendered.Test runs default-on; toggling the chip off hides them.
- Parameters:
run (
RunNode)filters (
TreeFilters)
- Return type:
- exlab_wizard.ui.components.tree.to_nicegui_nodes(nodes)[source]#
Convert
TreeNodeinstances to NiceGUIui.treedicts.Run rows additionally carry a
sync_iconURL string and async_statusstring used by thedefault-headerscoped-slot template attached inbuild_tree().Each row also carries a
testid_kindfield — the suffix the Playwright flows expect ondata-testid="tree-node-<suffix>". Both run kinds collapse to"run"so the e2e selectors can treat experimental and test runs interchangeably.