Joinery tab: mark connected features in the list

Each feature row in the Joinery tab now shows "🔗 connected" when that feature
is part of a recorded connection (its id appears as an anchor or moving feature),
so it's clear which mortises/tenons are already mated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
rob 2026-05-30 10:59:44 -03:00
parent a1f6145115
commit 5e8a1c7926
1 changed files with 4 additions and 1 deletions

View File

@ -94,12 +94,15 @@ class FeaturePanel(QWidget):
part = self._part() part = self._part()
self.list.clear() self.list.clear()
feats = part.features if part else [] 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}
# keep the active feature pointing at something on this board # keep the active feature pointing at something on this board
ids = [f.id for f in feats] ids = [f.id for f in feats]
if self.c.active_feature not in ids: if self.c.active_feature not in ids:
self.c.active_feature = ids[0] if ids else None self.c.active_feature = ids[0] if ids else None
for f in feats: for f in feats:
label = (f"{f.id}: {f.kind} · {f.face}") mark = " 🔗 connected" if f.id in connected else ""
label = f"{f.id}: {f.kind} · {f.face}{mark}"
item = QListWidgetItem(label) item = QListWidgetItem(label)
item.setData(Qt.UserRole, f.id) item.setData(Qt.UserRole, f.id)
self.list.addItem(item) self.list.addItem(item)