fix(cockpit): centre the phone Display/Radio row above the flight readouts

On phones (<=760 px) the collapsed Display/Radio launcher row was
right-anchored at bottom: 152px, off the Reset/Exit axis and on top of
the ground speed and altitude readouts. Centre it and anchor it above
the compass block through a shared --cockpit-compass-bottom variable;
only the launchers take pointer input. Cyber's top row is centred too.
This commit is contained in:
Denis Groshev committed 2026-11-04 16:25:38 +01:00
1 parent 4859ba4c94
commit 5738cdc45c
5 files changed
+83 -5

No files matched your search

+7 -1
View File
@@ -1137,10 +1137,16 @@ test('mobile Cockpit prioritizes flight instruments and collision-safe controls'
assert.match(mobileCockpit[1], /body\.cockpit-mode #intel-hud/);
assert.match(mobileCockpit[1], /body\.cockpit-mode \.cockpit-context-window/);
assert.match(mobileCockpit[1], /body\.cockpit-mode \.cockpit-signal-window/);
// The collapsed Display/Radio row is centred on the Reset/Exit axis and
// anchored above the compass block, not at a fixed offset that covered the
// ground speed and altitude readouts; the compass reads the same anchor.
assert.match(
mobileCockpit[1],
/body\.cockpit-mode \.cockpit-utility-controls[\s\S]*?bottom:\s*152px;/,
/body\.cockpit-mode \.cockpit-utility-controls \{[\s\S]*?bottom:\s*calc\(var\(--cockpit-compass-bottom\) \+ 182px\);[\s\S]*?left:\s*12px;[\s\S]*?justify-content:\s*center;/,
);
assert.doesNotMatch(mobileCockpit[1], /bottom:\s*152px;/);
assert.match(css, /\.cockpit-compass \{[\s\S]*?bottom:\s*var\(--cockpit-compass-bottom\);/);
assert.match(css, /--cockpit-compass-bottom:\s*clamp\(44px, 7vh, 72px\);/);
assert.match(
mobileCockpit[1],
/body\.cockpit-mode \.cockpit-utility-control\.is-expanded[\s\S]*?top:\s*96px;/,
+16 -3
View File
@@ -48,6 +48,9 @@
--cockpit-side-panel-width: min(340px, 28vw);
/* HUD bottom offset + tallest scaled telemetry block + 20px clear border. */
--cockpit-bottom-rail-safe: calc(clamp(84px, 11vh, 118px) + 100px);
/* The compass block's bottom edge; the phone Display/Radio row sits above
the telemetry it carries. */
--cockpit-compass-bottom: clamp(44px, 7vh, 72px);
position: fixed;
inset: 0;
z-index: 145;
@@ -645,7 +648,7 @@ html:not([lang='en']) .cockpit-roll-token.is-separator {
.cockpit-compass {
position: absolute;
left: 50%;
bottom: clamp(44px, 7vh, 72px);
bottom: var(--cockpit-compass-bottom);
width: min(760px, 72vw);
transform: translateX(-50%) rotateX(7deg) translateZ(18px);
transform-style: preserve-3d;
@@ -2076,15 +2079,25 @@ body.cockpit-mode #intel-hud .hud-right-edge {
body.cockpit-mode #right-context-rail {
display: none !important;
}
/* A centred row above the compass block: its ground speed and altitude
telemetry tops out ~171px above the block's bottom edge on phones, so
the row clears it by ~10px and stays on the same axis as RESET/EXIT.
The row spans the width to centre its launchers; only they take input. */
body.cockpit-mode .cockpit-utility-controls {
top: auto;
right: 12px;
bottom: 152px;
max-width: calc(100vw - 24px);
bottom: calc(var(--cockpit-compass-bottom) + 182px);
left: 12px;
justify-content: center;
max-width: none;
pointer-events: none;
}
body.cockpit-mode .cockpit-utility-controls {
flex-direction: row;
}
body.cockpit-mode .cockpit-utility-control {
pointer-events: auto;
}
body.cockpit-mode .cockpit-utility-launcher {
width: min(150px, calc((100vw - 31px) / 2));
min-height: 42px;
+4
View File
@@ -2892,10 +2892,14 @@
max-height: min(48vh, 440px);
}
/* Centred like the default theme's phone row; the desktop panel width
would otherwise pin it left of the Reset/Exit axis. */
:root[data-ui-theme='cyber'] body.cockpit-mode .cockpit-utility-controls {
top: 92px !important;
right: 12px;
bottom: auto;
left: 12px;
width: auto;
}
:root[data-ui-theme='cyber']