From 35adf5ee0dc827d853aad7897bf953d0a6b1657e Mon Sep 17 00:00:00 2001 From: rob Date: Sat, 30 May 2026 11:17:51 -0300 Subject: [PATCH] Joinery list: show what each feature connects to (not just "connected") MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The connected indicator now reads "๐Ÿ”— โ†’ " naming the mating board, so a part legitimately in two connections shows each feature's distinct mate, and a free feature shows nothing. (A connection always links two features on two different boards, so a board showing both features connected means it's in two connections โ€” verified the model never over-marks from a single connect.) 86 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/woodshop/gui/feature_panel.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/woodshop/gui/feature_panel.py b/src/woodshop/gui/feature_panel.py index fe6e16a..a693d95 100644 --- a/src/woodshop/gui/feature_panel.py +++ b/src/woodshop/gui/feature_panel.py @@ -96,14 +96,20 @@ class FeaturePanel(QWidget): part = self._part() self.list.clear() feats = part.features if part else [] - connected = {c.anchor for c in self.c.scene.connections} - connected |= {c.moving for c in self.c.scene.connections} + # Map each connected feature -> the board(s) it mates with. + mates: dict[str, list[str]] = {} + for c in self.c.scene.connections: + if not self.c.scene._conn_valid(c): + continue + ap, mp = self.c.scene.feature_owner(c.anchor), self.c.scene.feature_owner(c.moving) + mates.setdefault(c.anchor, []).append(mp.name or mp.id) + mates.setdefault(c.moving, []).append(ap.name or ap.id) # keep the active feature pointing at something on this board ids = [f.id for f in feats] if self.c.active_feature not in ids: self.c.active_feature = ids[0] if ids else None for f in feats: - mark = " ๐Ÿ”— connected" if f.id in connected else "" + mark = f" ๐Ÿ”— โ†’ {', '.join(mates[f.id])}" if f.id in mates else "" label = f"{f.id}: {f.kind} ยท {f.face}{mark}" item = QListWidgetItem(label) item.setData(Qt.UserRole, f.id)