Add a Properties view for the app root
The root tree row now names the app component, "app (<host:port>)" or "app (<file>)", and offers Properties from its context menu and on double-click. The live DOM's <app> element now carries its type and slot values, and the refresh-by-id lookup finds it, so the view shows real sys::App values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+5
-2
@@ -508,7 +508,9 @@ class PropertiesPanel:
|
||||
# the view would open already claiming unsaved edits.
|
||||
self._loading = False
|
||||
|
||||
comp_type = comp.get("type", "sys::Component")
|
||||
# A .sax file's <app> carries no type attribute: it is always a sys::App.
|
||||
default_type = "sys::App" if comp.tag == "app" else "sys::Component"
|
||||
comp_type = comp.get("type") or default_type
|
||||
self.slots = schema.get_full_slots_for_type(comp_type)
|
||||
|
||||
self.frame = tk.Frame(parent)
|
||||
@@ -624,7 +626,8 @@ class PropertiesPanel:
|
||||
name_font = tkfont.Font(family="Segoe UI", size=9, weight="bold")
|
||||
type_font = tkfont.Font(family="Segoe UI", size=9)
|
||||
|
||||
self._tinted(tk.Label(header, text=self.comp.get("name", "?"), font=name_font,
|
||||
default_name = "App" if self.comp.tag == "app" else "?"
|
||||
self._tinted(tk.Label(header, text=self.comp.get("name", default_name), font=name_font,
|
||||
bg=HEADER_BG), HEADER_BG).pack(side=tk.LEFT)
|
||||
self._tinted(tk.Label(header, text=f"({comp_type})", font=type_font,
|
||||
fg="#555555", bg=HEADER_BG),
|
||||
|
||||
Reference in New Issue
Block a user