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.

test(ui): verify recording across debugger views (#83)

YHH49c72ae108db
diff --git a/desktop b/desktop
index 72e6d3a17..7ab564815 160000
--- a/desktop
+++ b/desktop
@@ -1 +1 @@
-Subproject commit 72e6d3a17b50583ffbf54e19ad547dbeea0f746f
+Subproject commit 7ab56481533d58af88f90f45b8e21401bacf1c39
diff --git a/examples/ui-localization-debug/README.md b/examples/ui-localization-debug/README.md
index 7f8e4ce5b..add2346d1 100644
--- a/examples/ui-localization-debug/README.md
+++ b/examples/ui-localization-debug/README.md
@@ -120,3 +120,10 @@ disposable scene uses SceneCommands to add TextInput to Inside and UIDialog
to OuterMask. After the verification report, open Window → UI Debugger.
Elements exposes these components; edit Value in Details and check that
TextInput.value updates here. Reading the inspector never writes scene data.
+
+The Play browser fixture now mounts the complete UI Debugger. Start recording
+in Events, enter a filter, then switch to Elements or Focus and operate the
+game. Returning to Events keeps recording, the filter and dispatch history.
+Toggle panel closes the debugger and stops observation; opening it again
+restores recorded history without automatically recording. Stop Play also
+ends observation.
diff --git a/examples/ui-localization-debug/VALIDATION.md b/examples/ui-localization-debug/VALIDATION.md
index 53311ac49..44d49b14d 100644
--- a/examples/ui-localization-debug/VALIDATION.md
+++ b/examples/ui-localization-debug/VALIDATION.md
@@ -323,3 +323,25 @@ snapshot; live-game-only dialogs and scripts need runtime acceptance separately.
No Electron/native runner launched. Character entry does not establish a
real IME candidate-window session. Device IME/accessibility, modal stacking,
desktop custom-scheme, text shaping and cache performance remain open.
+
+## Recording across debugger tabs — 2026-10-09
+
+- Switching away from Events previously unmounted the observer and silently
+ stopped recording. Keep the opt-in recorder mounted across Elements, Text
+ and Focus views. Hidden controls are absent from the accessibility tree;
+ closing the panel or stopping Play still stops observation. Reopening reads
+ existing trace history without restarting recording.
+- Seven editor event/focus tests and typecheck pass. The panel regression uses
+ the real EntityEventQueue and UIEventTrace: filter preservation, dispatch
+ while on Elements/Focus, no queue consumption, close cleanup and historical
+ records on reopen without accepting events emitted while closed.
+- Built-in browser, production Play host/SDK/WASM and complete debugger panel:
+ record with filter click, click Inside while on Elements and Focus, return
+ to Events. Recording stays active, filter stays click, and 24 actual dispatch
+ records include both clicks and ancestor bubbling. Closing the panel reports
+ recording=false, rows=24; another real click does not increase this count.
+ Reopening Events restores 24 records with recording stopped. Stop Play
+ disables recording. Screenshot: local ui-recording-tabs.jpg evidence.
+- No Electron/native runner launched. This improves the UI debugging workflow;
+ device IME/accessibility, modal stacking, shaping and cache performance remain
+ separate acceptance items. RM-009 remains In Progress.
diff --git a/tools/ui-events-play-browser.tsx b/tools/ui-events-play-browser.tsx
index ec5ad98a2..b5fe1d103 100644
--- a/tools/ui-events-play-browser.tsx
+++ b/tools/ui-events-play-browser.tsx
@@ -8,9 +8,7 @@ import '../desktop/src/theme/controls.css';
import '../desktop/src/theme/uiTextDebug.css';
import { PlayInspect } from '../desktop/src/engine/PlayInspect';
import { PlayRealm } from '../desktop/src/engine/PlayRealm';
-import { UIDebuggerFocus } from '../desktop/src/panels/UIDebuggerFocus';
-import { UIDebuggerElements } from '../desktop/src/panels/UIDebuggerElements';
-import { UIDebuggerEvents } from '../desktop/src/panels/UIDebuggerEvents';
+import { UITextDebugPanel } from '../desktop/src/panels/UITextDebugPanel';
import { useSelection } from '../desktop/src/store/selectionStore';
// Only staging uses an adapter; the realm protocol and actual game are unchanged.
(window as any).estella = { project: {
@@ -30,7 +28,6 @@ function Fixture() {
const attach = useCallback((element: HTMLDivElement | null) => { if(element) PlayRealm.attach(element); }, []);
const [state, setState] = useState('Ready to start');
const [mounted, setMounted] = useState(true);
- const [view, setView] = useState('events');
const start = async () => { setState('Starting'); try { await PlayRealm.start({ sceneData: scene, assetManifest: {}, physicsEnabled: false }); PlayInspect.start(); setState('Play ready'); } catch(error) { setState(String(error)); } };
const inspect = async () => {
const ref = useSelection.getState().selectedRef;
@@ -40,12 +37,12 @@ function Fixture() {
};
return <main style={{ padding: 16, height: '100vh', display: 'flex', flexDirection: 'column', gap: 12 }}>
<h2>UI Events · production Play realm browser verification</h2>
- <div><button onClick={() => void start()}>Start Play</button> <button onClick={() => { PlayInspect.stop(); PlayRealm.stop(); }}>Stop Play</button> <button onClick={() => setMounted(value => !value)}>Toggle panel</button> <button onClick={() => void inspect()}>Read runtime snapshot</button> <button onClick={() => setView('events')}>Events</button> <button onClick={() => setView('focus')}>Focus</button> <button onClick={() => setView('elements')}>Elements</button></div>
+ <div><button onClick={() => void start()}>Start Play</button> <button onClick={() => { PlayInspect.stop(); PlayRealm.stop(); }}>Stop Play</button> <button onClick={() => setMounted(value => !value)}>Toggle panel</button> <button onClick={() => void inspect()}>Read runtime snapshot</button></div>
<small>Game keys: M opens the runtime button as a dialog; R closes it; D disables current focus; E restores disabled controls; H hides the dialog parent; V shows it again; T toggles a real text input (outside text editing).</small>
<p role="status">{realm.playing ? 'Playing' : 'Stopped'} · {realm.ready ? 'Ready' : 'Not ready'} · {realm.error ?? ''}</p>
<div style={{ display: 'flex', gap: 16, flex: 1, minHeight: 0 }}>
<div style={{ width: 800, height: 600, flexShrink: 0 }} ref={attach} />
- <section style={{ flex: 1, minWidth: 300, display: 'flex', flexDirection: 'column', overflow: 'auto' }}>{mounted && (view === 'events' ? <UIDebuggerEvents /> : view === 'focus' ? <UIDebuggerFocus /> : <UIDebuggerElements />)}</section>
+ <section style={{ flex: 1, minWidth: 300, display: 'flex', flexDirection: 'column', overflow: 'auto' }}>{mounted && <UITextDebugPanel />}</section>
</div>
<output style={{maxHeight: 90, overflow: 'auto', fontSize: 11}}>{state}</output>
<output aria-label="Selected runtime nodes">{JSON.stringify(selected)}</output>