Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions dash-apps/web-ambient/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,8 @@
const ambientLayer = document.getElementById("ambientLayer");

function mapAssist(car) {
if (car.dataSourceType !== "comma") return "off";
if (car.adasOn) return "full";
if (car.madsActive) return "mads";
if (car.madsActive && car.dataSourceType === "comma") return "mads";
return "off";
}

Expand Down
7 changes: 4 additions & 3 deletions dash-apps/web-analog/scripts/dashboard-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@
}

function normalizeModeState(raw) {
if (raw?.dataSourceType !== "comma") return "off";
const sunnypilot = raw?.dataSourceType === "comma";
const direct = String(raw?.state || raw?.mode || "").toLowerCase();
if (direct === "off" || direct === "mads" || direct === "full") return direct;
if (direct === "off" || direct === "full") return direct;
if (direct === "mads") return sunnypilot ? "mads" : "off";
if (raw?.fullAdas || raw?.adasEnabled || raw?.adasOn) return "full";
if (raw?.madsEnabled || raw?.madsActive) return "mads";
if (raw?.madsEnabled || raw?.madsActive) return sunnypilot ? "mads" : "off";
return "off";
}

Expand Down
7 changes: 3 additions & 4 deletions dash-apps/web-retro/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
gap: calc(12 * var(--u));
}

.mode-strip-inner.hidden {
.mode-text.hidden {
visibility: hidden;
}

Expand Down Expand Up @@ -639,7 +639,6 @@
iconLim: document.getElementById('icon-lim'),
modeMads: document.getElementById('mode-mads'),
modeFull: document.getElementById('mode-full'),
modeStripInner: document.querySelector('.mode-strip-inner'),
stage: document.getElementById('stage'),
bs: {},
};
Expand Down Expand Up @@ -757,7 +756,7 @@
const gear = GEAR_MAP[Math.round(Number(car.gear) || 0)] || GEAR_FALLBACK;
const isDrive = gear === 'D';
const showSunnypilotModes = car.dataSourceType === 'comma';
const adasOn = showSunnypilotModes && !!car.adasOn;
const adasOn = !!car.adasOn;
const mads = showSunnypilotModes && !!car.madsActive;
const imp = !!car.isImperial;

Expand All @@ -782,7 +781,7 @@

// Mode strip + set speed — show state below, keep right display numeric only
setModeState(adasOn ? 'full' : (mads ? 'mads' : ''));
UI.modeStripInner.classList.toggle('hidden', !showSunnypilotModes);
UI.modeMads.classList.toggle('hidden', !showSunnypilotModes);
fillDisp14(UI.setDisp, adasOn && setSpd > 0 ? formatDisplayValue(setSpd) : BLANK_DISPLAY, 'md');

// Speed limit
Expand Down
Loading