mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Separate scene handoff and attachment from the page shell
Move the page handoff sequence into SceneSwitcher and include restoration in the application's candidate attachment. Release a failed candidate once before the request coordinator recovers the working engine. Keep address ordering, parked renderers, retained layers and cockpit resumption intact. Define the layer session and its field owners. Share its retention decision across teardown paths. Separate layer scene binding from lifecycle policy, and shell scene composition from page controls. Keep failed renderer releases in the binding owner, with the existing retry behavior. Give Director the scene and use the engine host for its canvas and pack container. Keep the existing tracked-subject interaction guard so neither engine's behavior changes. Pass startup chrome the first backend's explicit welcome policy instead of testing for a viewer. Cesium remains the behavior reference; this restructuring intentionally changes no visible behavior on either engine. Viewer references outside the Cesium engine fall from 948 to 933. All other coupling counts stay unchanged. Scene service ownership, raw debug access, and the remaining shell and host queues still need consolidation. Checked in the browser, keyless, on the dev server: the engine switch, Director engine switch, layer panel and layer visibility on both engines pass, and 14 of 15 strict scenarios pass (rapid, hidden-tab, context-loss, parked-release, Navara HD, failure matrix and soak among them). app-once and the Director next-shot step fail the same way before this change.
This commit is contained in:
1 parent
f385986383
commit
656943641c
23 files changed
+1265
-888
No files matched your search
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* State that survives replacement of the globe. Each field names its owner;
|
||||
* scene attachments keep their own signals and never replace this lifetime.
|
||||
*
|
||||
* @typedef {object} LayerSession
|
||||
* @property {AbortController} lifetime Page owner: ends retained work.
|
||||
* @property {Map<string, object>} models Catalog: retained layer modules.
|
||||
* @property {import('../data/lifecycle.js').LayerLifecycle | null} manager Data phase.
|
||||
* @property {import('./layerPresentation.js').LayerPresentation | null} presentation Data phase.
|
||||
* @property {ReturnType<typeof import('./operations.js').createApplicationOperations> | null} operations Scene factory: session requests and surface caches.
|
||||
* @property {ReturnType<typeof import('../layers/aircraft/classification.js').createMilitaryRegistry> | null} militaryRegistry Catalog.
|
||||
* @property {ReturnType<typeof import('../layers/weather/clock.js').createWeatherClock> | null} weatherClock Catalog.
|
||||
* @property {import('../scenes/director.js').SceneDirector | null} director Tools phase.
|
||||
* @property {ReturnType<typeof import('../annotations/index.js').createSessionAnnotations> | null} annotations Session tools.
|
||||
* @property {{draw?: ReturnType<typeof import('../annotations/drawTool.js').createSessionDrawTool>, geoImport?: ReturnType<typeof import('../ui/geoFileImport.js').createGeoFileImport>}} tools Session tools.
|
||||
* @property {ReturnType<typeof import('../voice/gevRealtime.js').createSceneVoice> | null} voice Session voice.
|
||||
* @property {{locale?: () => void, placeSearch?: object, sceneChrome?: boolean}} chrome Standalone startup and scene factory.
|
||||
* @property {Map<string, {entry: object | null, enabled: boolean, durable: boolean | undefined}> | null} handoffLayers Switch coordinator: outgoing layer intentions.
|
||||
* @property {boolean} restoringView Switch coordinator: incoming address restoration.
|
||||
* @property {() => boolean} switching Switch coordinator: voice waits while busy.
|
||||
* @property {object | null} contextScene Shell: retained Context state.
|
||||
*/
|
||||
|
||||
/** @returns {LayerSession} */
|
||||
export function createLayerSession() {
|
||||
return {
|
||||
lifetime: new AbortController(),
|
||||
models: new Map(),
|
||||
manager: null,
|
||||
presentation: null,
|
||||
operations: null,
|
||||
militaryRegistry: null,
|
||||
weatherClock: null,
|
||||
director: null,
|
||||
annotations: null,
|
||||
tools: {},
|
||||
voice: null,
|
||||
chrome: {},
|
||||
handoffLayers: null,
|
||||
restoringView: false,
|
||||
switching: () => false,
|
||||
contextScene: null,
|
||||
};
|
||||
}
|
||||
|
||||
/** Whether teardown preserves the session for another globe. */
|
||||
export function retainsLayerSession(session) {
|
||||
return Boolean(session?.handoffLayers && !session.lifetime.signal.aborted);
|
||||
}
|
||||
Reference in new issue
Block a user