mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
refactor(ui): extract application shortcuts and parameter controls
This commit is contained in:
1 parent
5fa8db1686
commit
7a5f615d55
14 files changed
+469
-92
No files matched your search
@@ -417,8 +417,8 @@ test('newer visual, map, and individual panel actions suppress only their owned
|
||||
test('every explicit visual UI gesture claims restore authority before it mutates state', () => {
|
||||
const initUi = sourceBlock(' _initUI() {', ' _initMapStackControl() {');
|
||||
const gestureRoutes = [
|
||||
["if (e.key.toLowerCase() === 'h')", "if (e.key.toLowerCase() === 'o')", 'this.hud.toggle()', 'HUD hotkey'],
|
||||
["if (e.key.toLowerCase() === 'd')", "if (e.key.toLowerCase() === 'c')", 'cycleDetectionMode()', 'detection hotkey'],
|
||||
['toggleHud: () => {', 'toggleOrbit: () =>', 'this.hud.toggle()', 'HUD hotkey'],
|
||||
['cycleDetection: () => {', 'toggleCctv: () =>', 'cycleDetectionMode()', 'detection hotkey'],
|
||||
['// Bloom toggle', '// Bloom intensity slider', 'this._setBloomEnabled(', 'bloom button'],
|
||||
['// Bloom intensity slider', '// Sharpen toggle', 'this._setBloomIntensity(', 'bloom slider'],
|
||||
['// Sharpen toggle', '// Scope mask', 'this._setSharpenEnabled(', 'sharpen button'],
|
||||
@@ -695,3 +695,13 @@ test('destroy cancels only a still-owned share flight and ignores delayed comple
|
||||
newerManager.destroy();
|
||||
assert.equal(cancellations, 1, 'newer navigation must not be cancelled');
|
||||
});
|
||||
|
||||
|
||||
test('visual input listeners are revoked before asynchronous UI teardown', () => {
|
||||
const disposal = uiSource.slice(uiSource.indexOf(' async dispose() {'));
|
||||
const firstAwait = disposal.indexOf('await ');
|
||||
assert.ok(firstAwait > 0);
|
||||
const synchronous = disposal.slice(0, firstAwait);
|
||||
assert.match(synchronous, /this\._applicationShortcuts\?\.destroy\(\)/);
|
||||
assert.match(synchronous, /this\._styleParameters\?\.destroy\(\)/);
|
||||
});
|
||||
Reference in new issue
Block a user