From 0674f326372f3c1fa52e49411fc8ed2b78fb762d Mon Sep 17 00:00:00 2001 From: Arda Aydin Date: Sat, 12 Sep 2026 09:20:49 +0300 Subject: [PATCH] Pre-load root children on connect and add placeholders for uncached nodes On connect, also loads root's immediate children so the first tree level shows real names. For deeper levels, inserts placeholder elements for uncached children so the Treeview shows + expand arrows for folders that have children on the device. Co-Authored-By: Claude Opus 4.6 --- app_state.py | 2 +- device_session.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app_state.py b/app_state.py index 2df469d..a93debc 100644 --- a/app_state.py +++ b/app_state.py @@ -8,7 +8,7 @@ so later rebinding would only ever be seen by the module that did it. import configparser import os -VERSION = "0.0.0.079" +VERSION = "0.0.0.080" PROPERTIES_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "editor.properties") DEFAULT_GRID_SIZE = 10 DEFAULT_ADD_TIMESTAMP = True diff --git a/device_session.py b/device_session.py index 73941e8..618d84f 100644 --- a/device_session.py +++ b/device_session.py @@ -35,6 +35,9 @@ class DeviceSession: self._load_slot_registry(parts) root_comp = self.sox_client.load(0) + # Pre-load immediate children so the tree shows the first level + if root_comp and root_comp.children: + self.load_children(root_comp.id) return root_comp def disconnect(self): @@ -228,6 +231,10 @@ class DeviceSession: child_comp = self.sox_client.cache_get(child_id) if child_comp is not None: self._build_comp_element(comp_elem, child_comp) + else: + # Placeholder so the tree shows a + expand arrow for uncached children + ET.SubElement(comp_elem, "comp", + name="...", id=str(child_id), type="") return comp_elem