From 9df858e9fe4400484f918cfa643592c70cf6e958 Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Wed, 18 Nov 2026 15:33:06 -0800 Subject: [PATCH] Start the right panels below the Stories card while it is up With the Omnibar's lifted dock the right column rises level with the left one, under the NEW GEV Stories card, whose buttons then took clicks meant for the panel's controls (Street Level's FIT and FILL). The card is now an obstacle for the right column, and its arrival or departure lays the column out again. Co-authored-by: Manjunath Paparaju --- src/ui/panelLayoutController.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/ui/panelLayoutController.js b/src/ui/panelLayoutController.js index abcd4dff06..7b21b72d09 100644 --- a/src/ui/panelLayoutController.js +++ b/src/ui/panelLayoutController.js @@ -57,6 +57,9 @@ const RIGHT_STACK_OBSTACLE_SELECTOR = [ '#intel-hud .hud-right-edge', '#cockpit-context', '#cockpit-signal-stream', + // The "NEW: GEV Stories" card under the Stories button: panels start below + // it while it is up, so its buttons never sit over a panel's controls. + '#hPop', '#cesium-credits .cesium-credit-logoContainer', '#cesium-credits .cesium-credit-textContainer', '#gev-credits', @@ -64,6 +67,14 @@ const RIGHT_STACK_OBSTACLE_SELECTOR = [ '#gev-voice-control', '#world-timeline', ].join(', '); +/** True when a mutation adds or removes the Stories card (`#hPop`). */ +function movesStoriesCard(record) { + for (const list of [record.addedNodes, record.removedNodes]) + for (const node of list) + if (node.id === 'hPop' || node.querySelector?.('#hPop')) return true; + return false; +} + export class PanelLayoutController { constructor({ readHud, @@ -92,6 +103,7 @@ export class PanelLayoutController { this._rightStackPreferredPanelId = null; this._rightStackReconsiderAutoCollapse = false; this._rightStackResizeObserver = null; + this._storiesCardObserver = null; this._cockpitLayoutFrame = null; this._cockpitLayoutTimer = null; this._leftPanelStack = document.getElementById('left-panel-stack'); @@ -246,6 +258,18 @@ export class PanelLayoutController { attributes: true, attributeFilter: ['class', 'hidden', 'data-variant'], }); + // The Stories card comes and goes inside the Stories view; only its + // arrival or departure moves the rail, not the view's other changes. + const storiesHost = document.getElementById('gev-stories-host'); + if (storiesHost) { + this._storiesCardObserver = new MutationObserver((records) => { + if (records.some(movesStoriesCard)) this._scheduleRightPanelLayout(); + }); + this._storiesCardObserver.observe(storiesHost, { + subtree: true, + childList: true, + }); + } const hud = document.getElementById('intel-hud'); if (hud) { this._rightStackMutationObserver.observe(hud, { @@ -464,6 +488,7 @@ export class PanelLayoutController { '_leftStackMutationObserver', '_rightStackResizeObserver', '_rightStackMutationObserver', + '_storiesCardObserver', ]) { this[field]?.disconnect(); this[field] = null;