iPhone FoldGate

This commit is contained in:
firestar5683
2026-09-09 15:32:38 -05:00
parent 50e2c21dbd
commit eedd73e522
54 changed files with 4210 additions and 216 deletions
@@ -34,7 +34,7 @@ const VEHICLE_SETTING_MAKES = {
RemoteStartBootsComma: GM_MAKES,
HKGRemoteStartBootsComma: HKG_MAKES,
VoltSNG: ["Chevrolet", "Holden"],
GMAutoHold: ["Chevrolet", "Holden"],
GMAutoHold: ["Buick", "Chevrolet", "Holden"],
VoltOnePedalMode: ["Chevrolet", "Holden"],
RemapCancelToDistance: ["Chevrolet", "Holden"],
JeepBrakeHold: ["Jeep"],
@@ -490,7 +490,7 @@ function numericBounds(param) {
return { min: 1, max: 101, step: 1 }
}
if (param.key === "ScreenBrightnessOnroad") {
return { min: 1, max: 101, step: 1 }
return { min: 0, max: 101, step: 1 }
}
if (param.key === "LaneCenterOffset") {
@@ -62,7 +62,7 @@ const VEHICLE_SETTING_MAKES = {
RemoteStartBootsComma: ["Buick", "Cadillac", "Chevrolet", "GMC", "Holden"],
HKGRemoteStartBootsComma: ["Genesis", "Hyundai", "Kia"],
VoltSNG: ["Chevrolet", "Holden"],
GMAutoHold: ["Chevrolet", "Holden"],
GMAutoHold: ["Buick", "Chevrolet", "Holden"],
VoltOnePedalMode: ["Chevrolet", "Holden"],
RemapCancelToDistance: ["Chevrolet", "Holden"],
JeepBrakeHold: ["Jeep"],
@@ -140,9 +140,12 @@ export function numericBounds(param, values = {}) {
const n = Number(value)
return Number.isFinite(n) ? n : null
}
if (param.key === "ScreenBrightness" || param.key === "ScreenBrightnessOnroad") {
if (param.key === "ScreenBrightness") {
return { min: 1, max: 101, step: 1 }
}
if (param.key === "ScreenBrightnessOnroad") {
return { min: 0, max: 101, step: 1 }
}
if (param.key === "LaneCenterOffset") {
return { min: -0.3, max: 0.3, step: 0.01 }
}
@@ -26,6 +26,7 @@ export const SystemTools = {
fastStatus: null,
checkedForUpdates: false,
busy: "",
autoUpdateBusy: false,
profiles: [],
profileBusy: "",
}
@@ -77,6 +78,7 @@ export const SystemTools = {
const status = await api.getUpdateFastStatus()
if (!status) throw new Error("Update status unavailable")
this.fastStatus = status
this.isOnroad = !!status.isOnroad
} catch (e) {
this.fastStatus = null
if (throwOnError) throw e
@@ -195,6 +197,21 @@ export const SystemTools = {
this.busy = ""
}
},
async setAutomaticUpdates(enabled) {
if (this.autoUpdateBusy || this.isOnroad || this.fastStatus?.running || !this.fastStatus) return
const previous = !!this.fastStatus.automaticUpdates
this.autoUpdateBusy = true
this.fastStatus = { ...this.fastStatus, automaticUpdates: !!enabled }
try {
const payload = await api.updateParam({ key: "AutomaticUpdates", value: !!enabled, label: "Automatic Updates" })
showSnackbar(payload?.message || `Automatic updates ${enabled ? "enabled" : "disabled"}.`)
} catch (e) {
this.fastStatus = { ...this.fastStatus, automaticUpdates: previous }
showSnackbar(e?.message || "Failed to update Automatic Updates.", "error")
} finally {
this.autoUpdateBusy = false
}
},
async applyFastUpdate() {
if (this.busy || this.isOnroad) return
if (this.fastStatus?.running) { showSnackbar("Fast update is already running."); return }
@@ -301,6 +318,22 @@ export const SystemTools = {
</div>
</div>
<div class="gx-card" style="margin-bottom:12px;">
<div class="gx-row" style="border-top:none;">
<div class="gx-row__info">
<span class="gx-row__label">Automatically Install Updates</span>
<span class="gx-row__desc">Install updates automatically while parked with an active internet connection.</span>
</div>
<label class="gx-switch">
<input type="checkbox" :checked="!!fastStatus?.automaticUpdates"
:disabled="!fastStatus || isOnroad || autoUpdateBusy || !!fastStatus?.running"
@change="setAutomaticUpdates($event.target.checked)" />
<span class="gx-switch__track"></span>
<span class="gx-switch__thumb"></span>
</label>
</div>
</div>
<div class="gx-card" style="margin-bottom:12px;">
<div class="gx-section__header"><i class="bi bi-git-branch"></i><span class="gx-section__title">Switch Branch</span></div>
<div style="padding: var(--sp-3);">
@@ -80,6 +80,14 @@ def test_ui_ports_developer_mode_gating():
assert "isAdvancedHiddenByDeveloperMode" in params
def test_ui_exposes_gm_auto_hold_to_buick():
params = _read("js/params.js")
device_settings = (REPO_ROOT / "starpilot/system/the_galaxy/assets/components/tools/device_settings.js").read_text(encoding="utf-8")
assert 'GMAutoHold: ["Buick", "Chevrolet", "Holden"]' in params
assert 'GMAutoHold: ["Buick", "Chevrolet", "Holden"]' in device_settings
def test_ui_restores_hierarchical_sub_toggle_rendering():
# Children must nest under parents via the recursive SettingTree, gated on
# the parent being enabled AND expanded (classic renderSettingTree contract).
@@ -509,6 +517,10 @@ def test_ui_mobile_polish_regressions():
assert "checkedForUpdates && !!this.fastStatus?.updateAvailable" in system
assert "gx-update-progress__fill" in system
assert "linear-gradient(90deg, #5ec8c8 0%, #8b6cc5 100%)" in css
assert "Automatically Install Updates" in system
assert 'key: "AutomaticUpdates"' in system
assert "!!fastStatus?.automaticUpdates" in system
assert "isOnroad || autoUpdateBusy || !!fastStatus?.running" in system
bluetooth = _read("js/components/BluetoothPanel.js")
assert "methods: {\n address," in bluetooth