feat(ui): show and hide the Cockpit surfaces from a store

The Cockpit controller publishes which surfaces are shown (the entry
button and TR-3B chip, the HUD with its exit and reset buttons and
briefing card, and the Contact card) and the views bind them. Focus moves
to the exit button, and back to the entry, after Vue renders them.

Layout scheduling counts the published presence as visible, so entry
still lays out the cards. The Display portal restores only focus its move
dropped. The Missions layer no longer hides the Contact card directly.
This commit is contained in:
Sameh Khamis committed 2026-10-31 17:44:33 -07:00
1 parent 484243fe4b
commit f279200af5
18 files changed
+422 -74

No files matched your search

+11 -1
View File
@@ -3,13 +3,21 @@ import { markRaw, shallowRef } from 'vue';
/**
* Cockpit content as its views render it. The Cockpit controller presents
* the briefing card's pages, cycle toggle, regional news and local
* which Cockpit surfaces are shown, the briefing card's pages, cycle toggle, regional news and local
* conditions, the Contact card's readouts and weather toggle, the
* instruments, the flight plan, the vision selector and the signal rows,
* and publishes them
* here; it keeps the controls' listeners.
*/
export const useCockpitStore = defineStore('gev-cockpit', () => {
/** Which Cockpit surfaces are shown; null until the controller first syncs. */
const presence = shallowRef(null);
/** @param {?object} next A fresh presentation of the shown surfaces. */
function publishPresence(next) {
presence.value = next && markRaw(next);
}
/** The presented briefing; null until the controller first presents it. */
const brief = shallowRef(null);
@@ -59,6 +67,8 @@ export const useCockpitStore = defineStore('gev-cockpit', () => {
}
return {
presence,
publishPresence,
brief,
publishBrief,
context,