Keep the ridden aircraft's layer when Contacts ends, and clear its rows from Live Signals

Riding an aircraft now adopts its layer the way a direct selection does, and
Contacts gives up a dependency the user adopts, so ending Contacts mid-session
(one of its layers off, or Contacts itself) no longer turns off the ridden
layer and ends the Cockpit. When Contacts goes off, Live Signals drops the
rows built from its snapshot instead of leaving stale distances marked
CURRENT, and the feed-off warning is no longer duplicated.
This commit is contained in:
Sameh Khamis committed 2026-11-05 14:01:17 -08:00
1 parent 459b0e8a71
commit 63fd559496
14 files changed
+441 -16

No files matched your search

+21
View File
@@ -74,6 +74,27 @@ export function dropCockpitSignal(key) {
this.publishCockpitSignals();
}
/** Whether a row is one a Contacts snapshot builds, with its status rows. */
const isContextSnapshotRow = (key) =>
key.startsWith('flight:') ||
['input-status', 'feed-status', 'context-status'].includes(key);
/**
* Take off every row a Contacts snapshot built, as when Contacts goes off:
* its contacts, distances and CURRENT would otherwise read as live. Rows the
* session made without Contacts, such as TRACK ACQUIRED, stay.
*/
export function dropContextSnapshotSignals() {
for (const key of [...this.signalSignatures.keys()])
if (isContextSnapshotRow(key)) this.signalSignatures.delete(key);
const kept = this.signalItems.filter(
(item) => !isContextSnapshotRow(item.key),
);
if (kept.length === this.signalItems.length) return;
this.signalItems = kept;
this.publishCockpitSignals();
}
/**
* Rebuild the rows from a Contacts snapshot: the nearest flights, a row for
* unknown inputs and, first, a row naming an air feed that is off.