Keep globe renderers warm across live engine switches

This commit is contained in:
German Khokhlov committed 2026-11-02 13:45:23 +04:00
1 parent f71c76c306
commit 5e658d8c9d
15 files changed
+343 -34

No files matched your search

+2 -1
View File
@@ -104,6 +104,7 @@ export class StyleManager extends ShellFacade {
services,
requestServices,
initialShareCode = null,
engineSwitch = false,
localePicker = true,
} = {},
) {
@@ -620,7 +621,7 @@ export class StyleManager extends ShellFacade {
this._publishActiveStyle();
this._updateLocationMiniStatus();
this._shareRestoration.start();
this._shareRestoration.start({ engineSwitch });
// Keep the parameter panel from overlapping toggle controls.
this._layoutRightPanels();
+6 -3
View File
@@ -153,7 +153,7 @@ export class ShareRestoration {
this.shareLinkManager = shareLinkManager;
this._initialShareState = shareLinkManager.parseInitialHash();
}
start() {
start({ engineSwitch = false } = {}) {
// Restore from URL hash if present
const savedState = this._initialShareState;
this._initialShareRestorePromise = savedState
@@ -169,6 +169,7 @@ export class ShareRestoration {
this.navigation._beginDeferredNavigation('shared view', {
cancelPendingSelection: false,
});
const delay = engineSwitch ? 0 : 1500;
this._initialShareRestoreTimeout = setTimeout(() => {
this._initialShareRestoreTimeout = null;
if (this._disposed) return;
@@ -178,11 +179,12 @@ export class ShareRestoration {
this.navigation._reassertNavigationHandoff(generation);
void this._runShareRestore(savedState, {
applyCamera,
instant: engineSwitch,
navigationToken: generation,
layersPromise: this._layerStateRestorePromise,
settle: (result) => this._settleInitialShareRestore(result),
});
}, 1500);
}, delay);
} else {
this.syncShareState();
if (this.shareLinkManager?.rejectedShareCode)
@@ -236,7 +238,7 @@ export class ShareRestoration {
*/
async _runShareRestore(
state,
{ applyCamera, navigationToken, layersPromise, settle },
{ applyCamera, instant = false, navigationToken, layersPromise, settle },
) {
const generation = this._shareRestoreGeneration;
const current = () =>
@@ -244,6 +246,7 @@ export class ShareRestoration {
try {
const share = await this.shareLinkManager.applyState(state, {
applyCamera,
instant,
navigationToken,
});
const layers = await (layersPromise || Promise.resolve([]));
+13
View File
@@ -122,6 +122,19 @@ body {
left: 0;
}
.globe-renderer,
.engine-switch-frame {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
}
.engine-switch-frame {
z-index: 1;
pointer-events: none;
}
/* Unified world-overlay host: detection uses one host-owned blend surface
beneath the shared text/card canvas; both share one frame path. The root
holds ONLY the card canvas — it is a stacking context (z-index below), and