Make a reset inside Contacts the detection that leaving puts back

Contacts lends detection for the session and puts back the earlier state
on leaving; a share link carries that earlier state. A reset in Visual is
the user's choice, so it becomes both.

Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-14 15:31:33 -08:00
1 parent 63dc5756d5
commit a1e7b2a394
4 files changed
+48 -1

No files matched your search

+14
View File
@@ -355,6 +355,20 @@ export class VisualSettings {
this._syncShareState();
}
/**
* While Contacts holds detection, make the detection shown now the state
* leaving Contacts puts back (and a share link carries): the user chose it,
* as with Reset in Visual. Nothing changes outside Contacts.
*/
adoptDetectionAsRestore() {
if (!this._contactsDetectionRestore) return;
const state = this.getDetectionState();
this._contactsDetectionRestore = {
mode: state.detectionMode,
densityPct: state.densityPct,
};
}
_setCockpitVision(mode, active, { revealParameters = false } = {}) {
const next = active ? normalizeCockpitVisionMode(mode) : 'optical';
if (!this.stages) return;