diff --git a/src/aiidalab_qe/app/result/components/status/process_tree/tree.py b/src/aiidalab_qe/app/result/components/status/process_tree/tree.py index 636bee34d..cb560f741 100644 --- a/src/aiidalab_qe/app/result/components/status/process_tree/tree.py +++ b/src/aiidalab_qe/app/result/components/status/process_tree/tree.py @@ -175,7 +175,8 @@ def update(self, node=None): node = node or self.process_node super().update(node) self.tally.value = self._get_tally(node) - self._add_branches(node) + if not self.collapsed: + self._add_branches(node) branch: TreeNode for branch in self.branches.children: branch.update() @@ -214,7 +215,8 @@ def _build_header(self, node, level): self.tally, ] - def _add_branches(self, node): + def _add_branches(self, node=None): + node = node or self.process_node for child in node.called: if child.pk in self.pks: continue @@ -231,6 +233,7 @@ def _add_branches(self, node): level=self.level + 1, on_inspect=self.on_inspect, ) + branch.update() self.branches.children += (branch,) self.pks.add(child.pk) @@ -255,6 +258,7 @@ def _toggle_branches(self, _): if self.collapsed: self.branches.add_class("open") self.toggle.icon = "minus" + self._add_branches() else: self.branches.remove_class("open") self.toggle.icon = "plus"