Attach the shell to another globe without disposing it

StyleManager.attachScene/detachScene rebuild only the globe-bound parts (share restoration, visual settings, layer bindings, Cockpit, the celestial ring, the overlay host, detection, map-source and camera-orientation controls) and point navigation, location search, HUD, share link and the display bindings at the next globe. dispose() revokes input synchronously, detaches the scene and only then nulls the stores and unmounts the views. The radio tuner listens on the globe container, and an engine's persistent notice can be withdrawn.
This commit is contained in:
German Khokhlov committed 2026-11-03 18:02:46 +04:00
1 parent d1fdb9eb45
commit 061ed1b682
8 files changed
+693 -288

No files matched your search

+14 -4
View File
@@ -302,10 +302,16 @@ test('newer navigation, reset, Cockpit, and teardown share one generation', () =
const dispose = body(ui, /async dispose\(\) \{([\s\S]*?)\n \}/, 'dispose');
ordered(dispose, [
'this._disposed = true;',
'this._layerBindings.stop();',
'this._navigation.destroy(',
'await this._contextControls.restoreForDisposal();',
'await this.detachScene(',
'this._navigation.stop();',
], 'dispose invalidation');
// An engine switch retires the outgoing globe's navigation the same way.
const detach = body(ui, /async detachScene\(\{[\s\S]*?\} = \{\}\) \{([\s\S]*?)\n \}/, 'detach');
ordered(detach, [
'this._navigation.setScene(',
'this._layerBindings.stop();',
'await this._contextControls.restoreForDisposal();',
], 'detach invalidation');
assert.match(shellMethod('destroy').toString(), /this\._stampNavigation\(\{\s*cancelPendingSelection: !retainScene\s*\}\)/);
});
@@ -313,9 +319,13 @@ test('teardown synchronously closes immediate camera entry points', () => {
const dispose = body(ui, /async dispose\(\) \{([\s\S]*?)\n \}/, 'dispose');
ordered(dispose, [
'this._disposed = true;',
'await this.detachScene(',
], 'synchronous teardown barrier');
const detach = body(ui, /async detachScene\(\{[\s\S]*?\} = \{\}\) \{([\s\S]*?)\n \}/, 'detach');
ordered(detach, [
'this._layerBindings.stop();',
'await this._contextControls.restoreForDisposal();',
], 'synchronous teardown barrier');
], 'synchronous detach barrier');
ordered(LayerBindings.prototype.stop.toString(), [
'this._disposed = true;',
'this._removeCctvRequestFocusListener?.();',