diff --git a/starpilot/system/the_galaxy/assets/components/tools/device_settings.js b/starpilot/system/the_galaxy/assets/components/tools/device_settings.js index 392d9a3d2..c2e440285 100644 --- a/starpilot/system/the_galaxy/assets/components/tools/device_settings.js +++ b/starpilot/system/the_galaxy/assets/components/tools/device_settings.js @@ -42,6 +42,7 @@ const VEHICLE_SETTING_MAKES = { SNGHack: ["Lexus", "Toyota"], ToyotaAutoHold: ["Lexus", "Toyota"], } +const RADAR_REQUIRED_KEYS = new Set(["HumanLaneChanges", "RadarTakeoffs"]) // Plain variables — scheduling/routing flags that must NOT be reactive let syncScheduled = false @@ -103,6 +104,7 @@ function isVehicleSettingVisible(section, param) { function isSettingVisible(section, param) { // This policy controls Galaxy rendering only; hidden params retain their stored values. if (HIDDEN_SETTING_KEYS.has(param.key) || !isVehicleSettingVisible(section, param)) return false + if (RADAR_REQUIRED_KEYS.has(param.key) && !state.values.HasRadar) return false if (state.values[GALAXY_DEVELOPER_MODE_KEY]) return true return section.name === "Favorites" || param.settings_tier === "simple" } diff --git a/starpilot/system/the_galaxy/the_galaxy.py b/starpilot/system/the_galaxy/the_galaxy.py index 9db2a1bb5..9c058bbad 100644 --- a/starpilot/system/the_galaxy/the_galaxy.py +++ b/starpilot/system/the_galaxy/the_galaxy.py @@ -3075,6 +3075,17 @@ def _get_starpilot_toggles_snapshot(): except Exception: return {} +def _get_has_radar(): + cp_bytes = _safe_params_get_live_raw("CarParamsPersistent") + if not cp_bytes: + return False + + try: + with car.CarParams.from_bytes(cp_bytes) as cp: + return not bool(getattr(cp, "radarUnavailable", False)) + except Exception: + return False + def _get_hardware_snapshot_items(): starpilot_toggles = _get_starpilot_toggles_snapshot() @@ -4697,6 +4708,8 @@ def setup(app): except Exception: result[key] = None + result["HasRadar"] = _get_has_radar() + return jsonify(_sanitize_json_value(result)), 200 @app.route("/api/params/defaults", methods=["GET"])