mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 17:52:21 +00:00
Make Space Missions an ordinary layer with its own panel
Space Missions no longer runs as a Context mode. The launches layer owns its Satellites dependency, including the rule that a Satellites off asked for after Space Missions was switched on ends it (request order decides), and a small controller connects the layer to its own panel and store. Context no longer isolates, snapshots or restores Space Missions or Satellites, so Contacts and Space Missions run together in either order, and scene playback no longer exits an isolating mode. Settled by the owner: Contacts leaves Satellites as it is, and only a person's or voice Satellites off ends Space Missions; a scene, story, preset or other programmatic off does not. Turning the layer on by hand or by voice, choosing it at first run, or picking a mission on the globe opens the Space Missions panel, and on a phone its Missions sheet. Asking voice to open the panel while the layer is off is refused with a reason, and voice never opens it while the Cockpit owns the screen. With no Context mode on, a voice Context off switches Space Missions off. A failed Satellites restore no longer cuts the layer's teardown short. Mission labels on the globe select their mission. The layer names a failed first index load itself, so the Context toast no longer imports Space Missions code. Also carries the satellites request ordering and DataLayerManager.waitForLayerIdle, the share token for the panel, voice panel ids, Cockpit folding the panel away and the phone tab ellipsis. The panel shares the rail gutters and hover border of the other side panels. On top of the Omnibar: "open space missions panel" reaches the new panel, and Open Context no longer answers to "missions". Co-authored-by: Sameh Khamis <[email protected]>
This commit is contained in:
1 parent
8b2ca602e5
commit
0a6fd5f43f
101 files changed
+2885
-1673
No files matched your search
@@ -3,17 +3,17 @@ import { storeToRefs } from 'pinia';
|
||||
import { nextTick, ref, watch } from 'vue';
|
||||
import { t } from '../../../i18n/index.js';
|
||||
import UiSlider from '../../kit/UiSlider.js';
|
||||
import { useContextStore } from '../../stores/context.js';
|
||||
import { useSpaceMissionsStore } from '../../stores/spaceMissions.js';
|
||||
import UiButton from '../../kit/UiButton.vue';
|
||||
|
||||
// The selected space mission inside Context. The launches layer presents it
|
||||
// The selected space mission. The launches layer presents it
|
||||
// and hides the panel while none is selected; the roster beside it hides
|
||||
// while it shows. Buttons call the layer's panel commands.
|
||||
const { mission: m, missionsLayer: layer } = storeToRefs(useContextStore());
|
||||
const { mission: m, layer } = storeToRefs(useSpaceMissionsStore());
|
||||
const root = ref(null);
|
||||
|
||||
// Each newly presented selection returns the Context panel to the top.
|
||||
const SCROLLER = '.global-context-panel-inner';
|
||||
// Each newly presented selection returns the mission panel to the top.
|
||||
const SCROLLER = '.space-missions-panel-inner';
|
||||
watch(
|
||||
() => m.value?.scrollRequest,
|
||||
async (request) => {
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { onBeforeUpdate, onUpdated, ref } from 'vue';
|
||||
import { t } from '../../../i18n/index.js';
|
||||
import { useContextStore } from '../../stores/context.js';
|
||||
import { useSpaceMissionsStore } from '../../stores/spaceMissions.js';
|
||||
import UiEmpty from '../../kit/UiEmpty.vue';
|
||||
|
||||
// The Space Missions roster. The launches layer presents it; until it does,
|
||||
// the list shows its loading line. Hover and keyboard focus drive the
|
||||
// layer's preview, and a click selects the mission.
|
||||
const { missionRoster: roster, missionsLayer: layer } = storeToRefs(useContextStore());
|
||||
const { roster, layer } = storeToRefs(useSpaceMissionsStore());
|
||||
const root = ref(null);
|
||||
|
||||
const CONTINUATION = '[data-mission-roster-focus-continuation]';
|
||||
|
||||
@@ -1,19 +1,25 @@
|
||||
<script setup>
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { computed } from 'vue';
|
||||
import { t } from '../../../i18n/index.js';
|
||||
import { useDisplayStore } from '../../stores/display.js';
|
||||
import { useSpaceMissionsStore } from '../../stores/spaceMissions.js';
|
||||
|
||||
// The phone shell's tab bar and sheet backdrop. They join the end of the
|
||||
// page when the shell first publishes, after the scene's credits, and leave
|
||||
// it when the shell is destroyed; desktop CSS hides them meanwhile.
|
||||
const { phoneShell: phone } = storeToRefs(useDisplayStore());
|
||||
const { enabled: missionsEnabled } = storeToRefs(useSpaceMissionsStore());
|
||||
const tabs = computed(() =>
|
||||
phone.value?.tabs.filter((tab) => tab.sheet !== 'missions' || missionsEnabled.value),
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Teleport v-if="phone" to="body">
|
||||
<div id="mobile-sheet-backdrop" :hidden="!phone.sheet"></div>
|
||||
<nav id="mobile-tab-bar" :aria-label="t('Panels')" :aria-hidden="String(!phone.enabled)">
|
||||
<button v-for="tab in phone.tabs" :key="tab.sheet" type="button" class="mobile-tab" :data-mobile-sheet="tab.sheet" :aria-expanded="String(phone.sheet === tab.sheet)"><span class="material-symbols-outlined mobile-tab-icon" aria-hidden="true">{{ tab.icon }}</span><span class="mobile-tab-label">{{ t(tab.label) }}</span></button>
|
||||
<button v-for="tab in tabs" :key="tab.sheet" type="button" class="mobile-tab" :data-mobile-sheet="tab.sheet" :aria-expanded="String(phone.sheet === tab.sheet)"><span class="material-symbols-outlined mobile-tab-icon" aria-hidden="true">{{ tab.icon }}</span><span class="mobile-tab-label">{{ t(tab.label) }}</span></button>
|
||||
</nav>
|
||||
</Teleport>
|
||||
</template>
|
||||
@@ -0,0 +1,43 @@
|
||||
<script setup>
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { nextTick, ref, watch } from 'vue';
|
||||
import { t } from '../../../i18n/index.js';
|
||||
import RailPanel from '../../rail/RailPanel.vue';
|
||||
import { useSpaceMissionsStore } from '../../stores/spaceMissions.js';
|
||||
import MissionDetail from './MissionDetail.vue';
|
||||
import MissionRoster from './MissionRoster.vue';
|
||||
|
||||
const { enabled, mission } = storeToRefs(useSpaceMissionsStore());
|
||||
const host = ref(null);
|
||||
|
||||
watch(
|
||||
() => Boolean(mission.value),
|
||||
async (selected) => {
|
||||
// Keep keyboard focus in the panel when the selected mission replaces the roster.
|
||||
if (!host.value?.contains(document.activeElement)) return;
|
||||
await nextTick();
|
||||
const control = selected
|
||||
? '[data-mission-close]'
|
||||
: '[data-mission-roster-id]';
|
||||
host.value?.querySelector(control)?.focus();
|
||||
},
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<RailPanel
|
||||
id="space-missions-panel"
|
||||
:title="t('Space Missions')"
|
||||
:hidden="!enabled"
|
||||
:glow="false"
|
||||
start-collapsed
|
||||
sideways
|
||||
scroll
|
||||
rail-scroller
|
||||
>
|
||||
<div id="space-mission-panel-host" ref="host">
|
||||
<MissionRoster />
|
||||
<MissionDetail />
|
||||
</div>
|
||||
</RailPanel>
|
||||
</template>
|
||||
Reference in new issue
Block a user