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:
Manjunath PaparajuandSameh Khamis authored and Sameh Khamis committed 2026-11-18 16:03:51 -08:00
1 parent 8b2ca602e5
commit 0a6fd5f43f
101 files changed
+2885 -1673

No files matched your search

+21 -1
View File
@@ -190,6 +190,9 @@ function topHitOf(hit, foreign) {
* @typedef {object} InputDispatcher
* @property {(fn: (event: ClickEvent) => void) => () => void} onClick
* Ambient click subscription. Returns its unsubscribe.
* @property {(fn: (event: ClickEvent) => boolean) => () => void} onOverlayClick
* Hit-test a painted overlay before ambient clicks. Return true after
* handling its topmost target to stop delivery to the geometry beneath it.
* @property {(type: 'down'|'move'|'up'|'click'|'dblclick', fn: Function, options?: {lease?: object|(() => object|null)}) => () => void} onPointer
* Raw pointer subscription: `click` gets the {@link ClickEvent}, the others
* `{position}` (`move`: `{startPosition, endPosition, pickPosition}`, its
@@ -267,6 +270,7 @@ function createDispatcher(viewer, { query: givenQuery, ...portOptions } = {}) {
const queryOf = () => givenQuery ?? findQuery(viewer);
/** @type {Array<{fn: Function}>} */
const clickSubscribers = [];
const overlayClicks = new Set();
/** @type {Record<string, Array<{fn: Function, lease: object|null}>>} */
const pointerSubscribers = Object.fromEntries(
POINTER_TYPES.map((type) => [type, []]),
@@ -333,6 +337,15 @@ function createDispatcher(viewer, { query: givenQuery, ...portOptions } = {}) {
xy(ev.position),
ev.gesture ?? { travelPx: 0, durationMs: 0 },
);
if (ambient) {
for (const handle of [...overlayClicks]) {
try {
if (handle(event) === true) return;
} catch (error) {
console.error('Pointer input handler failed', error);
}
}
}
run(pointerSubscribers.click, ambient, event);
if (ambient) run(clickSubscribers, true, event);
},
@@ -357,6 +370,12 @@ function createDispatcher(viewer, { query: givenQuery, ...portOptions } = {}) {
return subscribe(clickSubscribers, { fn, lease: null });
},
onOverlayClick(fn) {
if (destroyed) return () => {};
overlayClicks.add(fn);
return () => overlayClicks.delete(fn);
},
onPointer(type, fn, { lease = null } = {}) {
const list = pointerSubscribers[type];
if (!list) throw new TypeError(`Unknown pointer event: ${type}`);
@@ -395,7 +414,7 @@ function createDispatcher(viewer, { query: givenQuery, ...portOptions } = {}) {
subscriberCount() {
return POINTER_TYPES.reduce(
(sum, type) => sum + pointerSubscribers[type].length,
clickSubscribers.length,
clickSubscribers.length + overlayClicks.size,
);
},
@@ -404,6 +423,7 @@ function createDispatcher(viewer, { query: givenQuery, ...portOptions } = {}) {
destroyed = true;
if (dispatchers.get(viewer) === self) dispatchers.delete(viewer);
clickSubscribers.length = 0;
overlayClicks.clear();
for (const type of POINTER_TYPES) pointerSubscribers[type].length = 0;
for (const off of offPort) off();
bridge.off();
+31
View File
@@ -129,6 +129,37 @@ test('a click nobody reads is never picked', (t) => {
assert.equal(h.calls.pick, 0);
});
test('a painted overlay can claim a click before its underlying owner', (t) => {
registerPickOwner('satellites', (id) => id === '25544');
t.after(() => unregisterPickOwner('satellites'));
const h = harness({ pick: () => ({ id: '25544' }) });
t.after(() => h.input.destroy());
const clicks = [];
h.input.onClick((event) => clicks.push(event.ownerId));
const offOverlay = h.input.onOverlayClick(({ screenPosition }) => {
if (screenPosition.x !== 10) return false;
clicks.push('mission label');
return true;
});
h.input.onPointer('click', () => clicks.push('ambient pointer'));
h.click();
assert.deepEqual(clicks, ['mission label']);
assert.equal(h.calls.pick, 0);
h.click(11, 10);
offOverlay();
h.click();
assert.deepEqual(clicks, [
'mission label',
'ambient pointer',
'satellites',
'ambient pointer',
'satellites',
]);
});
test('the gesture carries summed travel and press time', (t) => {
const h = harness();
t.after(() => h.input.destroy());