feat(cockpit): render the utility strip's measured layout from the store

The Cockpit layout pass publishes the utility strip's fit to the
gev-cockpit store: the HUD's --cockpit-utility-* lengths, whether only the
expanded control fits, and whether a collapsed control beside an expanded
one is hidden from assistive technology. CockpitView renders the lengths
on the HUD and CockpitUtilityControls the strip's class and each control's
aria-hidden, which now also follows a popover opened between passes. Focus
leaves a control before the strip hides it. Exit publishes no layout,
which also clears the expanded height, class and aria-hidden the old exit
left behind. The briefing and Contact cards' positions stay imperative:
the same pass measures them straight after writing them.
This commit is contained in:
Sameh Khamis committed 2026-11-01 14:36:51 -08:00
1 parent c3c69a91cd
commit 4c92f517db
12 files changed
+236 -70

No files matched your search

+22
View File
@@ -66,6 +66,26 @@ export const useCockpitStore = defineStore('gev-cockpit', () => {
signals.value = next && markRaw(next);
}
/**
* The utility strip's measured layout: its top and height limits as CSS
* lengths (null leaves the stylesheet's), whether only the expanded control
* fits, and whether a collapsed control beside an expanded one is hidden
* from assistive technology. Null until the first layout pass.
*/
const utilityLayout = shallowRef(null);
/** @param {?object} next A fresh layout; one equal to the current is dropped. */
function publishUtilityLayout(next) {
const current = utilityLayout.value;
if (
next &&
current &&
Object.keys(next).every((key) => next[key] === current[key])
)
return;
utilityLayout.value = next && markRaw(next);
}
return {
presence,
publishPresence,
@@ -81,5 +101,7 @@ export const useCockpitStore = defineStore('gev-cockpit', () => {
publishVision,
signals,
publishSignals,
utilityLayout,
publishUtilityLayout,
};
});