From d66a46736f7a5b6332867beba7ed1a375891c4f1 Mon Sep 17 00:00:00 2001 From: francois Date: Thu, 30 Apr 2026 23:35:43 +0200 Subject: [PATCH] Hide branch steps in parallel item F1 panel The 'branches' list shown in the F1 panel previously contained each branch's full 'steps', duplicating what is already visible in the test tree. Strip 'steps' inside each branch dict while keeping 'branches' itself so per-branch attributes (name, wait_for, condition, ...) stay visible. Co-Authored-By: Claude Opus 4.7 --- .../test_items/test_item_parallel.py | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/testium/interpreter/test_items/test_item_parallel.py b/src/testium/interpreter/test_items/test_item_parallel.py index fb1ee68..19050b4 100644 --- a/src/testium/interpreter/test_items/test_item_parallel.py +++ b/src/testium/interpreter/test_items/test_item_parallel.py @@ -95,8 +95,10 @@ class TestItemParallel(TestItemContainer): dict_item.get("seq_filename", ""), ) # Inject a synthetic 'steps' key so load_test_recursively can load branches - # as TestItemParallelBranch children. The original 'branches' key is kept - # for display in the GUI (it's included by _filter_dict_item, 'steps' is not). + # as TestItemParallelBranch children. The base class' _filter_dict_item + # drops 'steps'; we also drop 'branches' (overridden below) so the F1 + # panel shows only the parallel's own attributes, not the duplicated + # tree of branches/steps already displayed in the test tree. dict_item["steps"] = [{"parallel_branch": b} for b in branches] super().__init__(cst.TYPE_PARALLEL, dict_item, parent, status_queue, filename=filename) @@ -107,6 +109,22 @@ class TestItemParallel(TestItemContainer): self.seqFilename(), ) + def _filter_dict_item(self, dict_item): + c = super()._filter_dict_item(dict_item) + # Keep 'branches' so the F1 panel shows the branch list and their + # per-branch attributes (name, wait_for, condition, ...), but strip + # the 'steps' inside each branch — the steps are already visible as + # children in the test tree and would just duplicate the information. + if isinstance(c, dict) and isinstance(c.get("branches"), list): + stripped = [] + for b in c["branches"]: + if isinstance(b, dict): + stripped.append({k: v for k, v in b.items() if k != "steps"}) + else: + stripped.append(b) + c["branches"] = stripped + return c + def _stop_branch_recursively(self, item): item.stop() for i in range(item.childCount()):