diff --git a/openpilot/starpilot/galaxy/tests/browser/settings-state.cjs b/openpilot/starpilot/galaxy/tests/browser/settings-state.cjs
index 203c09e9e1..494effe1cb 100644
--- a/openpilot/starpilot/galaxy/tests/browser/settings-state.cjs
+++ b/openpilot/starpilot/galaxy/tests/browser/settings-state.cjs
@@ -152,12 +152,12 @@ const { execFileSync } = require('node:child_process')
['onroad-layout', 'OnroadLayoutPage', prepareLayout],
['onroad-layout', 'OnroadLayoutPage', prepareLayout, { projection: true }],
['models', 'ModelsPage', prepareModels],
- ['model-laboratory', 'LaboratoryPage', vm => Object.assign(vm, { loading: false,
- configuration: { enabled: false, lateralModel: 'one', longitudinalModel: 'two' }, status: {
+ ['models', 'ModelsPage', vm => { prepareModels(vm); Object.assign(vm, { pairView: 'pair',
+ labConfig: { enabled: false, lateralModel: 'one', longitudinalModel: 'two' }, lab: {
configuration: { enabled: false, lateralModel: 'one', longitudinalModel: 'two' },
- isOnroad: false, runtimeSupported: true, chestnutReady: true, runtime: {}, download: { downloading: false },
+ isOnroad: false, runtimeSupported: true, chestnutReady: true, runtime: {}, download: { downloading: false }, summary: { published: 2 },
models: ['one', 'two'].map(value => ({ value, label: value, small: true, modelLabEligible: true, modelLabArtifactAvailable: true, modelLabArtifactInstalled: true })),
- capabilities: { configure: true, download: true, delete: true, cancel: true, refresh: true } } })],
+ capabilities: { configure: true, download: true, delete: true, cancel: true, refresh: true } } }) }],
['sentry-notifications', 'SentryNotifications', vm => { vm.notifications = { subscriptionCount: 0, subscriptions: [],
channels: Object.fromEntries(vm.channels.map(name => [name, { enabled: true, configured: true, pending: 0, lastState: 'idle', lastError: '' }])) } }],
['drive-state', 'DriveStatePanel', vm => { vm.state = { mode: 'auto', available: true, effective: 'offroad', overrideAllowed: true } }],
@@ -213,13 +213,12 @@ const { execFileSync } = require('node:child_process')
return cases.map(([, name]) => name)
}, layout)
for (const success of [false, true]) {
- await page.getByRole('combobox', { name: /^Active Small/ }).click()
- await page.getByRole('option', { name: 'two', exact: true }).click()
+ await page.getByRole('button', { name: 'Set Active Small' }).click()
await page.waitForFunction(() => !!vm.busy)
- assert.equal(await page.getByRole('combobox', { name: /^Active Small/, includeHidden: true }).textContent(), 'two')
+ assert.equal(await page.locator('.gx-model-summary-item__value').first().textContent(), 'two')
await page.evaluate(success => finishModel(success), success)
await page.waitForFunction(() => !vm.busy)
- assert.equal(await page.getByRole('combobox', { name: /^Active Small/ }).textContent(), success ? 'two' : 'one')
+ assert.equal(await page.locator('.gx-model-summary-item__value').first().textContent(), success ? 'two' : 'one')
}
assert.deepEqual(errors, [])
console.log(`Settings state: ${pages.length} settings pages and ${audited.length} specialized pages; delayed preview/save/readback, Default/download buttons, stable control nodes/opacity and failed-save recovery passed.`)
diff --git a/openpilot/starpilot/galaxy/tests/browser/tab-motion.cjs b/openpilot/starpilot/galaxy/tests/browser/tab-motion.cjs
index 78a4e3d87c..02de6a4581 100644
--- a/openpilot/starpilot/galaxy/tests/browser/tab-motion.cjs
+++ b/openpilot/starpilot/galaxy/tests/browser/tab-motion.cjs
@@ -48,22 +48,27 @@ const assert = require('node:assert/strict')
assert.equal(await page.locator('.gx-route:not([inert])').count(), 1)
assert.equal(await nav.getByRole('button', { name: 'Home', exact: true }).getAttribute('aria-current'), 'page')
+ // The old Model Laboratory link opens the merged Models page at its Laboratory pair section.
await page.goto(base + '#/model_laboratory')
- const heading = page.getByText('Available models', { exact: true })
- await heading.waitFor()
+ const laboratory = page.locator('#gx-model-laboratory')
+ await laboratory.waitFor()
+ await page.waitForFunction(() => {
+ const box = document.querySelector('#gx-model-laboratory').getBoundingClientRect()
+ return box.top >= 0 && box.top < innerHeight
+ })
+ assert.equal(await page.locator('.gx-route:not([inert]) h2').first().textContent(), 'Models')
for (const width of [320, 360, 390, 600, 1280]) {
await page.setViewportSize({ width, height: 900 })
const layout = await page.evaluate(() => {
- const title = [...document.querySelectorAll('.gx-section__title')].find(element => element.textContent === 'Available models')
- const summary = title.closest('.gx-card').querySelector('.gx-summary')
- const cells = [...summary.children].map(element => element.getBoundingClientRect())
- return { headerHeight: title.parentElement.getBoundingClientRect().height,
- summaryHeight: summary.getBoundingClientRect().height,
- equalRows: cells.every(cell => Math.abs(cell.top - cells[0].top) < 1),
+ const header = document.querySelector('.gx-page-header')
+ const modeBar = document.querySelector('.gx-model-mode')
+ const list = document.querySelector('.gx-model-list')
+ return { headerHeight: header.getBoundingClientRect().height,
+ modeBarHeight: modeBar.getBoundingClientRect().height,
+ hasRows: list && list.children.length > 0,
overflow: document.documentElement.scrollWidth > innerWidth }
})
- assert.ok(layout.headerHeight < 80 && layout.summaryHeight < 100, 'model summary stays compact')
- assert.equal(layout.equalRows, true, 'all three counts share one row')
+ assert.ok(layout.headerHeight < 120 && layout.modeBarHeight < 80 && layout.hasRows, 'model headers and row list stay compact')
assert.equal(layout.overflow, false)
}
await page.setViewportSize({ width: 390, height: 900 })
diff --git a/openpilot/starpilot/galaxy/tests/test_model_laboratory.mjs b/openpilot/starpilot/galaxy/tests/test_model_laboratory.mjs
index c95e296231..2f688c9401 100644
--- a/openpilot/starpilot/galaxy/tests/test_model_laboratory.mjs
+++ b/openpilot/starpilot/galaxy/tests/test_model_laboratory.mjs
@@ -1,5 +1,5 @@
import assert from "node:assert/strict"
-import { LaboratoryFeed, LaboratoryPage, laboratoryModels, laboratoryReady, laboratorySelectionError, laboratoryActionAllowed, laboratoryDraft, laboratoryStatusLabel } from "../web/js/model-laboratory.js"
+import { LaboratoryFeed, ModelsPage, laboratoryModels, laboratoryReady, laboratorySelectionError, laboratoryActionAllowed, laboratoryDraft, laboratoryStatusLabel } from "../web/js/models.js"
const model = (value, version = 'v9') => ({ value, label: `Model ${value}`, version, small: true, modelLabEligible: true, modelLabArtifactAvailable: true, modelLabArtifactInstalled: true })
const payload = () => ({ schemaVersion: 1, isOnroad: false, chestnutReady: true, runtimeSupported: true,
@@ -72,24 +72,30 @@ assert.equal(download.requests[1].url,'./api/models/laboratory/download');assert
await download.reply(1,{message:'Starting download'});await download.reply(2,{...p,download:{downloading:true,jobId:'job',progress:'40%'}});await downloading
const canceling=download.feed.action('cancel');assert.equal(download.requests[3].url,'./api/models/cancel');assert.deepEqual(JSON.parse(download.requests[3].options.body),{jobId:'job'})
await download.reply(3,{message:'Cancelling'});await download.reply(4,p);await canceling;download.feed.stop()
-assert.deepEqual([...LaboratoryPage.template.matchAll(/class="gx-section__title">([^<]+)<\/span>/g)].map(match => match[1]),
- ['Compose a pair', 'Available models'])
-for (const label of ['Lateral model', 'Longitudinal model', 'Enable model pair', 'Check model catalog']) {
- const position = LaboratoryPage.template.indexOf(label)
- assert.ok(position >= 0 && position < LaboratoryPage.template.indexOf('v-for="m in availableModels"'),
- `${label} must appear before the model catalog`)
-}
-assert.doesNotMatch(LaboratoryPage.template,/runtimeState|modelLabel\(status\?\.runtime/ )
-assert.match(LaboratoryPage.template,/status\?\.runtime.error/)
-assert.equal(LaboratoryPage.methods.modelLabel.call({status:p},'a'),'Model a')
-assert.equal(LaboratoryPage.methods.modelLabel.call({status:p},'unknown'),'unknown')
-assert.equal(LaboratoryPage.methods.modelLabel.call({status:null},''),'Not selected')
-assert.match(LaboratoryPage.template,/GalaxySelect/)
-assert.match(LaboratoryPage.template,/Catalog models/)
-assert.match(LaboratoryPage.template,/modelLabReason/)
+// Model Laboratory lives on the Models page: Single model / Model pair mode switcher and eGPU variants on the model rows
+const template = ModelsPage.template
+const labCard = template.indexOf('id="gx-model-laboratory"')
+assert.ok(template.indexOf('Single model') < labCard && labCard < template.indexOf('gx-model-list'))
+assert.match(template,/aria-label="Lateral model"/)
+assert.match(template,/aria-label="Longitudinal model"/)
+assert.ok(template.includes(`@click="setDriveMode('pair')"> Model pair`))
+assert.match(template,/Verified downloads/)
+assert.match(template,/eGPU variant/)
+assert.match(template,/Pairable/)
+assert.doesNotMatch(template,/Available models|Compose a pair|Catalog models/)
assert.equal(laboratoryStatusLabel({modelLabStatus:"runtime-unavailable"}), "Downloaded")
assert.equal(laboratoryStatusLabel({modelLabStatus:"unsupported"}), "Not supported")
+assert.doesNotMatch(template,/20 Hz/)
+const save=fixture();save.feed.start();await save.reply(0,p)
+const saving=save.feed.action('save',null,{enabled:true,lateralModel:'b',longitudinalModel:'a'})
+assert.equal(save.requests[1].url,'./api/models/laboratory')
+assert.deepEqual(JSON.parse(save.requests[1].options.body),{enabled:false,lateralModel:'b',longitudinalModel:'a'})
+await save.reply(1,{...p,message:'saved'});await save.reply(2,p);await saving;save.feed.stop()
const performanceNotice = 'Two Big models cannot run together at the required speed. Choose a Small model for one role. Other combinations can also cause model lag warnings.'
-assert.ok(LaboratoryPage.template.includes(performanceNotice))
-assert.doesNotMatch(LaboratoryPage.template.replace(performanceNotice,''),/20 Hz/)
+assert.ok(template.includes(performanceNotice))
+assert.match(template,/lab\.runtime\.error/)
console.log('Model Laboratory contracts passed')
+assert.match(template,/steers · \{\{ labModelLabel\(labConfig\.longitudinalModel\) \}\} paces/)
+assert.match(template,/The pair takes effect the next time the driving model starts/)
+assert.match(template,/labRow\(m\)\?\.small \|\| labRow\(m\)\?\.modelLabEligible/)
+assert.match(template,/Pair lateral judgment from one model with longitudinal judgment from another\./)
diff --git a/openpilot/starpilot/galaxy/tests/test_models.mjs b/openpilot/starpilot/galaxy/tests/test_models.mjs
index 171f63a5da..ffcc3a78d1 100644
--- a/openpilot/starpilot/galaxy/tests/test_models.mjs
+++ b/openpilot/starpilot/galaxy/tests/test_models.mjs
@@ -80,7 +80,7 @@ const listeners = new Map()
globalThis.document = { hidden: false,
addEventListener: (name, fn) => listeners.set(name, fn),
removeEventListener: (name, fn) => { if (listeners.get(name) === fn) listeners.delete(name) } }
-const page = { mode: "local", finishDialog() {}, manager: { start() {}, stop() {} }, feed: { starts: 0, stops: 0, start() { this.starts++ }, stop() { this.stops++ } } }
+const page = { mode: "local", finishDialog() {}, manager: { start() {}, stop() {} }, laboratory: { starts: 0, stops: 0, start() { this.starts++ }, stop() { this.stops++ } }, feed: { starts: 0, stops: 0, start() { this.starts++ }, stop() { this.stops++ } } }
ModelsPage.mounted.call(page)
assert.equal(page.feed.starts, 1)
document.hidden = true
@@ -91,6 +91,7 @@ listeners.get("visibilitychange")()
assert.equal(page.feed.starts, 2)
ModelsPage.beforeUnmount.call(page)
assert.equal(page.feed.stops, 2)
+assert.deepEqual([page.laboratory.starts, page.laboratory.stops], [2, 2])
assert.equal(listeners.size, 0)
globalThis.document = priorDocument
@@ -244,7 +245,8 @@ console.log('Randomizer and exclusion interactions passed')
assert.match(ModelsPage.template, /Selections apply next onroad cycle/)
assert.doesNotMatch(ModelsPage.template, /Onroad: switching/)
-assert.equal((ModelsPage.template.match(/class="gx-model-control"/g) || []).length, 2)
+// Active Small, Active Big summary items, and the Laboratory pair's lateral and longitudinal pickers
+assert.equal((ModelsPage.template.match(/class="gx-model-control[\s"]/g) || []).length, 4)
// the library tab is only a view: every model is one tap away, and a sleeping GPU never hides anything
assert.equal(ModelsPage.data().tab, 'both')
assert.equal(ModelsPage.computed.libraryTab.call({ tab: 'gpu' }), 'gpu')
@@ -411,6 +413,46 @@ const pairPage = { selectionUncertain: false, status: {}, runtime: { status: 're
assert.equal(ModelsPage.computed.runningModelLabel.call(pairPage), 'Small model/Big model')
assert.equal(ModelsPage.computed.runningModelLabel.call({ ...pairPage, runtime: { status: 'stale', data: pairData } }), 'Status unavailable')
assert.equal(ModelsPage.computed.runningModelLabel.call({ ...pairPage, runtime: { status: 'ready', data: { ...pairData, laboratory: { ...pairData.laboratory, active: false } } } }), 'Laboratory output unavailable')
-assert.match(ModelsPage.template, /Turn off Laboratory/)
-assert.match(ModelsPage.template, /href="#\/model_laboratory"/)
assert.match(ModelsPage.template, /fallback choices/)
+
+// Merged page: search, row list, Single model / Model pair mode switcher, and pair saving.
+{
+ const { matchesSearch, laboratoryActionAllowed, hardwareTag } = await import("../web/js/models.js")
+ const row = { value: 'tr16223', label: 'TR16 👀📡', series: 'TR Series', version: 'v8', released: '2025-07-21' }
+ assert.equal(matchesSearch(row, ''), true)
+ assert.equal(matchesSearch(row, 'tr16'), true)
+ assert.equal(matchesSearch(row, 'TR16223'), true)
+ assert.equal(matchesSearch(row, 'tr series v8'), true)
+ assert.equal(matchesSearch(row, 'v9'), false)
+
+ assert.match(ModelsPage.template, /
/)
+ assert.match(ModelsPage.template, /placeholder="Search models…"/)
+ assert.deepEqual([true, false, undefined].map(requiresGpu => hardwareTag({ requiresGpu }).tone), ["egpu", "small", "unknown"])
+
+ const page = { ...ModelsPage.data(), activeSmallModel: 'a', activeBigModel: 'b', currentModel: 'a',
+ lab: { configuration: { enabled: false, lateralModel: 'a', longitudinalModel: 'c' } } }
+ assert.deepEqual(ModelsPage.methods.activeRoles.call(page, { value: 'a' }), ['Active Small'])
+ assert.deepEqual(ModelsPage.methods.activeRoles.call(page, { value: 'b' }), ['Active Big'])
+ assert.deepEqual(ModelsPage.methods.activeRoles.call(page, { value: 'c' }), [])
+ assert.deepEqual(ModelsPage.methods.pairRoles.call(page, { value: 'a' }), ['Pair · lateral'])
+ assert.deepEqual(ModelsPage.methods.pairRoles.call(page, { value: 'c' }), ['Pair · longitudinal'])
+
+ const listed = (extra) => ModelsPage.computed.sorted.call({ ...ModelsPage.data(), libraryTab: 'both', isPairable: m => m.pairable === true,
+ models: [{ value: 'x1', label: 'Alpha', requiresGpu: false, pairable: true }, { value: 'x2', label: 'Beta', requiresGpu: false, pairable: false }], ...extra }).map(m => m.value)
+ assert.deepEqual(listed({ pairableFilter: true }), ['x1'])
+ assert.deepEqual(listed({ search: 'bet' }), ['x2'])
+
+ const lab = { schemaVersion: 1, isOnroad: false, chestnutReady: false, runtimeSupported: false,
+ configuration: { enabled: false, lateralModel: '', longitudinalModel: '' }, download: { downloading: false },
+ capabilities: { configure: true }, models: ['a', 'b'].map(value => ({ value, label: value, small: true, modelLabEligible: true, modelLabArtifactAvailable: true, modelLabArtifactInstalled: true })) }
+ assert.equal(laboratoryActionAllowed(lab, 'save', null, { lateralModel: 'a', longitudinalModel: 'b' }), true)
+ assert.equal(laboratoryActionAllowed(lab, 'save', null, { lateralModel: 'a', longitudinalModel: 'a' }), false)
+ assert.equal(laboratoryActionAllowed(lab, 'save', null, { lateralModel: 'a', longitudinalModel: 'missing' }), false)
+ assert.equal(laboratoryActionAllowed({ ...lab, isOnroad: true }, 'save', null, { lateralModel: 'a', longitudinalModel: 'b' }), false)
+ assert.equal(laboratoryActionAllowed({ ...lab, configuration: { enabled: true, lateralModel: 'a', longitudinalModel: 'b' } }, 'save', null, { lateralModel: 'b', longitudinalModel: 'a' }), false)
+ assert.equal(ModelsPage.computed.labChoiceProblem.call({ labSelectionError: 'Pair inference is not available in this build yet.' }), false)
+ assert.equal(ModelsPage.computed.labChoiceProblem.call({ labSelectionError: 'Choose two different models' }), true)
+ console.log('Merged page search, row list, and pair saving passed')
+}
+
+
diff --git a/openpilot/starpilot/galaxy/tests/test_preview_contract.py b/openpilot/starpilot/galaxy/tests/test_preview_contract.py
index 83d2cd3bf3..8c320fff91 100644
--- a/openpilot/starpilot/galaxy/tests/test_preview_contract.py
+++ b/openpilot/starpilot/galaxy/tests/test_preview_contract.py
@@ -18,7 +18,7 @@ class PreviewContractTest(unittest.TestCase):
self.assertTrue(all(path.startswith("/") and path != "/tools" for path in paths))
self.assertEqual([tool["path"] for tool in catalog["tools"] if tool["availability"] == "partial-preview"], ["/logs"])
self.assertEqual([tool["path"] for tool in catalog["tools"] if tool["availability"] == "local-only"],
- ["/bluetooth", "/cameras", "/galaxy", "/manage_models", "/model_laboratory", "/navigation", "/system",
+ ["/bluetooth", "/cameras", "/galaxy", "/manage_models", "/navigation", "/system",
"/theme_maker", "/tuning", "/starport"])
self.assertEqual([tool["path"] for tool in catalog["tools"] if tool["availability"] == "always"], [])
self.assertTrue(all(tool["availability"] in {"always", "unavailable", "partial-preview", "local-only"} for tool in catalog["tools"]))
diff --git a/openpilot/starpilot/galaxy/web/css/settings.css b/openpilot/starpilot/galaxy/web/css/settings.css
index 5899d9eabe..420f5a50db 100644
--- a/openpilot/starpilot/galaxy/web/css/settings.css
+++ b/openpilot/starpilot/galaxy/web/css/settings.css
@@ -309,62 +309,137 @@ input[type="range"].gx-slider:active::-moz-range-thumb {
.gx-model-control { display: grid; gap: var(--sp-2); min-width: 0; }
.gx-model-control > .gx-field { width: 100%; min-width: 0; }
-.gx-model-manager .gx-card-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.gx-model-manager .gx-card { overflow: visible; }
.gx-model-manager .gx-card > div { min-width: 0; }
.gx-model-manager .gx-card strong, .gx-model-manager .gx-chip { overflow-wrap: anywhere; }
-.gx-model-card > .gx-panel { padding: var(--sp-3) var(--sp-4); }
-.gx-model-card__heading { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
-.gx-model-card__actions { display: flex; flex: none; gap: var(--sp-1); }
.gx-model-reason { margin: var(--sp-3) 0; color: var(--text-muted); font-size: var(--fs-sm); }
-.gx-model-card__reason { margin: 0 var(--panel-padding) var(--sp-3); }
+.gx-model-card__reason { margin: 0; }
-/* Model Manager runs tighter than other pages: smaller card padding and gaps, same tokens */
+/* Models page: mobile-first Material Design 3 layout */
.gx-model-manager { --panel-padding: var(--sp-4); gap: var(--sp-3); }
-.gx-model-manager .gx-btn { min-height: 36px; padding: 6px var(--sp-4); }
+.gx-model-manager .gx-btn, .gx-model-card__progress { min-height: var(--touch-target); padding: 6px var(--sp-4); }
-/* Driving now: two selects side by side, randomizer and running model on one line */
-.gx-model-driving__body { display: grid; gap: var(--sp-3); }
-.gx-model-driving__selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
+/* Mode selector: Material 3 segmented pill */
+.gx-tabs.gx-model-mode { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: var(--radius-full);
+ border: 1px solid var(--glass-border); background: var(--surface-container-high); }
+.gx-model-mode > button { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 40px; border: 0; border-radius: var(--radius-full);
+ background: transparent; color: var(--on-surface-variant); font: inherit; font-weight: var(--fw-bold); cursor: pointer; transition: background-color var(--motion-fast), color var(--motion-fast); }
+.gx-model-mode > button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); box-shadow: 0 4px 12px var(--primary-glow); }
+.gx-model-mode > button:disabled { opacity: .5; cursor: not-allowed; }
+
+/* Driving & Laboratory controls: stacked on mobile, side-by-side on wider viewports */
+.gx-model-driving__body, .gx-model-laboratory { display: grid; gap: var(--sp-3); }
+.gx-model-driving__summary { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
+.gx-model-summary-item { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 8px 12px; border-radius: var(--radius-md); border: 1px solid var(--outline); background: var(--surface-container-high); min-width: 0; }
+.gx-model-summary-item__meta { display: inline-flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap; flex-shrink: 0; }
+.gx-model-summary-item__row { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
+.gx-model-summary-item__value { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--on-surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
+.gx-model-summary-item__value--muted { color: var(--on-surface-variant); font-weight: var(--fw-medium); }
+.gx-model-summary-item__clear { width: 24px; height: 24px; min-width: 24px; min-height: 24px; font-size: .72rem; flex-shrink: 0; }
+.gx-model-driving__selects { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
.gx-model-driving__foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); }
.gx-model-driving__random { flex: 0 1 auto; min-height: 0; padding: 0; gap: var(--sp-3); }
.gx-model-driving__random .gx-row__label { display: inline-flex; align-items: center; gap: var(--sp-2); }
.gx-model-driving .gx-model-reason { margin: 0; }
-
-/* Library toolbar: tabs, sort and favorites, and the two library actions share a line when there is room */
-.gx-model-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); }
-.gx-model-toolbar .gx-guided__segmented { flex: 0 1 auto; flex-wrap: nowrap; }
-.gx-model-toolbar .gx-guided__choice { flex: 0 1 auto; min-height: 36px; padding: 4px var(--sp-3); }
-.gx-model-toolbar__actions { margin-left: auto; flex-wrap: nowrap; }
-.gx-model-toolbar__label { display: none; }
-.gx-model-toolbar__actions > .gx-btn--tonal { flex: none; width: 36px; padding-inline: 0; justify-content: center; }
-.gx-model-tabs__short { display: none; }
-.gx-model-tabs__count { margin-left: var(--sp-1); opacity: .75; font-variant-numeric: tabular-nums; }
-.gx-model-sort { flex: 0 0 auto; width: 9.5rem; }
-.gx-model-sort .gx-select__button { min-height: 32px; padding-block: 2px; }
-.gx-model-filters .gx-chip { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 32px; padding-inline: var(--sp-3); }
-
-/* Cards: one shape. Name and star, a few chips, one action pinned to the bottom so buttons line up across a row. */
-.gx-model-card { display: flex; flex-direction: column; }
-.gx-model-card > .gx-panel { flex: 1 1 auto; align-content: start; padding: var(--sp-3) var(--sp-3) var(--sp-1); display: grid; gap: var(--sp-1); }
-.gx-model-card__heading { flex-wrap: nowrap; min-height: 32px; }
-.gx-model-card__heading > strong { flex: 1 1 auto; min-width: 0; }
-.gx-model-card .gx-icon-btn { height: 32px; min-height: 32px; min-width: 32px; }
-.gx-model-card > .gx-panel-footer { margin-top: auto; }
-.gx-model-card--selected { border-color: var(--primary); }
-.gx-model-card__meta { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: 32px; padding: 0 var(--sp-3) var(--sp-2); color: var(--text-muted); font-size: var(--fs-sm); }
-.gx-model-card__facts { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
-.gx-model-card .gx-tags { gap: var(--sp-1); }
-.gx-model-card .gx-panel-footer { padding: var(--sp-1) var(--sp-3) var(--sp-3); }
-.gx-model-card__foot { display: grid; gap: var(--sp-2); }
-.gx-model-card__foot > .gx-btn { width: 100%; justify-content: center; }
-.gx-model-card__note { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
-.gx-model-card__progress { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px var(--sp-4); border-radius: var(--radius-full); background: var(--primary-container); color: var(--on-surface); font-size: var(--fs-sm); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
-.gx-model-card__progress-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--secondary), var(--primary)); opacity: .6; transition: width .3s ease; }
-.gx-model-card__progress-label { position: relative; text-align: center; overflow-wrap: anywhere; }
.gx-model-driving__random-hint { color: var(--text-muted); font-weight: normal; margin-left: var(--sp-1); }
+/* Library toolbar: mobile-first search, hardware tabs, sort, and filter chips */
+.gx-model-toolbar { display: grid; gap: var(--sp-3); }
+.gx-model-searchbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); min-width: 0; }
+.gx-model-search-wrap { position: relative; flex: 1 1 200px; min-width: 0; display: flex; align-items: center; }
+.gx-model-search__icon { position: absolute; left: 14px; color: var(--text-muted); pointer-events: none; font-size: .95rem; }
+.gx-model-search { width: 100%; min-height: var(--touch-target); padding-left: 38px; border-radius: var(--radius-full); background: var(--surface-container-high); font-size: max(16px, var(--fs-base)); }
+.gx-model-toolbar__actions { display: flex; align-items: center; gap: var(--sp-2); width: 100%; flex-wrap: nowrap; }
+.gx-model-toolbar__actions > .gx-btn:not(.gx-btn--tonal) { flex: 1 1 0; }
+.gx-model-toolbar__actions > .gx-btn--tonal { flex: none; width: var(--touch-target); padding-inline: 0; justify-content: center; }
+.gx-model-toolbar__label { display: none; }
+.gx-model-toolbar__row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); min-width: 0; }
+.gx-model-toolbar .gx-guided__segmented { width: 100%; flex-wrap: nowrap; }
+.gx-model-toolbar .gx-guided__choice { flex: 1 1 0; min-height: 40px; padding: 4px var(--sp-3); }
+.gx-model-tabs__long { display: none; }
+.gx-model-tabs__short { display: inline; }
+.gx-model-tabs__count { margin-left: var(--sp-1); opacity: .75; font-variant-numeric: tabular-nums; }
+.gx-model-sort { flex: 0 0 auto; width: 100%; }
+.gx-model-filters { flex: 1 1 auto; align-items: center; }
+.gx-model-filters .gx-chip { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 40px; padding-inline: var(--sp-3); }
+
+/* Tags: green eGPU, blue Small, orange Pairable, purple Active Small / Big */
+.gx-model-tag { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border: 1px solid; border-radius: var(--radius-full); font-size: .72rem; font-weight: 700; line-height: 1.6; white-space: nowrap; }
+.gx-model-tag i { font-size: .9em; }
+.gx-model-tag--egpu { color: #6ee7a0; background: rgba(110, 231, 160, .12); border-color: rgba(110, 231, 160, .4); }
+.gx-model-tag--small { color: #7cc4ff; background: rgba(124, 196, 255, .12); border-color: rgba(124, 196, 255, .4); }
+.gx-model-tag--pair { color: #fdba74; background: rgba(253, 186, 116, .12); border-color: rgba(253, 186, 116, .4); }
+.gx-model-tag--active { color: var(--on-primary); background: var(--primary); border-color: var(--primary); }
+.gx-model-tag--unknown { color: var(--text-muted); background: transparent; border-color: var(--outline); }
+[data-theme="light"] .gx-model-tag--egpu { color: #15803d; background: rgba(21, 128, 61, .08); border-color: rgba(21, 128, 61, .35); }
+[data-theme="light"] .gx-model-tag--small { color: #1d4ed8; background: rgba(29, 78, 216, .08); border-color: rgba(29, 78, 216, .35); }
+[data-theme="light"] .gx-model-tag--pair { color: #c2410c; background: rgba(194, 65, 12, .08); border-color: rgba(194, 65, 12, .35); }
+
+/* Row-based model list: mobile-first 2-row column grid, single horizontal multi-column row on tablet/desktop */
+.gx-model-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--outline); }
+.gx-model-item { display: grid; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--outline); transition: background-color var(--motion-fast); }
+.gx-model-item:first-child { border-top: 0; }
+.gx-model-item:hover { background: rgba(255, 255, 255, .025); }
+.gx-model-item__row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: start; gap: 8px 10px; }
+.gx-model-item__subrow { padding-top: var(--sp-2); border-top: 1px dashed var(--outline); }
+.gx-model-item__ver { grid-column: 1; grid-row: 1; display: flex; align-items: center; justify-content: center; min-height: 24px; }
+.gx-model-item__sub-indent { color: var(--text-muted); opacity: .7; font-size: .95rem; }
+.gx-model-item__main { grid-column: 2; grid-row: 1; display: grid; gap: 4px; min-width: 0; }
+.gx-model-item__title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
+.gx-model-item__title > strong { font-weight: var(--fw-bold); overflow-wrap: anywhere; }
+.gx-model-item__title .gx-chip { padding: 2px 8px; font-size: .72rem; }
+.gx-model-about { width: 28px; height: 28px; min-width: 28px; min-height: 28px; font-size: .9rem; }
+.gx-model-item__meta { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; color: var(--text-muted); font-size: var(--fs-xs); line-height: 1.4; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
+.gx-model-item__meta::-webkit-scrollbar { display: none; }
+.gx-model-item__hw { display: inline-flex; align-items: center; gap: 5px; color: var(--on-surface-variant); font-weight: var(--fw-bold); white-space: nowrap; }
+.gx-model-item__hw > i { font-size: .92em; color: var(--text-muted); }
+.gx-model-item__hw--gpu > i { color: var(--secondary, #7dd3fc); }
+.gx-model-specs { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
+.gx-model-spec { display: inline-flex; align-items: center; white-space: nowrap; }
+.gx-model-spec::before { content: "·"; margin-right: 6px; opacity: .5; }
+.gx-model-spec--ver { padding: 2px 7px; border-radius: 6px; background: var(--surface-container-high); border: 1px solid var(--outline); color: var(--on-surface-variant); font-size: .72rem; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; line-height: 1.35; }
+.gx-model-spec--ver::before { content: none; }
+.gx-model-item__date { grid-column: 3; grid-row: 1; color: var(--text-muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; line-height: 24px; }
+.gx-model-lab__label { display: inline-flex; align-items: center; gap: 6px; color: var(--on-surface); font-weight: var(--fw-bold); }
+.gx-model-random { display: inline-flex; align-items: center; gap: var(--sp-3); margin-top: 2px; }
+.gx-model-random.disabled { opacity: .45; }
+.gx-model-item__actions { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2); }
+.gx-model-item__icons { display: grid; grid-template-columns: 40px 40px; align-items: center; justify-items: center; gap: 4px; }
+.gx-model-item__icon-slot { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; }
+.gx-model-item__icons .gx-icon-btn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
+.gx-model-item__primary { width: 100%; min-width: 0; }
+.gx-model-item__primary > .gx-btn { width: 100%; justify-content: center; white-space: nowrap; }
+.gx-model-item__active-btn:disabled { opacity: 1; border: 1px solid var(--primary); background: var(--primary-container); color: var(--on-surface); }
+.gx-model-card__progress { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; width: 100%; padding-inline: var(--sp-2); border-radius: var(--radius-full); background: var(--primary-container); color: var(--on-surface); font-size: var(--fs-xs); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; white-space: nowrap; }
+.gx-model-card__progress-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--secondary), var(--primary)); opacity: .6; transition: width .3s ease; }
+.gx-model-card__progress-label { position: relative; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
+
+/* Model Pair mode rows: 3-row card layout with full model names, compact 3rd-row pills, borderless cloud & gradient dash running around the cloud outline */
+.gx-model-item__row--pair { align-items: center; gap: 4px 10px; }
+.gx-model-item__row--pair .gx-model-item__main { display: contents; }
+.gx-model-item__row--pair .gx-model-item__title { grid-column: 2; grid-row: 1; min-height: 24px; line-height: 1.3; }
+.gx-model-item__row--pair .gx-model-about { width: 20px; height: 20px; min-width: 20px; min-height: 20px; font-size: .78rem; }
+.gx-model-item__row--pair .gx-model-item__meta { grid-column: 2; grid-row: 2; min-height: 20px; align-self: center; }
+.gx-model-item__actions--pair { grid-column: 2 / 4; grid-row: 2; justify-self: end; grid-template-columns: auto; justify-content: flex-end; }
+.gx-model-item__tagstrip { grid-column: 1 / -1; grid-row: 3; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 24px; min-width: 0; padding-top: 2px; }
+.gx-model-item__tagstrip .gx-chip, .gx-model-item__tagstrip .gx-model-tag { padding: 1px 6px; font-size: .62rem; line-height: 1.35; white-space: nowrap; }
+.gx-model-item__icons--pair { grid-template-columns: 36px 36px 36px; gap: 4px; }
+.gx-model-item__icons--pair .gx-model-item__icon-slot, .gx-model-item__icons--pair .gx-icon-btn { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
+.gx-pair-cloud-btn { color: var(--primary, #c4b5fd); border-color: transparent; background: transparent; font-size: 1.65rem; }
+.gx-pair-cloud-btn i { font-size: inherit; }
+.gx-pair-cloud-btn:disabled { opacity: .78; }
+.gx-pair-cloud-done { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; color: var(--primary, #c4b5fd); font-size: 1.65rem; }
+[data-theme="light"] .gx-pair-cloud-done { color: var(--primary, #6d28d9); }
+.gx-pair-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; }
+.gx-pair-ring__svg { width: 1.65rem; height: 1.65rem; overflow: visible; }
+.gx-pair-ring__track { fill: none; stroke: rgba(255, 255, 255, .18); stroke-width: 1.4; stroke-linejoin: round; }
+[data-theme="light"] .gx-pair-ring__track { stroke: rgba(0, 0, 0, .14); }
+.gx-pair-ring__fill { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 28 72; animation: gx-pair-cloud-run 1.4s linear infinite; }
+.gx-pair-ring__text { position: absolute; top: 53%; left: 50%; transform: translate(-50%, -50%); font-size: .4rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--on-surface); line-height: 1; letter-spacing: -.04em; }
+@keyframes gx-pair-cloud-run { to { stroke-dashoffset: -100; } }
+@media (prefers-reduced-motion: reduce) { .gx-pair-ring__fill { animation-duration: 4s; } }
+
/* Jetlink disclosure */
.gx-model-jetlink summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; }
.gx-model-jetlink summary::-webkit-details-marker { display: none; }
@@ -372,22 +447,45 @@ input[type="range"].gx-slider:active::-moz-range-thumb {
.gx-model-jetlink details[open] > summary::after { transform: rotate(-135deg); }
.gx-model-jetlink summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-sm); }
-@media (max-width: 720px) {
- .gx-model-driving__selects { grid-template-columns: minmax(0, 1fr); }
- .gx-model-toolbar__actions { margin-left: 0; width: 100%; flex-wrap: nowrap; }
- .gx-model-toolbar__actions > .gx-btn:not(.gx-btn--tonal) { flex: 1 1 0; }
+@media (min-width: 601px) {
+ .gx-model-manager .gx-btn, .gx-model-card__progress { min-height: 36px; }
+ .gx-model-item__meta { font-size: var(--fs-sm); }
+ .gx-model-search { min-height: 38px; }
+ .gx-model-toolbar__actions > .gx-btn--tonal { width: 36px; }
+ .gx-model-toolbar__row { justify-content: space-between; }
+ .gx-model-toolbar .gx-guided__segmented { width: auto; flex: 0 1 auto; }
+ .gx-model-toolbar .gx-guided__choice { flex: 0 1 auto; min-height: 36px; }
+ .gx-model-tabs__long { display: inline; }
+ .gx-model-tabs__short { display: none; }
+ .gx-model-sort { width: 9.5rem; }
+ .gx-model-sort .gx-select__button { min-height: 32px; padding-block: 2px; }
+ .gx-model-filters { flex: 0 1 auto; margin-left: auto; }
+ .gx-model-filters .gx-chip { min-height: 32px; }
}
-@media (max-width: 600px) {
- .gx-model-manager .gx-btn, .gx-model-card__progress { min-height: var(--touch-target); }
- .gx-model-toolbar__actions > .gx-btn--tonal { width: var(--touch-target); }
- .gx-model-toolbar .gx-guided__segmented { width: 100%; }
- .gx-model-toolbar .gx-guided__choice { flex: 1 1 0; }
- .gx-model-tabs__long { display: none; }
- .gx-model-tabs__short { display: inline; }
- .gx-model-filters .gx-chip { min-height: 40px; }
- .gx-model-sort { width: 100%; }
- .gx-model-card .gx-icon-btn { height: 36px; min-height: 36px; min-width: 36px; }
- .gx-model-card__heading { min-height: 36px; }
+@media (min-width: 640px) {
+ .gx-model-item__row { grid-template-columns: 42px minmax(0, 1fr) 108px auto; align-items: center; gap: var(--sp-3); min-height: 44px; }
+ .gx-model-item__row--pair { gap: 4px var(--sp-3); }
+ .gx-model-item__ver { grid-column: 1; grid-row: 1; }
+ .gx-model-item__row--pair .gx-model-item__ver { grid-column: 1; grid-row: 1 / 3; }
+ .gx-model-item__main { display: grid; grid-column: 2; grid-row: 1; gap: 4px; min-width: 0; }
+ .gx-model-item__row--pair .gx-model-item__main { display: contents; }
+ .gx-model-item__row--pair .gx-model-item__title { grid-column: 2; grid-row: 1; }
+ .gx-model-item__row--pair .gx-model-item__meta { grid-column: 2; grid-row: 2; }
+ .gx-model-item__tagstrip { grid-column: 2 / -1; grid-row: 3; gap: 6px; }
+ .gx-model-item__tagstrip .gx-chip, .gx-model-item__tagstrip .gx-model-tag { padding: 1px 7px; font-size: .65rem; }
+ .gx-model-item__date { grid-column: 3; grid-row: 1; font-size: var(--fs-sm); line-height: 1.4; }
+ .gx-model-item__row--pair .gx-model-item__date { grid-column: 3; grid-row: 1 / 3; }
+ .gx-model-item__actions { grid-column: 4; grid-row: 1; grid-template-columns: 216px auto; gap: var(--sp-2); }
+ .gx-model-item__actions--pair { grid-column: 4; grid-row: 1 / 3; grid-template-columns: auto; }
+ .gx-model-item__primary { width: 216px; }
+ .gx-model-item__icons { grid-template-columns: 36px 36px; gap: 4px; }
+ .gx-model-item__icons--pair { grid-template-columns: 36px 36px 36px; gap: 4px; }
+ .gx-model-item__icon-slot, .gx-model-item__icons .gx-icon-btn { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
+}
+@media (min-width: 721px) {
+ .gx-model-driving__summary, .gx-model-driving__selects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
+ .gx-model-toolbar__actions { margin-left: auto; width: auto; }
+ .gx-model-toolbar__actions > .gx-btn:not(.gx-btn--tonal) { flex: 0 0 auto; }
}
.gx-favorites__intro { display: grid; gap: 6px; }
@@ -783,6 +881,10 @@ html.gx-maker-open, html.gx-maker-open body { touch-action: manipulation; }
border-color: #9b7be8;
background-image: radial-gradient(ellipse at top left, #a855f71a, transparent 65%), linear-gradient(120deg, transparent 40%, #38bdf810);
}
+.gx-model-item.gx-model-card--polaris {
+ border-color: var(--outline);
+ background-image: none;
+}
.gx-model-card--polaris .gx-model-card__title {
color: #bca0ff;
background: linear-gradient(110deg, #b77aff 0%, #a494ff 25%, #38cfff 45%, #f0eaff 50%, #38cfff 55%, #a494ff 75%, #b77aff 100%);
diff --git a/openpilot/starpilot/galaxy/web/data/catalog.json b/openpilot/starpilot/galaxy/web/data/catalog.json
index 7fe322c987..ab99766368 100644
--- a/openpilot/starpilot/galaxy/web/data/catalog.json
+++ b/openpilot/starpilot/galaxy/web/data/catalog.json
@@ -105,17 +105,10 @@
]
},
{
- "name": "Model Manager",
+ "name": "Models",
"path": "/manage_models",
"icon": "bi-cpu",
- "description": "Models, downloads, and Jetlink connections",
- "availability": "local-only"
- },
- {
- "name": "Model Laboratory",
- "path": "/model_laboratory",
- "icon": "bi-bezier2",
- "description": "Pair lateral and longitudinal eGPU variants",
+ "description": "Models, downloads, Jetlink, and Model Laboratory",
"availability": "local-only"
},
{
diff --git a/openpilot/starpilot/galaxy/web/js/app.js b/openpilot/starpilot/galaxy/web/js/app.js
index fb4c579757..142668de48 100644
--- a/openpilot/starpilot/galaxy/web/js/app.js
+++ b/openpilot/starpilot/galaxy/web/js/app.js
@@ -16,7 +16,6 @@ const Logs = page(() => import("./logs.js").then((module) => module.Logs))
const SoftwarePage = page(() => import("./software-status.js").then((module) => module.SoftwarePage))
const NavigationPage = page(() => import("./navigation.js").then((module) => module.NavigationPage))
const ModelsPage = page(() => import("./models.js").then((module) => module.ModelsPage))
-const LaboratoryPage = page(() => import("./model-laboratory.js").then((module) => module.LaboratoryPage))
import { SettingsPage } from "./settings.js"
import { SettingsRecoveryPage } from "./settings-recovery.js"
import { ToggleSearch } from "./toggle-search.js"
@@ -87,13 +86,13 @@ const auth = new LocalAuth({ publish: (update) => {
createApp({
- components: { BottomNav, Home, LocalAccess, Tools, Logs, SoftwarePage, NavigationPage, ModelsPage, LaboratoryPage, SettingsPage, SettingsRecoveryPage, ToggleSearch, SaveFeedback, FlmPage, LocalRecordingsPage, CamerasPage, SentryEventsPage, VasmPage, PipPage, DrivingPage, DevicePreferencesPage, BluetoothPage, StarPortPage, SpotifyPage, LongitudinalCurvesPage, OnroadLayoutPage, GalaxyPage, DevicePicker, DeviceState, MenuTile },
+ components: { BottomNav, Home, LocalAccess, Tools, Logs, SoftwarePage, NavigationPage, ModelsPage, SettingsPage, SettingsRecoveryPage, ToggleSearch, SaveFeedback, FlmPage, LocalRecordingsPage, CamerasPage, SentryEventsPage, VasmPage, PipPage, DrivingPage, DevicePreferencesPage, BluetoothPage, StarPortPage, SpotifyPage, LongitudinalCurvesPage, OnroadLayoutPage, GalaxyPage, DevicePicker, DeviceState, MenuTile },
data: () => ({ state, authState, authForm, route, NAV, routeDirection: 1, updateRestart, deviceRestart, nextLayoutLeavePresentation: "inline" }),
computed: {
visibleTools() { return state.tools.filter(tool => tool.visibility !== "authenticated" ||
(state.monitorMode === "local" && authState.status === "authenticated")).sort((a, b) =>
Number(a.path === "/galaxy") - Number(b.path === "/galaxy")) },
- currentTool() { return state.tools.find((tool) => route.path === tool.path || route.path.startsWith(tool.path + "/")) },
+ currentTool() { return state.tools.find((tool) => this.isActive(tool.path)) },
drivingSettingsPage() { return drivingPage(route.path) },
deviceSettingsPage() { return devicePage(route.path) },
pageName() {
@@ -147,7 +146,7 @@ createApp({
state.drawerOpen = state.navPinned
save(PIN_KEY, String(state.navPinned))
},
- isActive(path) { return route.path === path || route.path.startsWith(path + "/") },
+ isActive(path) { return route.path === path || route.path.startsWith(path + "/") || (path === "/manage_models" && route.path === "/model_laboratory") },
async signIn() {
const password = authForm.password
authForm.password = ""
@@ -252,8 +251,7 @@ createApp({
:preparing="baseline => updateRestart.prepare({ ...baseline, instance: deviceRestart.instance })" :cancel-preparation="() => updateRestart.cancelPreparation()" />
-
-
+
diff --git a/openpilot/starpilot/galaxy/web/js/model-laboratory.js b/openpilot/starpilot/galaxy/web/js/model-laboratory.js
index 6fa0fcbfc1..df73567293 100644
--- a/openpilot/starpilot/galaxy/web/js/model-laboratory.js
+++ b/openpilot/starpilot/galaxy/web/js/model-laboratory.js
@@ -1,203 +1,10 @@
-import { GxState } from "./state.js"
-import { guardUnload } from "./unload-guard.js"
-import { GxSummary } from "./summary.js"
-import { GxNotice } from "./notice.js"
-import { reportSave } from "./save-feedback.js"
-import { GalaxySelect } from "./galaxy-select.js"
-import { ModelManagerFeed } from "./models.js"
-
-export const laboratoryModels = data => data?.models || []
-export const laboratoryReady = data => laboratoryModels(data).filter(m => m.modelLabEligible === true && m.modelLabArtifactAvailable === true && m.modelLabArtifactInstalled === true)
-
-export const laboratoryStatusLabel = model => ({
- unsupported: "Not supported", unpublished: "Not published", checking: "Checking download",
- missing: "Not downloaded", "runtime-unavailable": "Downloaded", "gpu-unavailable": "Connect Chestnut",
- installed: "Downloaded",
-})[model.modelLabStatus] || (model.modelLabArtifactInstalled ? "Downloaded" : "Not downloaded")
-
-export function laboratorySelectionError(data, configuration) {
- if (!data) return "Waiting for parked device status"
- if (data.isOnroad !== false) return "Turn off the vehicle before changing the model pair"
- if (!data.runtimeSupported) return data.runtimeUnavailableReason || "Model Laboratory runtime is unavailable"
- if (!data.chestnutReady) return "Connect a firmware-ready Chestnut to enable a pair"
- const ready = laboratoryReady(data)
- if (ready.length < 2) return "Download at least two eGPU variants to compose a pair"
- if (!configuration.lateralModel || !configuration.longitudinalModel) return "Choose two downloaded eGPU variants"
- if (configuration.lateralModel === configuration.longitudinalModel) return "Choose two different models"
- if (![configuration.lateralModel, configuration.longitudinalModel].every(id => ready.some(m => m.value === id))) return "Both models must have downloaded eGPU variants"
- const selected = ready.filter(m => [configuration.lateralModel, configuration.longitudinalModel].includes(m.value))
- if (selected.every(m => m.small === false)) return "Two Big models cannot run together at the required speed. Choose a Small model for one role."
- if (selected.every(m => m.modelLabChestnut === false)) return "Choose at least one model with a Chestnut variant"
- return ""
-}
-
-export function laboratoryActionAllowed(data, action, model, configuration = data?.configuration) {
- if (!data || data.capabilities?.[action === "enable" || action === "disable" ? "configure" : action] !== true) return false
- if (action === "cancel") return data.download?.downloading === true && typeof data.download.jobId === "string"
- if (data.isOnroad !== false || data.download?.downloading) return false
- if (action === "enable") return !laboratorySelectionError(data, configuration)
- if (action === "disable") return data.configuration.enabled === true
- if (action === "download") return laboratoryModels(data).some(m => m.value === model?.value && m.modelLabEligible === true && m.modelLabArtifactAvailable === true && !m.modelLabArtifactInstalled)
- if (action === "delete") return model?.small === true && model.modelLabChestnut !== false && laboratoryReady(data).some(m => m.value === model?.value) &&
- !(data.configuration.enabled && [data.configuration.lateralModel, data.configuration.longitudinalModel].includes(model.value))
- return action === "refresh"
-}
-
-export function laboratoryDraft(data, draft, dirty) {
- const configuration = { ...data.configuration, ...(dirty ? { lateralModel: draft.lateralModel, longitudinalModel: draft.longitudinalModel } : {}) }
- if (!dirty) {
- const ready = laboratoryReady(data)
- if (!configuration.lateralModel) configuration.lateralModel = ready[0]?.value || ""
- if (!configuration.longitudinalModel) configuration.longitudinalModel = ready.find(m => m.value !== configuration.lateralModel)?.value || ""
- }
- return configuration
-}
-
-function validPayload(data) {
- return data?.schemaVersion === 1 && typeof data.isOnroad === "boolean" && typeof data.chestnutReady === "boolean" &&
- typeof data.runtimeSupported === "boolean" && typeof data.configuration?.enabled === "boolean" &&
- [data.configuration.lateralModel, data.configuration.longitudinalModel].every(id => typeof id === "string") &&
- data.capabilities && typeof data.capabilities === "object" && typeof data.download?.downloading === "boolean" &&
- typeof data.runtime?.active === "boolean" && typeof data.runtime?.requested === "boolean" && Array.isArray(data.models) &&
- data.models.every(m => typeof m?.value === "string" && typeof m.label === "string") &&
- new Set(data.models.map(m => m.value)).size === data.models.length
-}
-
-export class LaboratoryFeed extends ModelManagerFeed {
- stop() {
- if (this.expiry != null) this.cancel(this.expiry)
- this.expiry = null
- super.stop()
- }
- async load() {
- if (!this.active || this.saving) return null
- const data = await this.requestJson("laboratory")
- if (!this.active) return null
- if (data) {
- this.data = validPayload(data) ? data : null
- this.publish({ loading: false, data: this.data, error: this.data ? "" : "Invalid Model Laboratory response" })
- if (this.expiry != null) this.cancel(this.expiry)
- this.expiry = this.later(() => {
- this.data = null
- this.publish({ loading: false, data: null, error: "Laboratory status refresh delayed" })
- }, 6000)
- }
- if (this.poll === null) this.poll = this.later(() => this.load(), 2000)
- return this.data
- }
- async action(action, model = null, configuration) {
- if (!this.active || this.saving || !laboratoryActionAllowed(this.data, action, model, configuration)) return null
- const paths = { enable: "laboratory", disable: "laboratory", download: "laboratory/download", delete: "laboratory/delete", cancel: "cancel", refresh: "refresh_manifest" }
- const payload = action === "enable" || action === "disable" ? { ...configuration, enabled: action === "enable" } :
- action === "cancel" ? { jobId: this.data.download.jobId } : model ? { model: model.value } : {}
- this.saving = true
- const result = await this.requestJson(paths[action], payload)
- if (!this.active) return null
- this.saving = false
- const error = this.lastError
- await this.load()
- if (error && this.active) this.publish({ loading: false, data: this.data, error })
- return result
- }
-}
-
-export const LaboratoryPage = {
- components: { GxState, GxSummary, GxNotice, GalaxySelect },
- props: { mode: { type: String, required: true }, unauthorized: { type: Function, required: true } },
- data: () => ({ loading: true, status: null, error: "", message: "", busy: false, dirty: false, trackingProgress: false,
- configuration: { enabled: false, lateralModel: "", longitudinalModel: "" } }),
- computed: {
- availableModels() { return laboratoryModels(this.status) },
- readyModels() { return laboratoryReady(this.status) },
- candidates() { return this.readyModels.filter(m => m.value !== this.configuration.lateralModel) },
- selectionError() { return laboratorySelectionError(this.status, this.configuration) },
- },
- created() {
- this.feed = new LaboratoryFeed({ unauthorized: this.unauthorized, publish: update => {
- this.loading = update.loading
- this.error = update.error
- this.status = update.data
- if (update.data) {
- this.configuration = laboratoryDraft(update.data, this.configuration, this.dirty)
- if (this.trackingProgress && update.data.download.progress) {
- this.message = update.data.download.progress
- if (!update.data.download.downloading) this.trackingProgress = false
- }
- }
- } })
- },
- mounted() {
- this._stopUnloadGuard = guardUnload(() => this.dirty || this.busy)
- this.visibility = () => { if (document.hidden) this.feed.stop(); else if (this.mode === "local") this.feed.start() }
- document.addEventListener("visibilitychange", this.visibility)
- if (this.mode === "local" && !document.hidden) this.feed.start()
- },
- beforeUnmount() { this._stopUnloadGuard(); document.removeEventListener("visibilitychange", this.visibility); this.feed.stop() },
- methods: {
- reportSave,
- statusLabel: laboratoryStatusLabel,
- actionAvailable(action, model = null) { return laboratoryActionAllowed(this.status, action, model, this.configuration) },
- can(action, model = null) { return !this.busy && this.actionAvailable(action, model) },
- modelLabel(id) { return this.status?.models.find(m => m.value === id)?.label || id || "Not selected" },
- changeLateral(value) {
- this.configuration.lateralModel = value
- if (this.configuration.longitudinalModel === value) this.configuration.longitudinalModel = this.candidates[0]?.value || ""
- this.dirty = true
- },
- async act(action, model = null) {
- if (!this.can(action, model)) return
- if (action === "delete" && !window.confirm(`Delete the eGPU variant for "${model.label}"? The normal on-device model will not be removed.`)) return
- this.busy = true
- this.message = ""
- try {
- const result = await this.feed.action(action, model, this.configuration)
- if (result) {
- this.message = result.message || "Updated"
- this.trackingProgress = action === "download" || action === "cancel"
- if (["enable", "disable", "delete"].includes(action)) {
- this.dirty = false
- if (this.status) this.configuration = laboratoryDraft(this.status, this.configuration, false)
- }
- }
- return result
- } finally { this.busy = false }
- },
- },
- template: `
-
-
-
Model Laboratory is available on the device. Preview does not configure a pair.
-
Loading Model Laboratory…
-
{{ error }}
-
{{ status.configurationError }}
-
{{ status.runtime.error }}
-
{{ message }}
-
-
-
-
-
Lateral model Path shape, curvature, lane geometry, and driving desire Choose a model {{ m.label }} · {{ m.version }}
-
Longitudinal model Speed, acceleration, stopping, leads, and scene confidence Choose a model {{ m.label }} · {{ m.version }}
-
{{ modelLabel(configuration.lateralModel) }} steers · {{ modelLabel(configuration.longitudinalModel) }} paces
-
{{ selectionError }}
-
-
Check model catalog
-
-
-
-
-
- Browse Small and Big models here. Combining models requires compatible Chestnut downloads and support for running them together.
- Pairing increases inference time. Two Big models cannot run together at the required speed. Choose a Small model for one role. Other combinations can also cause model lag warnings. Small downloads prepare the available variants. When available, the comma GPU runs one Small role while Chestnut runs the other role.
- The model catalog is unavailable. Refresh to retry.
- {{ m.label }} {{ m.value }} · {{ m.small ? 'Small' : 'Big' }} · {{ m.series || 'Unknown series' }} · {{ m.version }} {{ m.modelLabReason || 'Pair artifact status unavailable' }}
{{ statusLabel(m) }} {{ m.small ? (m.modelLabChestnut === false ? 'Download Small model' : 'Download pair variants') : 'Download Big model' }} Delete eGPU variant
- {{ status.download.progress || 'Downloading…' }}
Cancel download
-
-
-
`,
-}
+export {
+ LaboratoryFeed,
+ ModelsPage as LaboratoryPage,
+ laboratoryModels,
+ laboratoryReady,
+ laboratorySelectionError,
+ laboratoryActionAllowed,
+ laboratoryDraft,
+ laboratoryStatusLabel,
+} from "./models.js"
diff --git a/openpilot/starpilot/galaxy/web/js/models.js b/openpilot/starpilot/galaxy/web/js/models.js
index 81a5f9b159..89499c77db 100644
--- a/openpilot/starpilot/galaxy/web/js/models.js
+++ b/openpilot/starpilot/galaxy/web/js/models.js
@@ -120,30 +120,36 @@ function matchesHardware(model, tab) {
}
function hardwareLabel(model) {
- if (model?.requiresGpu === true) return "GPU · External";
- if (model?.requiresGpu === false) return "Comma · On-device";
- return "Hardware unknown";
+ if (model?.requiresGpu === true) return "GPU · External"
+ if (model?.requiresGpu === false) return "Comma · On-device"
+ return "Hardware unknown"
+}
+
+export function hardwareTag(model) {
+ if (model?.requiresGpu === true) return { label: "eGPU", tone: "egpu", title: "Big model: runs on an external GPU" }
+ if (model?.requiresGpu === false) return { label: "Small", tone: "small", title: "Small model: runs on the comma itself" }
+ return { label: "Hardware unknown", tone: "unknown", title: "" }
}
function bytes(value) {
- return Number.isSafeInteger(value) && value > 0 ? value : null;
+ return Number.isSafeInteger(value) && value > 0 ? value : null
}
function formatBytes(value) {
- return value >= 1e9 ? `${(value / 1e9).toFixed(2)} GB` : `${(value / 1e6).toFixed(1)} MB`;
+ return value >= 1e9 ? `${(value / 1e9).toFixed(2)} GB` : `${(value / 1e6).toFixed(1)} MB`
}
function fileSizeText(model) {
- const installed = bytes(model?.fileSizeBytes);
- const declared = bytes(model?.declaredSizeBytes || model?.artifactSize);
- const downloaded = bytes(model?.downloadedBytes);
+ const installed = bytes(model?.fileSizeBytes)
+ const declared = bytes(model?.declaredSizeBytes || model?.artifactSize)
+ const downloaded = bytes(model?.downloadedBytes)
if (model?.partial || model?.sizeStatus === "partial") {
- return `Partial: ${downloaded ? formatBytes(downloaded) : "unknown"} / ${declared ? formatBytes(declared) : "unknown"}`;
+ return `Partial: ${downloaded ? formatBytes(downloaded) : "unknown"} / ${declared ? formatBytes(declared) : "unknown"}`
}
- if (installed && declared && installed !== declared) return `${formatBytes(installed)} · size mismatch`;
- if (installed) return formatBytes(installed);
- if (declared) return formatBytes(declared);
- return "Unavailable";
+ if (installed && declared && installed !== declared) return `${formatBytes(installed)} · size mismatch`
+ if (installed) return formatBytes(installed)
+ if (declared) return formatBytes(declared)
+ return "Unavailable"
}
export function releasedText(value) {
@@ -368,16 +374,148 @@ export class ModelManagerFeed {
}
}
+// Model Laboratory: pairs one model's lateral output with another's longitudinal output, using eGPU (Chestnut) variants.
+// It reads the same catalog and download job as the manager, through ./api/models/laboratory.
+export const laboratoryModels = data => data?.models || []
+export const laboratoryReady = data => laboratoryModels(data).filter(m => m.modelLabEligible === true && m.modelLabArtifactAvailable === true && m.modelLabArtifactInstalled === true)
+
+export const laboratoryStatusLabel = model => ({
+ unsupported: "Not supported", unpublished: "Not published", checking: "Checking download",
+ missing: "Not downloaded", "runtime-unavailable": "Downloaded", "gpu-unavailable": "Connect Chestnut",
+ installed: "Downloaded",
+})[model.modelLabStatus] || (model.modelLabArtifactInstalled ? "Downloaded" : "Not downloaded")
+
+export function laboratorySelectionError(data, configuration) {
+ if (!data) return "Waiting for parked device status"
+ if (data.isOnroad !== false) return "Turn off the vehicle before changing the model pair"
+ if (!data.runtimeSupported) return data.runtimeUnavailableReason || "Model Laboratory runtime is unavailable"
+ if (!data.chestnutReady) return "Connect a firmware-ready Chestnut to enable a pair"
+ const ready = laboratoryReady(data)
+ if (ready.length < 2) return "Download at least two eGPU variants to compose a pair"
+ if (!configuration.lateralModel || !configuration.longitudinalModel) return "Choose two downloaded eGPU variants"
+ if (configuration.lateralModel === configuration.longitudinalModel) return "Choose two different models"
+ if (![configuration.lateralModel, configuration.longitudinalModel].every(id => ready.some(m => m.value === id))) return "Both models must have downloaded eGPU variants"
+ const selected = ready.filter(m => [configuration.lateralModel, configuration.longitudinalModel].includes(m.value))
+ if (selected.every(m => m.small === false)) return "Two Big models cannot run together at the required speed. Choose a Small model for one role."
+ if (selected.every(m => m.modelLabChestnut === false)) return "Choose at least one model with a Chestnut variant"
+ return ""
+}
+
+export function laboratoryActionAllowed(data, action, model, configuration = data?.configuration) {
+ if (!data || data.capabilities?.[["enable", "disable", "save"].includes(action) ? "configure" : action] !== true) return false
+ if (action === "cancel") return data.download?.downloading === true && typeof data.download.jobId === "string"
+ if (data.isOnroad !== false || data.download?.downloading) return false
+ if (action === "enable") return !laboratorySelectionError(data, configuration)
+ if (action === "disable") return data.configuration.enabled === true
+ if (action === "download") return laboratoryModels(data).some(m => m.value === model?.value && m.modelLabEligible === true && m.modelLabArtifactAvailable === true && !m.modelLabArtifactInstalled)
+ if (action === "delete") return model?.small === true && model.modelLabChestnut !== false && laboratoryReady(data).some(m => m.value === model?.value) &&
+ !(data.configuration.enabled && [data.configuration.lateralModel, data.configuration.longitudinalModel].includes(model.value))
+ if (action === "save") {
+ if (data.configuration.enabled) return !laboratorySelectionError(data, configuration)
+ const ready = laboratoryReady(data)
+ const picks = [configuration?.lateralModel, configuration?.longitudinalModel]
+ return picks.every(id => id === "" || ready.some(m => m.value === id)) && (picks[0] === "" || picks[0] !== picks[1])
+ }
+ return action === "refresh"
+}
+
+export function laboratoryDraft(data, draft, dirty) {
+ const configuration = { ...data.configuration, ...(dirty ? { lateralModel: draft.lateralModel, longitudinalModel: draft.longitudinalModel } : {}) }
+ if (!dirty) {
+ const ready = laboratoryReady(data)
+ if (!configuration.lateralModel) configuration.lateralModel = ready[0]?.value || ""
+ if (!configuration.longitudinalModel) configuration.longitudinalModel = ready.find(m => m.value !== configuration.lateralModel)?.value || ""
+ }
+ return configuration
+}
+
+function validLaboratoryPayload(data) {
+ return data?.schemaVersion === 1 && typeof data.isOnroad === "boolean" && typeof data.chestnutReady === "boolean" &&
+ typeof data.runtimeSupported === "boolean" && typeof data.configuration?.enabled === "boolean" &&
+ [data.configuration.lateralModel, data.configuration.longitudinalModel].every(id => typeof id === "string") &&
+ data.capabilities && typeof data.capabilities === "object" && typeof data.download?.downloading === "boolean" &&
+ typeof data.runtime?.active === "boolean" && typeof data.runtime?.requested === "boolean" && Array.isArray(data.models) &&
+ data.models.every(m => typeof m?.value === "string" && typeof m.label === "string") &&
+ new Set(data.models.map(m => m.value)).size === data.models.length
+}
+
+export class LaboratoryFeed extends ModelManagerFeed {
+ stop() {
+ if (this.expiry != null) this.cancel(this.expiry)
+ this.expiry = null
+ super.stop()
+ }
+ async load() {
+ if (!this.active || this.saving) return null
+ const data = await this.requestJson("laboratory")
+ if (!this.active) return null
+ if (data) {
+ this.data = validLaboratoryPayload(data) ? data : null
+ this.publish({ loading: false, data: this.data, error: this.data ? "" : "Invalid Model Laboratory response" })
+ if (this.expiry != null) this.cancel(this.expiry)
+ this.expiry = this.later(() => {
+ this.data = null
+ this.publish({ loading: false, data: null, error: "Laboratory status refresh delayed" })
+ }, 6000)
+ }
+ if (this.poll === null) this.poll = this.later(() => this.load(), 2000)
+ return this.data
+ }
+ async action(action, model = null, configuration) {
+ if (!this.active || this.saving || !laboratoryActionAllowed(this.data, action, model, configuration)) return null
+ const paths = { enable: "laboratory", disable: "laboratory", save: "laboratory", download: "laboratory/download", delete: "laboratory/delete", cancel: "cancel", refresh: "refresh_manifest" }
+ const pair = { lateralModel: configuration?.lateralModel, longitudinalModel: configuration?.longitudinalModel }
+ const payload = action === "enable" || action === "disable" ? { ...pair, enabled: action === "enable" } :
+ action === "save" ? { ...pair, enabled: this.data.configuration.enabled } :
+ action === "cancel" ? { jobId: this.data.download.jobId } : model ? { model: model.value } : {}
+ this.saving = true
+ const result = await this.requestJson(paths[action], payload)
+ if (!this.active) return null
+ this.saving = false
+ const error = this.lastError
+ await this.load()
+ if (error && this.active) this.publish({ loading: false, data: this.data, error })
+ return result
+ }
+}
+
+const LAB_CHOICE_PROBLEMS = new Set(["Choose two different models", "Both models must have downloaded eGPU variants", "Choose two downloaded eGPU variants",
+ "Two Big models cannot run together at the required speed. Choose a Small model for one role.", "Choose at least one model with a Chestnut variant"])
+
+export function matchesSearch(model, query) {
+ const words = String(query || "").toLowerCase().split(/\s+/).filter(Boolean)
+ if (!words.length) return true
+ const text = [model?.label, model?.value, model?.series, model?.version, model?.released].filter(Boolean).join(" ").toLowerCase()
+ return words.every(word => text.includes(word))
+}
+
+const modelBytes = model => bytes(model?.fileSizeBytes) || bytes(model?.declaredSizeBytes || model?.artifactSize) || 0
+export const MODEL_SORTS = Object.freeze({
+ release_date: (a, b) => (Date.parse(b.released) || 0) - (Date.parse(a.released) || 0),
+ alphabetical: () => 0,
+ size: (a, b) => modelBytes(b) - modelBytes(a),
+})
+
+const LAB_REASON_STATES = new Set(["unsupported", "unpublished", "checking"])
+
export const ModelsPage = {
name: "ModelsPage",
components: { GxDialog, GxState, GalaxySelect, GxNotice },
- props: { mode: { type: String, required: true }, unauthorized: { type: Function, required: true } },
+ props: {
+ mode: { type: String, required: true },
+ unauthorized: { type: Function, required: true },
+ focus: { type: String, default: "" },
+ },
data() {
- return { polarisAbout: false, loading: true, error: "", message: "", trackingProgress: false, busy: "", selectionUncertain: true, disposed: false,
- sortMode: "release_date", userFilter: "all", communityFilter: "all", tab: readTab(), failureDismissed: false,
+ return {
+ polarisAbout: false, loading: true, error: "", message: "", trackingProgress: false, busy: "", selectionUncertain: true, disposed: false,
+ sortMode: "release_date", userFilter: "all", communityFilter: "all", tab: readTab(), pairableFilter: false, search: "", failureDismissed: false,
models: [], currentModel: "", activeSmallModel: "", activeBigModel: "", capabilities: {},
summary: { installed: 0, missing: 0, total: 0 }, status: { isOnroad: true },
- runtime: { status: "idle", data: null, error: "" }, dialog: null, pendingChoice: null }
+ runtime: { status: "idle", data: null, error: "" }, dialog: null, pendingChoice: null,
+ lab: null, labError: "", labDirty: false, labConfig: { enabled: false, lateralModel: "", longitudinalModel: "" }, focused: false,
+ pairView: null,
+ }
},
computed: {
currentLabel() { return this.models.find(m => m.value === this.currentModel)?.label || this.currentModel || "" },
@@ -399,6 +537,14 @@ export const ModelsPage = {
installedBigModels() { return this.models.filter(m => (m.value === this.activeBigModel || m.selectable) && fitsModelProfile(m, "big")) },
// the manager words it: under Jetlink, the Jetlink app's choice
bigNoneLabel() { return this.status.bigNoneLabel || "None — always use Active Small" },
+ activeSmallLabel() {
+ const id = this.pendingChoice?.action === "select-small" ? this.pendingChoice.value : this.activeSmallModel
+ return this.models.find(m => m.value === id)?.label || id || "None selected"
+ },
+ activeBigLabel() {
+ const id = this.pendingChoice?.action === "select-big" ? this.pendingChoice.value : this.activeBigModel
+ return id ? (this.models.find(m => m.value === id)?.label || id) : this.bigNoneLabel
+ },
libraryTab() { return TABS.has(this.tab) ? this.tab : "both" },
tabs() {
const gpu = this.models.filter(m => m.requiresGpu === true).length
@@ -410,7 +556,9 @@ export const ModelsPage = {
return this.models.filter(m => matchesHardware(m, this.libraryTab))
.filter(m => this.userFilter === "all" || !!m.userFavorite === (this.userFilter === "yes"))
.filter(m => this.communityFilter === "all" || !!m.communityFavorite === (this.communityFilter === "yes"))
- .sort((a, b) => (this.sortMode === "release_date" ? (Date.parse(b.released) || 0) - (Date.parse(a.released) || 0) : 0) ||
+ .filter(m => !this.pairableFilter || this.isPairable(m))
+ .filter(m => matchesSearch(m, this.search))
+ .sort((a, b) => (MODEL_SORTS[this.sortMode]?.(a, b) || 0) ||
(a.label || a.value).localeCompare(b.label || b.value, undefined, { sensitivity: "base", numeric: true }))
},
progressInfo() {
@@ -439,9 +587,19 @@ export const ModelsPage = {
return this.status.gpuAvailable ? "" : "An external GPU is not detected. Active Small is used; your Big selection is saved for later."
},
jetlinkOpen() { return !!this.status.jetlink && this.status.jetlink.mode !== "off" },
+ driveMode() { return this.pairView ?? (this.lab?.configuration.enabled ? "pair" : "single") },
+ showLabVariants() { return this.driveMode === "pair" || this.pairableFilter },
+ labRows() { return new Map(laboratoryModels(this.lab).map(m => [m.value, m])) },
+ labReady() { return laboratoryReady(this.lab) },
+ labCandidates() { return this.labReady.filter(m => m.value !== this.labConfig.lateralModel) },
+ labSelectionError() { return laboratorySelectionError(this.lab, this.labConfig) },
+ labRuntimeState() { return !this.lab ? "Status unavailable" : !this.lab.runtimeSupported ? "Unavailable" : this.lab.runtime.active ? "Pair active" : this.lab.runtime.requested ? "Pair requested" : "Inactive" },
+ labChoiceProblem() { return LAB_CHOICE_PROBLEMS.has(this.labSelectionError) },
+ labLocked() { return !this.lab || this.lab.isOnroad || this.lab.download?.downloading },
},
watch: {
"status.downloading"(value) { if (value) this.failureDismissed = false },
+ loading(value) { if (!value) this.focusLaboratory() },
},
created() {
this.feed = new ModelStatusFeed({ publish: update => { this.runtime = update }, unauthorized: this.unauthorized })
@@ -465,14 +623,19 @@ export const ModelsPage = {
}
}
}, unauthorized: this.unauthorized })
+ this.laboratory = new LaboratoryFeed({ publish: update => {
+ this.labError = update.error
+ this.lab = update.data
+ if (update.data) this.labConfig = laboratoryDraft(update.data, this.labConfig, this.labDirty)
+ }, unauthorized: this.unauthorized })
},
mounted() {
this.visibility = () => {
- if (document.hidden) { this.finishDialog(false); this.feed.stop(); this.manager.stop() }
- else if (this.mode === "local") { this.feed.start(); this.manager.start() }
+ if (document.hidden) { this.finishDialog(false); this.feed.stop(); this.manager.stop(); this.laboratory?.stop() }
+ else if (this.mode === "local") { this.feed.start(); this.manager.start(); this.laboratory?.start() }
}
document.addEventListener("visibilitychange", this.visibility)
- if (this.mode === "local" && !document.hidden) { this.feed.start(); this.manager.start() }
+ if (this.mode === "local" && !document.hidden) { this.feed.start(); this.manager.start(); this.laboratory?.start() }
},
beforeUnmount() {
this.disposed = true
@@ -480,8 +643,105 @@ export const ModelsPage = {
document.removeEventListener("visibilitychange", this.visibility)
this.feed.stop()
this.manager.stop()
+ this.laboratory?.stop()
},
methods: {
+ focusLaboratory() {
+ if (this.focus !== "laboratory" || this.focused) return
+ if (this.driveMode !== "pair") this.pairView = "pair"
+ this.$nextTick(() => {
+ const card = this.$refs.laboratory
+ if (!card) return
+ this.focused = true
+ card.scrollIntoView({ block: "start" })
+ })
+ },
+ labRow(model) { return this.labRows.get(model?.value) },
+ isPairable(model) { return this.labRow(model)?.modelLabArtifactAvailable === true },
+ labStatusLabel: laboratoryStatusLabel,
+ labReason(model) { const row = this.labRow(model); return row && LAB_REASON_STATES.has(row.modelLabStatus) ? row.modelLabReason : "" },
+ labDownloadLabel(m) { return m.small ? (m.modelLabChestnut === false ? "Download Small model" : "Download pair variants") : "Download Big model" },
+ labModelLabel(id) { return this.lab?.models.find(m => m.value === id)?.label || id || "Not selected" },
+ labActionAvailable(action, model = null) { return laboratoryActionAllowed(this.lab, action, model, this.labConfig) },
+ changeLateral(value) {
+ this.labConfig.lateralModel = value
+ if (this.labConfig.longitudinalModel === value) this.labConfig.longitudinalModel = this.labCandidates[0]?.value || ""
+ this.labDirty = true
+ return this.saveLabPair()
+ },
+ changeLongitudinal(value) {
+ this.labConfig.longitudinalModel = value
+ this.labDirty = true
+ return this.saveLabPair()
+ },
+ async saveLabPair() {
+ if (!this.labActionAvailable("save")) return null
+ const result = await reportSave(() => this.runLabAction("save"))
+ if (!result && !this.disposed) {
+ this.labDirty = false
+ if (this.lab) this.labConfig = laboratoryDraft(this.lab, this.labConfig, false)
+ }
+ if (result && !this.disposed && this.driveMode === "pair" && !this.lab?.configuration.enabled && this.labActionAvailable("enable")) return this.enablePair()
+ return result
+ },
+ enablePair() { return reportSave(() => this.runLabAction("enable")) },
+ async setDriveMode(mode) {
+ if (mode === this.driveMode) return null
+ if (mode === "single") {
+ this.pairView = "single"
+ const result = this.lab?.configuration.enabled ? await reportSave(() => this.runLabAction("disable")) : true
+ this.pairView = null
+ return result
+ }
+ this.pairView = "pair"
+ return this.labActionAvailable("enable") ? this.enablePair() : null
+ },
+ activeRoles(model) {
+ const roles = []
+ if (model.value === this.activeSmallModel) roles.push("Active Small")
+ if (model.value === this.activeBigModel) roles.push("Active Big")
+ if (!roles.length && model.value === this.currentModel) roles.push("Active")
+ return roles
+ },
+ activeButtonLabel(model) {
+ return this.activeRoles(model).join(" · ") || "Active"
+ },
+ pairRoles(model) {
+ const pair = this.lab?.configuration
+ if (!pair) return []
+ return [[pair.lateralModel, "Pair · lateral"], [pair.longitudinalModel, "Pair · longitudinal"]]
+ .filter(([id]) => id && id === model.value).map(([, role]) => role)
+ },
+ showPairable() {
+ this.pairableFilter = true
+ this.setTab("comma")
+ this.$nextTick(() => this.$refs.library?.scrollIntoView({ block: "start" }))
+ },
+ clearFilters() {
+ Object.assign(this, { search: "", pairableFilter: false, userFilter: "all", communityFilter: "all" })
+ this.setTab("both")
+ },
+ async runLabAction(action, model = null) {
+ if (this.disposed || this.busy || !this.labActionAvailable(action, model)) return
+ this.busy = `lab-${action}:${model?.value || ""}`
+ this.message = ""
+ try {
+ if (action === "delete" && !await this.confirmAction({ title: "Delete eGPU variant", confirmLabel: "Delete", danger: true,
+ message: `Delete the eGPU variant for "${model.label}"? The normal on-device model will not be removed.` })) return
+ if (this.disposed) return
+ const result = await this.laboratory.action(action, model, this.labConfig)
+ if (!this.disposed && result) {
+ this.message = action === "save" ? "Model pair saved for the next start." : result.message || "Updated"
+ this.trackingProgress = action === "download"
+ if (["enable", "disable", "delete", "save"].includes(action)) {
+ this.labDirty = false
+ if (this.lab) this.labConfig = laboratoryDraft(this.lab, this.labConfig, false)
+ }
+ this.manager?.load()
+ }
+ return result
+ } finally { if (!this.disposed) this.busy = "" }
+ },
isPolaris(model) {
const series = typeof model?.series === "string" ? model.series.trim().toLowerCase() : ""
return series === "polaris" || series === "polaris series" || ["spz_polaris_r3a", "spz_polaris_r3b"].includes(model?.value)
@@ -491,7 +751,7 @@ export const ModelsPage = {
const emoji = label.search(/\p{Extended_Pictographic}/u)
return emoji < 0 ? [label, ""] : [label.slice(0, emoji), label.slice(emoji)]
},
- hardwareLabel, fileSizeText, modelFacts,
+ hardwareLabel, hardwareTag, fileSizeText, releasedText, modelFacts,
// "active" while this model downloads, "queued" while Download Missing works through the rest
downloadStage(model) {
if (!this.status.downloading) return ""
@@ -500,6 +760,16 @@ export const ModelsPage = {
const wanted = this.models.filter(m => !m.installed && m.downloadAvailable).length
return model.gpuAvailable === false && this.status.downloadProgress?.count < wanted ? "" : "queued"
},
+ isPairDownloading(model) {
+ if (!model || !this.lab?.download?.downloading) return false
+ return this.busy === `lab-download:${model.value}` || this.status.modelToDownload === model.value
+ },
+ pairDownloadPercent(model) {
+ if (!this.isPairDownloading(model)) return null
+ if (this.progressInfo?.percent != null) return this.progressInfo.percent
+ const match = /(\d{1,3})%/.exec(this.lab?.download?.progress || "")
+ return match ? Math.min(100, Number(match[1])) : 0
+ },
setTab(value) { this.tab = saveTab(value) },
retryDownload() {
const detail = this.status.downloadProgress
@@ -569,6 +839,7 @@ export const ModelsPage = {
this.trackingProgress = ["download", "downloadAll", "refresh"].includes(action)
this.message = (action === "disable-laboratory" ? "Laboratory is off for the next start. Choose your Small and Big models below." : "") || (this.trackingProgress && this.status.progress) || result.message ||
(action === "disable-laboratory" ? "Laboratory is off for the next start. Choose your Small and Big models below." : action.startsWith("select-") ? "Selection saved for the next onroad cycle." : "Saved.")
+ if (["download", "downloadAll", "cancel", "delete", "refresh"].includes(action)) this.laboratory?.load()
}
} finally { if (!this.disposed) { this.pendingChoice = null; this.busy = "" } }
},
@@ -576,14 +847,14 @@ export const ModelsPage = {
template: `
-
Model Manager is unavailable in the offline preview.
+
Models are unavailable in the offline preview.
Reading installed models and available downloads…
-
+
{{ message }}
- {{ error }}
+ {{ error }}
Selections apply next onroad cycle. Park before downloading models or changing Jetlink.
@@ -594,48 +865,82 @@ export const ModelsPage = {
-
-
-
-
Laboratory is on. Its lateral/longitudinal pair overrides the Small/Big selections below at the next model start.
-
Laboratory is off for the next start. The currently loaded pair stays in use until then.
-
Loaded pair: {{ runningModelLabel }} · saved changes pending next start
-
{{ runtime.status === 'ready' && runtime.data?.laboratory?.health === 'fallback' ? runtime.data.laboratory.error : 'The pair is not currently verified as running.' }}
-
-
Park to turn off Laboratory. Changes apply at the next model start.
-
-
-
-
- Active Small · On-device
- m.value === $event.target.value))">
- {{ m.label || m.value }}
-
-
-
- Active Big · External GPU
- m.value === $event.target.value)) : runAction('select-big')">
- {{ bigNoneLabel }}
- {{ m.label || m.value }}
-
-
+
+ Single model
+ Model pair
-