Drag links out of slots on the wiresheet; hide @palette=false types

Hovering a slot row highlights the half under the pointer and shows a
direction cursor. Pressing on a slot drags a rubber band; dropping on
another slot links them, dropping on a title bar opens the Link dialog
with the dragged slot preselected, and a no-entry cursor marks a slot
that would refuse the link. A right click that never moves still opens
the context menu.

The palette now leaves out types whose facets carry @palette=false, and
kits with nothing placeable left.

Also points the default device host at 192.168.1.251.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-03 23:15:47 +03:00
co-authored by Claude Opus 5.5
parent f22d4852c9
commit 85b6fa62f3
7 changed files with 538 additions and 11 deletions
+18 -2
View File
@@ -227,11 +227,25 @@ def _is_component(qualified_name, seen=None):
return result
def _hidden_from_palette(type_element):
"""True when the type's own facets carry @palette=false.
Only the type-level <facets> counts; slots have <facets> of their own nested deeper.
"""
facets = type_element.find("facets")
if facets is None:
return False
for facet in facets.findall("bool"):
if facet.get("name") == "palette" and facet.get("val") == "false":
return True
return False
def list_component_types(kit_name):
"""Concrete component types in a kit, as (type name, base) pairs.
Primitives (no base) and abstract types (the 'a' flag) are left out — neither can be
placed in an application.
Primitives (no base), abstract types (the 'a' flag) and types marked @palette=false
are left out — none of them belong in the palette.
"""
_, types = _load_kit(kit_name)
@@ -239,6 +253,8 @@ def list_component_types(kit_name):
for type_name, type_element in types.items():
if "a" in (type_element.get("flags") or ""):
continue
if _hidden_from_palette(type_element):
continue
if not _is_component(f"{kit_name}::{type_name}"):
continue
entries.append((type_name, type_element.get("base") or ""))