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 <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-18 15:33:06 -08:00
1 parent 3d3382f786
commit 9df858e9fe
1 file changed
+25
+25
View File
@@ -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;