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 sync icon to the left of the label:
sync_local.svg– run data is still on local disk (any sync status other thancleaned).sync_cloud.svg– run has been synced, verified, and locally cleaned (sync_status == "cleaned"); only the.exlab-wizard/cache subtree remains on disk (§7.1.10).
.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)[source]#
Bases:
object- Parameters:
equipment_id (
str)
- 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, filters=None, expand_all=False)[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.- Parameters:
hierarchy (
dict[EquipmentNode,dict[ProjectNode,list[RunNode]]])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().