feat(cockpit): enter Cockpit with only the ridden aircraft's layer on

Cockpit entry no longer needs Contacts or both flight feeds: a civilian
aircraft needs Live Flights, a military one Military Flights. Contacts and
every other layer can be turned on or off before or during a session, and
turning off the ridden layer ends it. A Context mode change in flight still
blocks entry.

When the other air feed is off, Live Signals and the Contact card say
FLIGHTS FEED OFF or MILITARY FEED OFF · PARTIAL PICTURE instead of
presenting a partial picture as complete. Voice refuses entry with
subject-layer-off rather than contacts-inactive, and its tool description
says Contacts is not required.

Double-clicking the followed aircraft enters Cockpit through the same gate.
The Cockpit takes the scene's double-click before Cesium's stock handler,
which would otherwise untrack a followed aircraft whose model is a
primitive. The entry also shows under the Intel HUD readout, sharing the
Contacts button's face. A test keeps the classes the Cockpit adds to the
body from matching another element's rule.
This commit is contained in:
Denis Groshev committed 2026-11-04 21:53:05 +01:00
1 parent 82f17e694e
commit 219f3e1079
37 files changed
+964 -134

No files matched your search

+57
View File
@@ -204,6 +204,63 @@ test('without a snapshot the card stands by, hidden', async (t) => {
assert.equal(signals.at(-1)[2], 'CONTEXT STANDBY');
});
test('a feed that is off makes the card and Live Signals say the picture is partial', async (t) => {
// Every input known, so only the feed that is off can make it partial.
const { $, text, owner } = fixture(
t,
snapshot({
cohorts: [
{
id: 'flights',
label: 'Flights',
count: 12,
relationship: 'OBSERVED',
nearest: [{ id: 'N1', distanceM: 4200 }],
},
],
}),
);
const rebuilt = [];
owner.updateCockpitSignals = (...args) => rebuilt.push(args);
owner.services.isLayerEnabled = () => true;
updateContext.call(owner, INFO, 0);
await nextTick();
assert.equal($('#cockpit-context').dataset.state, 'current');
assert.equal(rebuilt.at(-1)[2], null, 'both feeds on: nothing to add');
owner.services.isLayerEnabled = (layerId) => layerId !== 'military';
updateContext.call(owner, INFO, 0);
await nextTick();
assert.equal($('#cockpit-context').dataset.state, 'uncertain');
assert.equal(
text('#cockpit-context-uncertainty'),
'MILITARY FEED OFF · PARTIAL PICTURE',
);
assert.deepEqual(rebuilt.at(-1)[2], {
title: 'MILITARY FEED OFF · PARTIAL PICTURE',
detail: 'NEARBY AIRCRAFT INCOMPLETE · NOT AN ALL-CLEAR',
});
});
test('without Contacts, a feed that is off adds a signal until it is back', async (t) => {
const { owner, signals } = fixture(t, null);
const dropped = [];
owner.dropCockpitSignal = (key) => dropped.push(key);
// Riding a military aircraft with Live Flights off.
owner.services.isLayerEnabled = (layerId) => layerId === 'military';
updateContext.call(owner, { ...INFO, layerId: 'military' }, 0);
assert.equal(signals.at(-2)[2], 'CONTEXT STANDBY');
assert.deepEqual(signals.at(-1), [
'feed-status',
'warning',
'FLIGHTS FEED OFF · PARTIAL PICTURE',
'NEARBY AIRCRAFT INCOMPLETE · NOT AN ALL-CLEAR',
]);
owner.services.isLayerEnabled = () => true;
updateContext.call(owner, { ...INFO, layerId: 'military' }, 0);
assert.deepEqual(dropped, ['feed-status']);
});
test('the weather toggle renders its state and the action it offers', async (t) => {
const { $, text, owner } = fixture(t);
syncWeatherToggle.call(owner, true);