Give every behavior variable one row shape on asset and instance

buildStructBlock only covered structs, so a placed instance drew numbers,
text, bools and lists through createFieldRow on a 64 px name column while
its struct block sat on the asset's grid below it. variableRows.ts now
builds the row for every variable kind on both sides; the edit option
decides what the owner may change (asset: rename, x, item kind; instance:
revert and push). Label and Button take a fixed width so the mark column
no longer shifts names when a list shows its item-kind picker.

The two structFields calls that became dead with 9f48257 are gone. The
e2e steps locate the Enabled toggle through __gm.inspectorField instead
of clicking a fixed offset from its label.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
rootandClaude Opus 5 committed 2026-09-11 07:27:29 +02:00
1 parent 9f482573e5
commit 631cf54c72
17 files changed
+515 -472

No files matched your search

+3 -2
View File
@@ -56,7 +56,7 @@ export function installDebugHook(app: Application, state: EditorState, editor: E
* *minimum* width, so a label wider than the column pushes its control right – which is why a
* fixed offset from the label's own text is the wrong way to click one.
*/
const fieldOf = (label: string): { x: number; y: number } | null => {
const fieldOf = (label: string): { x: number; y: number; left: number } | null => {
let found: Text | null = null;
const walk = (node: Container): void => {
if (found !== null || !node.visible) return;
@@ -73,7 +73,8 @@ export function installDebugHook(app: Application, state: EditorState, editor: E
const row = owner?.parent;
if (!row || !owner) return null;
const control = row.children[row.children.indexOf(owner) + 1];
return control instanceof Widget ? centreOf(control) : null;
if (!(control instanceof Widget)) return null;
return { ...centreOf(control), left: control.getGlobalPosition().x };
};
/**
* The visible text of the overlay layer, in drawing order – everything an open popup shows.