Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

feat(ui): verify layout and input inspection in Web fixture (#73)

YHHe9143e735f96
diff --git a/desktop b/desktop
index fb87c4636..70bccb2b6 160000
--- a/desktop
+++ b/desktop
@@ -1 +1 @@
-Subproject commit fb87c46365a03c78f45c8d47c80d97438939767f
+Subproject commit 70bccb2b646a8c24bad34c630350d5157db4e742
diff --git a/examples/ui-localization-debug/README.md b/examples/ui-localization-debug/README.md
index d520935e8..2e02199f5 100644
--- a/examples/ui-localization-debug/README.md
+++ b/examples/ui-localization-debug/README.md
@@ -24,5 +24,15 @@ control, capture again, then Select to find it in Details. The host must expose
resolved visibility, otherwise a warning is shown. This does not verify actual
keyboard delivery, screen readers or IME on a target device.
-This is a partial RM-009 delivery. Hit regions, platform shaping,
+Layout and input shows resolved local dimensions and world axis-aligned bounds
+for all UINodes. It reports disabled/hidden controls, ancestor pointer-events
+passthrough, raycast-target configuration and parent masks. Expand a row for
+bounds, then Select to locate its existing viewport handles. Scene edits make
+the snapshot stale and disable selection until capture again.
+
+An input candidate is a configuration result, not a successful pointer hit.
+World bounds do not account for clipping or occlusion; parent masks need review.
+Inspection does not raycast, change hover/focus, or add persistent gizmos.
+
+This is a partial RM-009 delivery. Actual pointer hits, platform shaping,
real IME/device acceptance and layout cache performance remain separate work.
diff --git a/examples/ui-localization-debug/VALIDATION.md b/examples/ui-localization-debug/VALIDATION.md
index aed28c0db..b3e81a817 100644
--- a/examples/ui-localization-debug/VALIDATION.md
+++ b/examples/ui-localization-debug/VALIDATION.md
@@ -66,3 +66,25 @@ snapshot; live-game-only dialogs and scripts need runtime acceptance separately.
and one disabled entry, undo, and observe stale state again. No edit was saved.
- No local native test runner was launched. The card remains In Progress;
layout boundaries, pointer hit diagnostics and device acceptance remain open.
+
+## Layout and input configuration increment — 2026-10-08
+
+- UI Inspector adds Layout and input with local dimensions, world axis-aligned
+ bounds, configuration gates and parent-mask review. It never invokes the
+ stateful pointer raycast. Bounds are not clipped screen-space hit regions.
+- Editor: typecheck, production build and 23 layout/i18n/menu checks pass.
+ CSS-variable gate passes; theme gate retains the same 18 existing findings.
+ Layout tests cover scaled geometry,
+ parent masks, ancestor pointer passthrough, disabled and hidden controls,
+ unavailable visibility, hierarchy cycles and unresolved sizes.
+- Built-in WebGL2 fixture: 19/19 checks pass, including 13 resolved UI boxes,
+ three input candidates, ten decorative boxes and unchanged authored data.
+- Manual Web checks: expand LocaleButton, Select to locate the authored entity,
+ change Pointer Events to None, observe stale snapshot and disabled selection,
+ capture again and observe pointer passthrough, then undo and capture again.
+ No verification edit was saved.
+- Browser startup reports missing desktop MCP bridge and optional DragonBones
+ module; these targeted checks do not establish an error-free application.
+- The card remains In Progress. Actual clipped/occluded pointer delivery,
+ platform shaping, IME/accessibility/devices and performance remain open.
+ No local Electron/native test runner was launched.
diff --git a/tools/ui-localization-browser.tsx b/tools/ui-localization-browser.tsx
index 02e69721c..7e89a100b 100644
--- a/tools/ui-localization-browser.tsx
+++ b/tools/ui-localization-browser.tsx
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
import '../desktop/src/main';
-import { captureUITextRows, captureUIFocusRows } from '../desktop/src/panels/UITextDebugPanel';
+import { captureUITextRows, captureUIFocusRows, captureUILayoutRows } from '../desktop/src/panels/UITextDebugPanel';
import { EngineHost } from '../desktop/src/engine/EngineHost';
import { SceneModel } from '../desktop/src/engine/SceneModel';
import { useEditorStore } from '../desktop/src/store/editorStore';
@@ -42,6 +42,12 @@ const focusRows = captureUIFocusRows();
check(focusRows.visibilityResolved, 'Focus inspection uses host hierarchical visibility');
check(focusRows.entries.filter(e => e.order !== null).map(e => e.name).join(',') === 'LocaleButton,PseudoButton,WidthButton', 'Focus inspection reports the three authored buttons in runtime order');
check(JSON.stringify(SceneModel.serialize()) === before, 'Focus snapshot leaves authored scene unchanged');
+const layoutRows = captureUILayoutRows();
+check(layoutRows.length === 13, 'Layout inspector captures Canvas and all 12 UI children');
+check(layoutRows.every(row => row.bounds !== null && row.width > 0 && row.height > 0), 'Layout inspector reports resolved world boundaries');
+check(layoutRows.filter(row => row.gate === 'candidate').map(row => row.name).join(',') === 'LocaleButton,PseudoButton,WidthButton', 'Only the three buttons are input candidates');
+check(layoutRows.filter(row => row.gate === 'no-interactable').length === 10, 'Decorative boxes are not advertised as input targets');
+check(JSON.stringify(SceneModel.serialize()) === before, 'Layout/input snapshot does not change authored data');
status.textContent += `RESULT ${passed} passed, ${failed} failed · ${EngineHost.activeBackend}`;
const dismiss = document.createElement('button');
dismiss.textContent = 'Dismiss verification report';