diff --git a/openpilot/starpilot/galaxy/web/css/galaxy.css b/openpilot/starpilot/galaxy/web/css/galaxy.css index 943f86705b..4bddd4c088 100644 --- a/openpilot/starpilot/galaxy/web/css/galaxy.css +++ b/openpilot/starpilot/galaxy/web/css/galaxy.css @@ -1454,6 +1454,7 @@ input[type="checkbox"]:disabled { opacity: .4; cursor: not-allowed; } .gx-aa-step__head { display: flex; align-items: flex-start; gap: var(--sp-4); min-width: 0; } .gx-aa-step__head h3 { margin: 2px 0 var(--sp-1); font-size: var(--fs-lg); } .gx-aa-step__head p { margin: 0; color: var(--text-muted); line-height: 1.45; } +.gx-aa-step__head > .gx-btn { margin-left: auto; flex: none; } .gx-aa-step__num { flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--primary-container); color: var(--on-primary-container); font-weight: var(--fw-bold); } .gx-aa-step--done .gx-aa-step__num { background: var(--success); color: var(--background); } diff --git a/openpilot/starpilot/galaxy/web/js/android-auto.js b/openpilot/starpilot/galaxy/web/js/android-auto.js index bf5fc49148..c78e41ee73 100644 --- a/openpilot/starpilot/galaxy/web/js/android-auto.js +++ b/openpilot/starpilot/galaxy/web/js/android-auto.js @@ -461,7 +461,7 @@ export const AndroidAutoPage = { setup: null, pairing: null, selected: null, runtime: null, receivers: [], endReason: "", busy: false, error: "", pairValue: "", packageFile: null, uploadProgress: null, installOpen: false, removeOpen: false, installAttempted: false, installBaseline: null, downloadStarted: false, packageMagicError: "", packageChecking: false, packageSelection: 0, - installFileName: "", pairWhenReady: false, enableOpen: false, showSteps: false + installFileName: "", pairWhenReady: false, enableOpen: false, showSteps: false, starting: false, supportOpen: false }), mounted() { this.feed = new AndroidAutoFeed({ publish: (value) => Object.assign(this, value), unauthorized: this.unauthorized }) @@ -499,6 +499,7 @@ export const AndroidAutoPage = { // Waiting or retrying is not a connection: only a live link blocks changes, and those stop the wait first. linked() { return ["streaming", "suspended"].includes(this.runtime?.state) }, waiting() { return !!this.runtime?.running && !this.linked }, + supportCollapsed() { return this.supportReady && this.setup.installReady && !this.supportOpen }, setupDone() { return !!(this.supportReady && (this.selected || this.wired || this.app) && !this.pairing?.active && !(this.adapterSetup && this.runtime?.car_profile_source !== "override")) @@ -604,6 +605,21 @@ export const AndroidAutoPage = { if (this.wiredJetlinkBusy) return "Turn off Jetlink first." return "" }, + pairSteps() { + const state = this.pairing?.state, active = !!this.pairing?.active + const paired = ["paired", "connected"].includes(state) + const picked = !!(this.pairing?.receiver || this.pairing?.approved || ["pairing", "connecting"].includes(state) || paired) + const what = this.adapterSetup ? "adapter" : "car" + const rank = paired ? 4 : this.pairing?.prompt ? 3 : picked ? 2 : active ? 1 : 0 + const steps = [ + `Start the search${this.starting ? "…" : ""}`, + `Put your ${what} in pairing mode, then pick it from the list`, + "Confirm the code on both screens", + "Paired" + ] + return steps.map((label, index) => ({ label, status: index < rank ? "done" : index === rank ? "active" : "pending" })) + }, + showPairSteps() { return this.starting || !!this.pairing?.active }, waitingForCar() { return this.pairing?.active && !this.pairing?.receiver && !this.pairing?.prompt && !this.pairing?.approved && !["pairing", "connecting", "paired", "connected", "failed"].includes(this.pairing?.state) @@ -669,6 +685,10 @@ export const AndroidAutoPage = { this.finishEnable(enabled) return enabled }, + async beginPairing() { + this.starting = true + try { return await this.startPairing() } finally { this.starting = false } + }, startPairing() { if (this.pairingReason) return false const stopping = this.stopWaiting() @@ -780,13 +800,14 @@ export const AndroidAutoPage = { -
    +
    1. -

      Android Auto Support

      Turn on Android Auto and install support. Wireless pairing also needs Bluetooth on; Galaxy will offer to enable it.

      +

      Android Auto Support

      {{ expiry.label }}

      Turn on Android Auto and install support. Wireless pairing also needs Bluetooth on; Galaxy will offer to enable it.

      +
      -
      +

      Not available on this build — the Android Auto display and encoder are missing.