Model Manager: Fold Model Laboratory into the Models page

This commit is contained in:
Danny
2026-11-13 17:46:53 -08:00
parent 137b1a55a5
commit a1581a833e
10 changed files with 827 additions and 436 deletions
@@ -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.`)
@@ -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 })
@@ -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')"><i aria-hidden="true" class="bi bi-bezier2"></i> Model pair</button>`))
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\./)
@@ -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, /<ul v-else class="gx-model-list" aria-label="Models">/)
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')
}
@@ -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"]))
+159 -57
View File
@@ -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%);
@@ -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"
},
{
+4 -6
View File
@@ -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()" />
<NavigationPage v-else-if="['/navigation', '/navigation/maps', '/navigation/setup'].includes(route.path)" :mode="state.monitorMode" :unauthorized="sessionExpired" :go="go" :tabs="currentTool?.children || []"
:initial-tab="route.path === '/navigation/maps' ? 'maps' : route.path === '/navigation/setup' ? 'setup' : 'route'" />
<ModelsPage v-else-if="route.path === '/manage_models'" :mode="state.monitorMode" :unauthorized="sessionExpired" />
<LaboratoryPage v-else-if="route.path === '/model_laboratory'" :mode="state.monitorMode" :unauthorized="sessionExpired" />
<ModelsPage v-else-if="['/manage_models', '/model_laboratory'].includes(route.path)" :mode="state.monitorMode" :unauthorized="sessionExpired" :focus="route.path === '/model_laboratory' ? 'laboratory' : ''" />
<BluetoothPage v-else-if="route.path === '/bluetooth'" :mode="state.monitorMode" :unauthorized="sessionExpired" />
<StarPortPage v-else-if="route.path === '/starport'" :mode="state.monitorMode" :local-access="authState.localAccess" :unauthorized="sessionExpired" />
<SpotifyPage v-else-if="['/starport/audio', '/spotify'].includes(route.path)" :mode="state.monitorMode" :unauthorized="sessionExpired" />
@@ -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: `
<div class="gx-settings gx-models" :inert="busy" :aria-busy="busy || undefined">
<header class="gx-settings__header gx-page-header"><div><h2>Model Laboratory</h2>
<p>Pair lateral judgment from one model with longitudinal judgment from another. Enabling applies when modeld next starts, when it loads and verifies the model weights, input tensors and GPU state.</p></div>
<div class="gx-actions"><span class="gx-chip">{{ status ? (status.chestnutReady ? 'Chestnut ready' : 'Chestnut required') : 'Waiting for device status' }}</span><span v-if="status" class="gx-chip">{{ status.isOnroad ? 'Onroad' : 'Parked' }}</span></div></header>
<GxState v-if="mode !== 'local'">Model Laboratory is available on the device. Preview does not configure a pair.</GxState>
<GxState v-else-if="loading" loading>Loading Model Laboratory…</GxState>
<GxNotice tone="danger" v-if="error">{{ error }}</GxNotice>
<GxNotice tone="danger" v-if="status?.configurationError">{{ status.configurationError }}</GxNotice>
<GxNotice v-if="status?.runtime.error" tone="danger">{{ status.runtime.error }}</GxNotice>
<GxNotice v-if="message" tone="info">{{ message }}</GxNotice>
<template v-if="mode === 'local' && !loading">
<section class="gx-card">
<div class="gx-section__header"><i class="bi bi-collection"></i><span class="gx-section__title">Compose a pair</span><span class="gx-chip">{{ configuration.enabled ? 'Enabled' : 'Disabled' }}</span></div>
<div class="gx-panel gx-stack">
<label class="gx-field-group"><strong>Lateral model</strong><small>Path shape, curvature, lane geometry, and driving desire</small><GalaxySelect class="gx-field" aria-label="Lateral model" :disabled="!status || status.isOnroad || status.download.downloading" :value="configuration.lateralModel" @change="changeLateral($event.target.value)"><option value="">Choose a model</option><option v-for="m in readyModels" :key="m.value" :value="m.value">{{ m.label }} · {{ m.version }}</option></GalaxySelect></label>
<label class="gx-field-group"><strong>Longitudinal model</strong><small>Speed, acceleration, stopping, leads, and scene confidence</small><GalaxySelect class="gx-field" aria-label="Longitudinal model" :disabled="!status || status.isOnroad || status.download.downloading" :value="configuration.longitudinalModel" @change="configuration.longitudinalModel=$event.target.value;dirty=true"><option value="">Choose a model</option><option v-for="m in candidates" :key="m.value" :value="m.value">{{ m.label }} · {{ m.version }}</option></GalaxySelect></label>
<p class="gx-row__desc">{{ modelLabel(configuration.lateralModel) }} steers · {{ modelLabel(configuration.longitudinalModel) }} paces</p>
<GxNotice v-if="selectionError" tone="danger">{{ selectionError }}</GxNotice>
<div class="gx-row"><div class="gx-row__info"><span class="gx-row__label">Enable model pair</span></div>
<label class="gx-switch"><input type="checkbox" role="switch" aria-label="Enable model pair" :checked="status?.configuration.enabled === true"
:disabled="busy || !actionAvailable(status?.configuration.enabled ? 'disable' : 'enable')"
@change="$event.target.checked=status.configuration.enabled; reportSave(() => act(status.configuration.enabled ? 'disable' : 'enable'))"><span class="gx-switch__track"></span><span class="gx-switch__thumb"></span></label></div>
<div class="gx-actions"><button class="gx-btn gx-btn--tonal" :disabled="!actionAvailable('refresh')" @click="act('refresh')">Check model catalog</button></div>
</div>
</section>
<section class="gx-card">
<div class="gx-section__header"><i class="bi bi-download"></i><span class="gx-section__title">Available models</span></div>
<GxSummary :items="[{label: 'Catalog models', value: availableModels.length}, {label: 'Published versions', value: status?.summary?.published || 0}, {label: 'Verified downloads', value: readyModels.length}]" />
<p class="gx-note gx-inset">Browse Small and Big models here. Combining models requires compatible Chestnut downloads and support for running them together.</p>
<p class="gx-note gx-inset">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.</p>
<p v-if="status && !availableModels.length" class="gx-note gx-inset">The model catalog is unavailable. Refresh to retry.</p>
<article v-for="m in availableModels" :key="m.value" class="gx-row gx-row--wrap"><div class="gx-row__info gx-row__info--wide"><span class="gx-row__label">{{ m.label }}</span><span class="gx-row__desc">{{ m.value }} · {{ m.small ? 'Small' : 'Big' }} · {{ m.series || 'Unknown series' }} · {{ m.version }}</span><span class="gx-row__desc">{{ m.modelLabReason || 'Pair artifact status unavailable' }}</span></div><div class="gx-actions"><span class="gx-chip">{{ statusLabel(m) }}</span><button v-if="m.modelLabEligible && m.modelLabArtifactAvailable && !m.modelLabArtifactInstalled" class="gx-btn gx-btn--tonal" :disabled="!actionAvailable('download',m)" @click="act('download',m)">{{ m.small ? (m.modelLabChestnut === false ? 'Download Small model' : 'Download pair variants') : 'Download Big model' }}</button><button v-else-if="m.small && m.modelLabChestnut !== false && m.modelLabArtifactInstalled" class="gx-btn gx-btn--tonal" :disabled="!actionAvailable('delete',m)" @click="act('delete',m)">Delete eGPU variant</button></div></article>
<div v-if="status?.download.downloading" class="gx-row"><div class="gx-row__info"><span class="gx-row__desc">{{ status.download.progress || 'Downloading…' }}</span></div><button class="gx-btn gx-btn--tonal" :disabled="!actionAvailable('cancel')" @click="act('cancel')">Cancel download</button></div>
</section>
</template>
</div>`,
}
export {
LaboratoryFeed,
ModelsPage as LaboratoryPage,
laboratoryModels,
laboratoryReady,
laboratorySelectionError,
laboratoryActionAllowed,
laboratoryDraft,
laboratoryStatusLabel,
} from "./models.js"
+559 -120
View File
@@ -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: `
<div class="gx-view gx-model-manager" :inert="!!busy" :aria-busy="!!busy || undefined">
<GxState v-if="mode !== 'local'">Model Manager is unavailable in the offline preview.</GxState>
<GxState v-if="mode !== 'local'">Models are unavailable in the offline preview.</GxState>
<GxState v-else-if="loading" loading>Reading installed models and available downloads…</GxState>
<template v-else>
<header class="gx-settings__header gx-page-header"><div><h2>Model Manager</h2>
<p>Choose what drives your car and manage downloads.</p></div></header>
<header class="gx-settings__header gx-page-header"><div><h2>Models</h2>
<p>Choose what drives your car, pair models, and manage downloads.</p></div></header>
<GxNotice v-if="message" tone="info">{{ message }}</GxNotice>
<GxNotice v-if="error" tone="danger" title="Model Manager">{{ error }}</GxNotice>
<GxNotice v-if="error" tone="danger" title="Models">{{ error }}</GxNotice>
<GxNotice v-if="status.isOnroad" tone="warn">Selections apply next onroad cycle. Park before downloading models or changing Jetlink.</GxNotice>
<GxNotice v-if="progressInfo && progressInfo.failed" tone="danger" :title="progressTitle">
@@ -594,48 +865,82 @@ export const ModelsPage = {
</template>
</GxNotice>
<section v-if="laboratoryEnabled || laboratoryRunning" class="gx-card">
<div class="gx-section__header"><i aria-hidden="true" class="bi bi-bezier2"></i><span class="gx-section__title">Model Laboratory</span></div>
<div class="gx-panel gx-stack">
<p v-if="laboratoryEnabled">Laboratory is on. Its lateral/longitudinal pair overrides the Small/Big selections below at the next model start.</p>
<p v-else>Laboratory is off for the next start. The currently loaded pair stays in use until then.</p>
<p v-if="laboratoryRunning">Loaded pair: {{ runningModelLabel }}<span v-if="runtime.data.laboratory.pendingNextStart"> · saved changes pending next start</span></p>
<p v-else-if="laboratoryEnabled">{{ runtime.status === 'ready' && runtime.data?.laboratory?.health === 'fallback' ? runtime.data.laboratory.error : 'The pair is not currently verified as running.' }}</p>
<div class="gx-actions">
<a class="gx-btn gx-btn--tonal" href="#/model_laboratory">Open Laboratory</a>
<button v-if="laboratoryEnabled" type="button" class="gx-btn" :disabled="!actionAvailable('disable-laboratory')" @click="runAction('disable-laboratory')">Turn off Laboratory</button>
</div>
<p v-if="laboratoryEnabled && status.isOnroad" class="gx-note">Park to turn off Laboratory. Changes apply at the next model start.</p>
</div>
</section>
<section class="gx-card gx-model-driving">
<div class="gx-panel gx-model-driving__body">
<div class="gx-model-driving__selects">
<div class="gx-model-control">
<label class="gx-row__label" for="gx-model-small">Active Small · On-device</label>
<GalaxySelect id="gx-model-small" class="gx-field" :value="pendingChoice?.action === 'select-small' ? pendingChoice.value : activeSmallModel" :disabled="selectionUncertain || capabilities.select !== true || status.randomizer" @change="runAction('select-small', installedSmallModels.find(m => m.value === $event.target.value))">
<option v-for="m in installedSmallModels" :key="m.value" :value="m.value" :disabled="!m.selectable">{{ m.label || m.value }}</option>
</GalaxySelect>
</div>
<div class="gx-model-control">
<label class="gx-row__label" for="gx-model-big">Active Big · External GPU</label>
<GalaxySelect id="gx-model-big" class="gx-field" :value="pendingChoice?.action === 'select-big' ? pendingChoice.value : activeBigModel" :disabled="selectionUncertain || capabilities.select !== true || status.randomizer || status.jetlinkBig && status.isOnroad !== false" @change="$event.target.value ? runAction('select-big', installedBigModels.find(m => m.value === $event.target.value)) : runAction('select-big')">
<option value="">{{ bigNoneLabel }}</option>
<option v-for="m in installedBigModels" :key="m.value" :value="m.value" :disabled="!m.selectable">{{ m.label || m.value }}</option>
</GalaxySelect>
</div>
<div class="gx-tabs gx-model-mode" role="group" aria-label="Driving models">
<button type="button" :aria-pressed="driveMode === 'single'" :disabled="!!busy || labLocked && driveMode !== 'single'" @click="setDriveMode('single')"><i aria-hidden="true" class="bi bi-cpu"></i> Single model</button>
<button type="button" :aria-pressed="driveMode === 'pair'" :disabled="!!busy || labLocked" @click="setDriveMode('pair')"><i aria-hidden="true" class="bi bi-bezier2"></i> Model pair</button>
</div>
<div class="gx-model-driving__foot">
<div class="gx-row gx-row--borderless gx-model-driving__random" :class="{disabled: !actionAvailable(status.randomizer ? 'disable-randomizer' : 'enable-randomizer')}">
<span class="gx-row__info gx-row__label"><i aria-hidden="true" class="bi bi-shuffle"></i> Model Randomizer <small class="gx-model-driving__random-hint">tries a different model each drive</small></span>
<label class="gx-switch"><input type="checkbox" role="switch" aria-label="Model Randomizer" :checked="status.randomizer === true" :disabled="!actionAvailable(status.randomizer ? 'disable-randomizer' : 'enable-randomizer')" @change="toggleRandomizer($event)"><span class="gx-switch__track"></span><span class="gx-switch__thumb"></span></label>
<template v-if="driveMode === 'single'">
<div class="gx-model-driving__summary" role="group" aria-label="Active models">
<div class="gx-model-control gx-model-summary-item">
<span class="gx-model-summary-item__meta"><i aria-hidden="true" class="bi bi-cpu"></i> Active Small · On-device</span>
<strong class="gx-model-summary-item__value">{{ activeSmallLabel }}</strong>
</div>
<div class="gx-model-control gx-model-summary-item">
<span class="gx-model-summary-item__meta"><i aria-hidden="true" class="bi bi-gpu-card"></i> Active Big · External</span>
<div class="gx-model-summary-item__row">
<strong v-if="activeBigModel" class="gx-model-summary-item__value">{{ activeBigLabel }}</strong>
<strong v-else class="gx-model-summary-item__value gx-model-summary-item__value--muted">{{ bigNoneLabel }}</strong>
<button v-if="activeBigModel" type="button" class="gx-icon-btn gx-model-summary-item__clear" :disabled="selectionUncertain || !actionAvailable('select-big')" aria-label="Clear Active Big model" title="Clear Active Big (use Active Small)" @click="runAction('select-big')"><i aria-hidden="true" class="bi bi-x-lg"></i></button>
</div>
</div>
</div>
<span class="gx-chip gx-model-driving__running">Running now: {{ runningModelLabel }}</span>
<div class="gx-model-driving__foot">
<div class="gx-row gx-row--borderless gx-model-driving__random" :class="{disabled: !actionAvailable(status.randomizer ? 'disable-randomizer' : 'enable-randomizer')}">
<span class="gx-row__info gx-row__label"><i aria-hidden="true" class="bi bi-shuffle"></i> Model Randomizer <small class="gx-model-driving__random-hint">tries a different model each drive</small></span>
<label class="gx-switch"><input type="checkbox" role="switch" aria-label="Model Randomizer" :checked="status.randomizer === true" :disabled="!actionAvailable(status.randomizer ? 'disable-randomizer' : 'enable-randomizer')" @change="toggleRandomizer($event)"><span class="gx-switch__track"></span><span class="gx-switch__thumb"></span></label>
</div>
<span class="gx-chip gx-model-driving__running">Running now: {{ runningModelLabel }}</span>
</div>
<p v-if="status.randomizer" class="gx-model-reason">A different verified model is chosen each start. {{ status.gpuAvailable && activeBigModel ? 'Big GPU' : 'Small on-device' }} models are used. {{ (status.blacklistedModels || []).length }} excluded. Favorites only mark your preferred models.</p>
<p v-if="gpuNote" class="gx-model-reason">{{ gpuNote }}</p>
<p class="gx-model-reason">{{ laboratoryEnabled ? 'Small/Big selections are saved as fallback choices. Turn off Laboratory to use them normally at the next start.' : 'Selections take effect the next time the driving model starts.' }}</p>
</template>
<div v-else id="gx-model-laboratory" ref="laboratory" class="gx-model-laboratory">
<div class="gx-model-driving__foot">
<div class="gx-actions gx-tags">
<span class="gx-chip">{{ lab ? (lab.chestnutReady ? 'Chestnut ready' : 'Chestnut required') : 'Waiting for device status' }}</span>
<span v-if="lab" class="gx-chip" :class="{'gx-chip--selected': labRuntimeState === 'Pair active'}">{{ labRuntimeState }}</span>
</div>
<span class="gx-chip gx-model-driving__running">Running now: {{ runningModelLabel }}</span>
</div>
<GxNotice v-if="labError" tone="danger" title="Model Laboratory">{{ labError }}</GxNotice>
<GxNotice v-if="lab?.configurationError" tone="danger">{{ lab.configurationError }}</GxNotice>
<p v-if="!lab && !labError" class="gx-note">Loading Model Laboratory…</p>
<template v-if="lab">
<p class="gx-model-reason">Pair lateral judgment from one model with longitudinal judgment from another.</p>
<div class="gx-model-driving__selects">
<div class="gx-model-control">
<label class="gx-row__label" for="gx-lab-lateral">Lateral model <small class="gx-model-driving__random-hint">steering &amp; path</small></label>
<GalaxySelect id="gx-lab-lateral" class="gx-field" aria-label="Lateral model" :disabled="labLocked" :value="labConfig.lateralModel" @change="changeLateral($event.target.value)">
<option value="">Choose a model</option>
<option v-for="m in labReady" :key="m.value" :value="m.value">{{ m.label }} · {{ m.version }}</option>
</GalaxySelect>
</div>
<div class="gx-model-control">
<label class="gx-row__label" for="gx-lab-longitudinal">Longitudinal model <small class="gx-model-driving__random-hint">speed &amp; lead pacing</small></label>
<GalaxySelect id="gx-lab-longitudinal" class="gx-field" aria-label="Longitudinal model" :disabled="labLocked" :value="labConfig.longitudinalModel" @change="changeLongitudinal($event.target.value)">
<option value="">Choose a model</option>
<option v-for="m in labCandidates" :key="m.value" :value="m.value">{{ m.label }} · {{ m.version }}</option>
</GalaxySelect>
</div>
</div>
<p class="gx-model-reason">{{ labModelLabel(labConfig.lateralModel) }} steers · {{ labModelLabel(labConfig.longitudinalModel) }} paces</p>
<p class="gx-model-reason">The pair takes effect the next time the driving model starts.</p>
<p v-if="!lab.runtimeSupported && labSelectionError !== lab.runtimeUnavailableReason" class="gx-model-reason">{{ lab.runtimeUnavailableReason || 'Pair runtime is unavailable.' }}</p>
<GxNotice v-if="labSelectionError" :tone="labChoiceProblem ? 'danger' : 'info'">{{ labSelectionError }}</GxNotice>
<GxNotice v-if="lab.runtime.error" tone="danger">{{ lab.runtime.error }}</GxNotice>
<div class="gx-model-driving__foot">
<span class="gx-model-reason">Verified downloads: {{ labReady.length }} of {{ lab.summary?.published || 0 }} published for pairing.</span>
<button type="button" class="gx-btn gx-btn--tonal" @click="showPairable"><i aria-hidden="true" class="bi bi-bezier2"></i> Show pairable models</button>
</div>
<p class="gx-model-reason">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. When available, the comma GPU runs one Small role while Chestnut runs the other role.</p>
</template>
</div>
<p v-if="status.randomizer" class="gx-model-reason">A different verified model is chosen each start. {{ status.gpuAvailable && activeBigModel ? 'Big GPU' : 'Small on-device' }} models are used. {{ (status.blacklistedModels || []).length }} excluded. Favorites only mark your preferred models.</p>
<p v-if="gpuNote" class="gx-model-reason">{{ gpuNote }}</p>
<p class="gx-model-reason">{{ laboratoryEnabled ? 'Small/Big selections are saved as fallback choices. Turn off Laboratory to use them normally at the next start.' : 'Selections take effect the next time the driving model starts.' }}</p>
</div>
</section>
@@ -666,70 +971,204 @@ export const ModelsPage = {
</details>
</section>
<section class="gx-card gx-model-library">
<section ref="library" class="gx-card gx-model-library">
<div class="gx-panel gx-model-toolbar">
<div class="gx-guided__segmented gx-model-tabs" role="radiogroup" aria-label="Show models">
<label v-for="t in tabs" :key="t.id" class="gx-btn gx-btn--tonal gx-guided__choice">
<input class="gx-sr-only" type="radio" name="gx-model-tab" :checked="libraryTab === t.id" @change="setTab(t.id)">
<span class="gx-model-tabs__long">{{ t.long }}</span><span class="gx-model-tabs__short">{{ t.short }}</span> <span class="gx-model-tabs__count">{{ t.count }}</span>
</label>
<div class="gx-model-searchbar">
<div class="gx-model-search-wrap">
<i aria-hidden="true" class="bi bi-search gx-model-search__icon"></i>
<input class="gx-field gx-model-search" type="search" v-model.trim="search" placeholder="Search models…" aria-label="Search models">
</div>
<div class="gx-actions gx-model-toolbar__actions">
<button v-if="status.downloading" type="button" class="gx-btn gx-btn--danger" :disabled="!actionAvailable('cancel')" @click="runAction('cancel')"><i aria-hidden="true" class="bi bi-stop-circle"></i> {{ cancelLabel }}</button>
<button v-else type="button" class="gx-btn" :disabled="!actionAvailable('downloadAll')" @click="runAction('downloadAll')"><i aria-hidden="true" class="bi bi-download"></i> Download all<template v-if="summary.missing"> ({{ summary.missing }})</template></button>
<button type="button" class="gx-btn gx-btn--tonal" :disabled="!actionAvailable('refresh')" aria-label="Check for new models" title="Check for new models" @click="runAction('refresh')"><i aria-hidden="true" v-if="busy === 'refresh:' || status.refreshing" class="bi bi-arrow-repeat gx-spin"></i><i aria-hidden="true" v-else class="bi bi-arrow-clockwise"></i> <span class="gx-model-toolbar__label">Check for new models</span></button>
</div>
</div>
<div class="gx-settings-tabs gx-model-filters" role="group" aria-label="Sort and filter models">
<GalaxySelect class="gx-field gx-model-sort" aria-label="Sort models" :value="sortMode" @change="sortMode = $event.target.value">
<option value="release_date">Newest first</option>
<option value="alphabetical">Name A–Z</option>
</GalaxySelect>
<button type="button" class="gx-chip" :aria-pressed="userFilter === 'yes'" @click="userFilter = userFilter === 'yes' ? 'all' : 'yes'"><i class="bi bi-star" aria-hidden="true"></i> Favorites</button>
<button type="button" class="gx-chip" :aria-pressed="communityFilter === 'yes'" @click="communityFilter = communityFilter === 'yes' ? 'all' : 'yes'"><i class="bi bi-people" aria-hidden="true"></i> Community</button>
</div>
<div class="gx-actions gx-model-toolbar__actions">
<button v-if="status.downloading" type="button" class="gx-btn gx-btn--danger" :disabled="!actionAvailable('cancel')" @click="runAction('cancel')"><i aria-hidden="true" class="bi bi-stop-circle"></i> {{ cancelLabel }}</button>
<button v-else type="button" class="gx-btn" :disabled="!actionAvailable('downloadAll')" @click="runAction('downloadAll')"><i aria-hidden="true" class="bi bi-download"></i> Download all<template v-if="summary.missing"> ({{ summary.missing }})</template></button>
<button type="button" class="gx-btn gx-btn--tonal" :disabled="!actionAvailable('refresh')" aria-label="Check for new models" title="Check for new models" @click="runAction('refresh')"><i aria-hidden="true" v-if="busy === 'refresh:' || status.refreshing" class="bi bi-arrow-repeat gx-spin"></i><i aria-hidden="true" v-else class="bi bi-arrow-clockwise"></i> <span class="gx-model-toolbar__label">Check for new models</span></button>
<div class="gx-model-toolbar__row">
<div class="gx-guided__segmented gx-model-tabs" role="radiogroup" aria-label="Show models">
<label v-for="t in tabs" :key="t.id" class="gx-btn gx-btn--tonal gx-guided__choice">
<input class="gx-sr-only" type="radio" name="gx-model-tab" :checked="libraryTab === t.id" @change="setTab(t.id)">
<span class="gx-model-tabs__long">{{ t.long }}</span><span class="gx-model-tabs__short">{{ t.short }}</span> <span class="gx-model-tabs__count">{{ t.count }}</span>
</label>
</div>
<div class="gx-settings-tabs gx-model-filters" role="group" aria-label="Sort and filter models">
<GalaxySelect class="gx-field gx-model-sort" aria-label="Sort models" :value="sortMode" @change="sortMode = $event.target.value">
<option value="release_date">Newest first</option>
<option value="alphabetical">Name A–Z</option>
<option value="size">Largest first</option>
</GalaxySelect>
<button type="button" class="gx-chip" :aria-pressed="userFilter === 'yes'" @click="userFilter = userFilter === 'yes' ? 'all' : 'yes'"><i class="bi bi-star" aria-hidden="true"></i> Favorites</button>
<button type="button" class="gx-chip" :aria-pressed="communityFilter === 'yes'" @click="communityFilter = communityFilter === 'yes' ? 'all' : 'yes'"><i class="bi bi-people" aria-hidden="true"></i> Community</button>
<button type="button" class="gx-chip" :aria-pressed="pairableFilter" @click="pairableFilter = !pairableFilter"><i class="bi bi-bezier2" aria-hidden="true"></i> Pairable</button>
</div>
</div>
</div>
</section>
<div v-if="!sorted.length" class="gx-card"><div class="gx-empty">No models match these favorites. <button type="button" class="gx-btn gx-btn--tonal" @click="userFilter = 'all'; communityFilter = 'all'">Show all models</button></div></div>
<div v-else class="gx-card-grid">
<section class="gx-card gx-model-card" :class="{'gx-model-card--polaris': isPolaris(m), 'gx-model-card--selected': rowState(m) === 'active'}" v-for="m in sorted" :key="m.value">
<div class="gx-panel">
<div class="gx-model-card__heading">
<strong v-if="isPolaris(m)" :title="m.value"><span class="gx-model-card__title">{{ polarisTitleParts(m)[0] }}</span><span>{{ polarisTitleParts(m)[1] }}</span></strong>
<strong v-else :title="m.value">{{ m.label || m.value }}</strong>
<button type="button" class="gx-icon-btn" :disabled="!actionAvailable(m.userFavorite ? 'unfavorite' : 'favorite', m)" :aria-label="(m.userFavorite ? 'Remove from your favorites: ' : 'Add to your favorites: ') + m.label" :title="m.userFavorite ? 'Remove from your favorites' : 'Add to your favorites'" @click="runAction(m.userFavorite ? 'unfavorite' : 'favorite', m)">
<i aria-hidden="true" class="bi" :class="m.userFavorite ? 'bi-star-fill' : 'bi-star'"></i>
</button>
<div v-if="!sorted.length" class="gx-empty">No models match these filters. <button type="button" class="gx-btn gx-btn--tonal" @click="clearFilters">Show all models</button></div>
<ul v-else class="gx-model-list" aria-label="Models">
<li class="gx-model-item" :class="{'gx-model-item--pair': driveMode === 'pair', 'gx-model-card--polaris': isPolaris(m), 'gx-model-card--selected': rowState(m) === 'active'}" v-for="m in sorted" :key="m.value">
<template v-if="driveMode === 'pair'">
<div class="gx-model-item__row gx-model-item__row--pair">
<div class="gx-model-item__ver">
<span v-if="m.version" class="gx-model-spec gx-model-spec--ver">{{ m.version }}</span>
</div>
<div class="gx-model-item__main">
<div class="gx-model-item__title">
<strong v-if="isPolaris(m)" :title="m.value"><span class="gx-model-card__title">{{ polarisTitleParts(m)[0] }}</span><span>{{ polarisTitleParts(m)[1] }}</span></strong>
<strong v-else :title="m.value">{{ m.label || m.value }}</strong>
<button v-if="isPolaris(m)" type="button" class="gx-icon-btn gx-model-about" aria-label="About Polaris models" title="About Polaris models" @click="polarisAbout = true"><i class="bi bi-question-circle" aria-hidden="true"></i></button>
</div>
<div class="gx-model-item__meta">
<span class="gx-model-item__hw" :class="{'gx-model-item__hw--gpu': m.requiresGpu}" :title="hardwareTag(m).title || null"><i aria-hidden="true" class="bi" :class="m.requiresGpu ? 'bi-gpu-card' : 'bi-cpu'"></i> {{ m.requiresGpu ? 'External' : 'On-device' }}</span>
<span v-if="m.builtin" class="gx-model-specs"><span class="gx-model-spec">Built-in</span></span>
</div>
<div class="gx-model-item__tagstrip">
<span v-for="role in pairRoles(m)" :key="role" class="gx-chip">{{ role }}</span>
<span v-if="isPairable(m)" class="gx-model-tag gx-model-tag--pair" title="An eGPU variant is published, so this model can be part of a model pair"><i aria-hidden="true" class="bi bi-bezier2"></i> Pairable</span>
<span v-else class="gx-chip">Single-model only</span>
<span v-if="isPolaris(m)" class="gx-chip gx-polaris-badge"><span class="gx-polaris-badge__star" aria-hidden="true">✦</span> StarPilot Custom</span>
<span v-if="m.communityFavorite" class="gx-chip">Community Favorite</span>
</div>
</div>
<div class="gx-model-item__date">{{ releasedText(m.released) }}</div>
<div class="gx-model-item__actions gx-model-item__actions--pair">
<div class="gx-model-item__icons gx-model-item__icons--pair">
<span class="gx-model-item__icon-slot">
<div v-if="downloadStage(m) === 'active' && !isPairDownloading(m) && progressInfo" class="gx-pair-ring" role="progressbar" :aria-label="'Downloading ' + m.label" aria-valuemin="0" aria-valuemax="100" :aria-valuenow="progressInfo.percent ?? 25" :title="'Downloading… ' + (progressInfo.percent ?? 0) + '%'">
<svg class="gx-pair-ring__svg" viewBox="-.8 -.8 17.6 17.6" aria-hidden="true">
<defs>
<linearGradient :id="'gx-ring-grad-main-' + m.value" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color: var(--secondary, #38bdf8)" />
<stop offset="100%" style="stop-color: var(--primary, #9d72ff)" />
</linearGradient>
</defs>
<path class="gx-pair-ring__track" d="M4.406 3.342A5.53 5.53 0 0 1 8 2c2.69 0 4.923 2 5.166 4.579C14.758 6.804 16 8.137 16 9.773 16 11.569 14.502 13 12.687 13H3.781C1.708 13 0 11.366 0 9.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z" />
<path class="gx-pair-ring__fill" pathLength="100" d="M4.406 3.342A5.53 5.53 0 0 1 8 2c2.69 0 4.923 2 5.166 4.579C14.758 6.804 16 8.137 16 9.773 16 11.569 14.502 13 12.687 13H3.781C1.708 13 0 11.366 0 9.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z" :stroke="'url(#gx-ring-grad-main-' + m.value + ')'" />
</svg>
<span class="gx-pair-ring__text">{{ progressInfo.percent ?? 0 }}%</span>
</div>
<span v-else-if="m.installed" class="gx-pair-cloud-done" title="Model downloaded">
<i aria-hidden="true" class="bi bi-cloud-check-fill"></i>
</span>
<button v-else-if="m.downloadAvailable" type="button" class="gx-icon-btn gx-pair-cloud-btn" :disabled="!actionAvailable('download', m)" :aria-label="'Download ' + m.label" :title="'Download ' + m.label + ' (' + fileSizeText(m) + ')'" @click="runAction('download', m)">
<i aria-hidden="true" class="bi bi-cloud-arrow-down"></i>
</button>
</span>
<span class="gx-model-item__icon-slot">
<button v-if="m.installed && !m.builtin" type="button" class="gx-icon-btn gx-text-danger" :disabled="!actionAvailable('delete', m)" :aria-label="'Delete files for ' + m.label" :title="'Delete files for ' + m.label" @click="runAction('delete', m)">
<i aria-hidden="true" class="bi bi-trash"></i>
</button>
</span>
<span class="gx-model-item__icon-slot">
<button type="button" class="gx-icon-btn" :disabled="!actionAvailable(m.userFavorite ? 'unfavorite' : 'favorite', m)" :aria-label="(m.userFavorite ? 'Remove from your favorites: ' : 'Add to your favorites: ') + m.label" :title="m.userFavorite ? 'Remove from your favorites' : 'Add to your favorites'" @click="runAction(m.userFavorite ? 'unfavorite' : 'favorite', m)">
<i aria-hidden="true" class="bi" :class="m.userFavorite ? 'bi-star-fill' : 'bi-star'"></i>
</button>
</span>
</div>
</div>
</div>
<div v-if="labRow(m)?.small || labRow(m)?.modelLabEligible" class="gx-model-item__row gx-model-item__row--pair gx-model-item__subrow">
<div class="gx-model-item__ver">
<span class="gx-model-item__sub-indent" aria-hidden="true"><i class="bi bi-arrow-return-right"></i></span>
</div>
<div class="gx-model-item__main">
<div class="gx-model-item__title">
<span class="gx-model-lab__label"><i aria-hidden="true" class="bi bi-bezier2"></i> {{ labRow(m).small ? 'eGPU variant' : 'Big model' }}</span>
</div>
<div class="gx-model-item__meta">
<span class="gx-model-item__hw gx-model-item__hw--gpu"><i aria-hidden="true" class="bi bi-gpu-card"></i> External</span>
<span class="gx-model-specs">
<span class="gx-model-spec">For model pair</span>
<span v-if="!labRow(m).modelLabEligible || !labRow(m).modelLabArtifactAvailable" class="gx-model-spec">{{ labStatusLabel(labRow(m)) }}</span>
</span>
</div>
</div>
<div class="gx-model-item__date"></div>
<div class="gx-model-item__actions gx-model-item__actions--pair">
<div class="gx-model-item__icons gx-model-item__icons--pair">
<span class="gx-model-item__icon-slot">
<div v-if="isPairDownloading(m)" class="gx-pair-ring" role="progressbar" :aria-label="'Downloading ' + (labRow(m).small ? 'eGPU variant' : 'Big model') + ': ' + m.label" aria-valuemin="0" aria-valuemax="100" :aria-valuenow="pairDownloadPercent(m)" :title="'Downloading… ' + (pairDownloadPercent(m) ?? 0) + '%'">
<svg class="gx-pair-ring__svg" viewBox="-.8 -.8 17.6 17.6" aria-hidden="true">
<defs>
<linearGradient :id="'gx-ring-grad-lab-' + m.value" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color: var(--secondary, #38bdf8)" />
<stop offset="100%" style="stop-color: var(--primary, #9d72ff)" />
</linearGradient>
</defs>
<path class="gx-pair-ring__track" d="M4.406 3.342A5.53 5.53 0 0 1 8 2c2.69 0 4.923 2 5.166 4.579C14.758 6.804 16 8.137 16 9.773 16 11.569 14.502 13 12.687 13H3.781C1.708 13 0 11.366 0 9.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z" />
<path class="gx-pair-ring__fill" pathLength="100" d="M4.406 3.342A5.53 5.53 0 0 1 8 2c2.69 0 4.923 2 5.166 4.579C14.758 6.804 16 8.137 16 9.773 16 11.569 14.502 13 12.687 13H3.781C1.708 13 0 11.366 0 9.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383z" :stroke="'url(#gx-ring-grad-lab-' + m.value + ')'" />
</svg>
<span class="gx-pair-ring__text">{{ pairDownloadPercent(m) ?? 0 }}%</span>
</div>
<button v-else-if="labRow(m).modelLabEligible && labRow(m).modelLabArtifactAvailable && !labRow(m).modelLabArtifactInstalled" type="button" class="gx-icon-btn gx-pair-cloud-btn" :disabled="!labActionAvailable('download', labRow(m))" :aria-label="labDownloadLabel(labRow(m)) + ': ' + m.label" :title="labDownloadLabel(labRow(m)) + ': ' + m.label" @click="runLabAction('download', labRow(m))">
<i aria-hidden="true" class="bi bi-cloud-arrow-down"></i>
</button>
<span v-else-if="labRow(m).modelLabArtifactInstalled" class="gx-pair-cloud-done" :title="labRow(m).small ? 'eGPU variant downloaded' : 'Big model downloaded'">
<i aria-hidden="true" class="bi bi-cloud-check-fill"></i>
</span>
</span>
<span class="gx-model-item__icon-slot">
<button v-if="labRow(m).small && labRow(m).modelLabChestnut !== false && labRow(m).modelLabArtifactInstalled" type="button" class="gx-icon-btn gx-text-danger" :disabled="!labActionAvailable('delete', labRow(m))" :aria-label="'Delete eGPU variant: ' + m.label" title="Delete eGPU variant" @click="runLabAction('delete', labRow(m))">
<i aria-hidden="true" class="bi bi-trash"></i>
</button>
</span>
<span class="gx-model-item__icon-slot"></span>
</div>
</div>
</div>
</template>
<div v-else class="gx-model-item__row">
<div class="gx-model-item__ver">
<span v-if="m.version" class="gx-model-spec gx-model-spec--ver">{{ m.version }}</span>
</div>
<div class="gx-model-item__main">
<div class="gx-model-item__title">
<strong v-if="isPolaris(m)" :title="m.value"><span class="gx-model-card__title">{{ polarisTitleParts(m)[0] }}</span><span>{{ polarisTitleParts(m)[1] }}</span></strong>
<strong v-else :title="m.value">{{ m.label || m.value }}</strong>
<span v-if="isPolaris(m)" class="gx-chip gx-polaris-badge"><span class="gx-polaris-badge__star" aria-hidden="true">✦</span> StarPilot Custom</span>
<button v-if="isPolaris(m)" type="button" class="gx-icon-btn gx-model-about" aria-label="About Polaris models" title="About Polaris models" @click="polarisAbout = true"><i class="bi bi-question-circle" aria-hidden="true"></i></button>
<span v-if="m.communityFavorite" class="gx-chip">Community Favorite</span>
<span v-if="pairableFilter && isPairable(m)" class="gx-model-tag gx-model-tag--pair" title="An eGPU variant is published, so this model can be part of a model pair"><i aria-hidden="true" class="bi bi-bezier2"></i> Pairable</span>
</div>
<div class="gx-model-item__meta">
<span class="gx-model-item__hw" :class="{'gx-model-item__hw--gpu': m.requiresGpu}" :title="hardwareTag(m).title || null"><i aria-hidden="true" class="bi" :class="m.requiresGpu ? 'bi-gpu-card' : 'bi-cpu'"></i> {{ m.requiresGpu ? 'External' : 'On-device' }}</span>
<span v-if="m.builtin" class="gx-model-specs"><span class="gx-model-spec">Built-in</span></span>
</div>
<p v-if="m.unavailableReason && !downloadStage(m) && !(rowState(m) === 'available' && m.downloadAvailable && m.unavailableReason === 'Download required')" class="gx-model-reason gx-model-card__reason">{{ m.unavailableReason }}</p>
<div v-if="status.randomizer || m.blacklisted" class="gx-model-random" :class="{disabled: !actionAvailable(m.blacklisted ? 'include' : 'exclude', m)}">
<span class="gx-row__label">Include in Randomizer</span>
<label class="gx-switch"><input type="checkbox" role="switch" :aria-label="'Include ' + m.label + ' in Randomizer'" :checked="!m.blacklisted" :disabled="!actionAvailable(m.blacklisted ? 'include' : 'exclude', m)"
@change="$event.target.checked=!m.blacklisted; runAction(m.blacklisted ? 'include' : 'exclude', m)"><span class="gx-switch__track"></span><span class="gx-switch__thumb"></span></label>
</div>
</div>
<div class="gx-model-item__date">{{ releasedText(m.released) }}</div>
<div class="gx-model-item__actions">
<div class="gx-model-item__primary">
<div v-if="downloadStage(m) === 'active' && progressInfo" class="gx-model-card__progress" role="progressbar" :aria-label="'Downloading ' + m.label" aria-valuemin="0" aria-valuemax="100" :aria-valuenow="progressInfo.indeterminate ? undefined : progressInfo.percent ?? undefined">
<span class="gx-model-card__progress-fill" :class="{'gx-update-progress__fill--indeterminate': progressInfo.indeterminate}" :style="!progressInfo.indeterminate && progressInfo.percent !== null ? {width: progressInfo.percent + '%'} : {}"></span>
<span class="gx-model-card__progress-label">{{ cardProgressLabel }}</span>
</div>
<button v-else-if="downloadStage(m) === 'queued'" type="button" class="gx-btn gx-btn--tonal" disabled><i aria-hidden="true" class="bi bi-hourglass-split"></i> Waiting in the queue</button>
<button v-else-if="rowState(m) === 'active'" type="button" class="gx-btn gx-btn--tonal gx-model-item__active-btn" disabled><i aria-hidden="true" class="bi bi-check-lg"></i> {{ activeButtonLabel(m) }}</button>
<button v-else-if="m.installed" type="button" class="gx-btn" :disabled="!actionAvailable(m.requiresGpu ? 'select-big' : 'select-small', m)" @click="runAction(m.requiresGpu ? 'select-big' : 'select-small', m)"><i aria-hidden="true" class="bi bi-play-fill"></i> Set Active {{ m.requiresGpu ? 'Big' : 'Small' }}</button>
<button v-else-if="m.downloadAvailable" type="button" class="gx-btn gx-btn--tonal" :disabled="!actionAvailable('download', m)" :aria-label="'Download ' + m.label" @click="runAction('download', m)"><i aria-hidden="true" class="bi bi-download"></i> Download · {{ fileSizeText(m) }}</button>
<button v-else type="button" class="gx-btn gx-btn--tonal" disabled>Not available yet</button>
</div>
<div class="gx-model-item__icons">
<span class="gx-model-item__icon-slot">
<button v-if="m.installed && !m.builtin" type="button" class="gx-icon-btn gx-text-danger" :disabled="!actionAvailable('delete', m)" :aria-label="'Delete files for ' + m.label" :title="'Delete files for ' + m.label" @click="runAction('delete', m)"><i aria-hidden="true" class="bi bi-trash"></i></button>
</span>
<span class="gx-model-item__icon-slot">
<button type="button" class="gx-icon-btn" :disabled="!actionAvailable(m.userFavorite ? 'unfavorite' : 'favorite', m)" :aria-label="(m.userFavorite ? 'Remove from your favorites: ' : 'Add to your favorites: ') + m.label" :title="m.userFavorite ? 'Remove from your favorites' : 'Add to your favorites'" @click="runAction(m.userFavorite ? 'unfavorite' : 'favorite', m)">
<i aria-hidden="true" class="bi" :class="m.userFavorite ? 'bi-star-fill' : 'bi-star'"></i>
</button>
</span>
</div>
</div>
</div>
<div v-if="isPolaris(m) || m.communityFavorite" class="gx-actions gx-tags">
<span v-if="isPolaris(m)" class="gx-chip gx-polaris-badge"><span class="gx-polaris-badge__star" aria-hidden="true">✦</span> StarPilot Custom</span>
<button v-if="isPolaris(m)" type="button" class="gx-icon-btn" aria-label="About Polaris models" title="About Polaris models" @click="polarisAbout = true"><i class="bi bi-question-circle" aria-hidden="true"></i></button>
<span v-if="m.communityFavorite" class="gx-chip">Community Favorite</span>
</div>
<p v-if="m.unavailableReason && !downloadStage(m) && !(rowState(m) === 'available' && m.downloadAvailable && m.unavailableReason === 'Download required')" class="gx-model-reason gx-model-card__reason">{{ m.unavailableReason }}</p>
</div>
<div class="gx-panel-footer gx-model-card__foot">
<div v-if="status.randomizer || m.blacklisted" class="gx-row gx-row--borderless" :class="{disabled: !actionAvailable(m.blacklisted ? 'include' : 'exclude', m)}"><div class="gx-row__info"><span class="gx-row__label">Include in Randomizer</span></div>
<label class="gx-switch"><input type="checkbox" role="switch" :aria-label="'Include ' + m.label + ' in Randomizer'" :checked="!m.blacklisted" :disabled="!actionAvailable(m.blacklisted ? 'include' : 'exclude', m)"
@change="$event.target.checked=!m.blacklisted; runAction(m.blacklisted ? 'include' : 'exclude', m)"><span class="gx-switch__track"></span><span class="gx-switch__thumb"></span></label></div>
<div v-if="downloadStage(m) === 'active' && progressInfo" class="gx-model-card__progress" role="progressbar" :aria-label="'Downloading ' + m.label" aria-valuemin="0" aria-valuemax="100" :aria-valuenow="progressInfo.indeterminate ? undefined : progressInfo.percent ?? undefined">
<span class="gx-model-card__progress-fill" :class="{'gx-update-progress__fill--indeterminate': progressInfo.indeterminate}" :style="!progressInfo.indeterminate && progressInfo.percent !== null ? {width: progressInfo.percent + '%'} : {}"></span>
<span class="gx-model-card__progress-label">{{ cardProgressLabel }}</span>
</div>
<button v-else-if="downloadStage(m) === 'queued'" type="button" class="gx-btn gx-btn--tonal" disabled><i aria-hidden="true" class="bi bi-hourglass-split"></i> Waiting in the queue</button>
<button v-else-if="rowState(m) === 'active'" type="button" class="gx-btn gx-btn--tonal" disabled><i aria-hidden="true" class="bi bi-check-lg"></i> Selected</button>
<button v-else-if="m.installed" type="button" class="gx-btn" :disabled="!actionAvailable(m.requiresGpu ? 'select-big' : 'select-small', m)" @click="runAction(m.requiresGpu ? 'select-big' : 'select-small', m)"><i aria-hidden="true" class="bi bi-play-fill"></i> Set Active {{ m.requiresGpu ? 'Big' : 'Small' }}</button>
<button v-else-if="m.downloadAvailable" type="button" class="gx-btn" :disabled="!actionAvailable('download', m)" :aria-label="'Download ' + m.label" @click="runAction('download', m)"><i aria-hidden="true" class="bi bi-download"></i> Download · {{ fileSizeText(m) }}</button>
<button v-else type="button" class="gx-btn gx-btn--tonal" disabled>Not available yet</button>
</div>
<div class="gx-model-card__meta">
<span class="gx-model-card__facts">{{ modelFacts(m) }}</span>
<button v-if="m.installed && !m.builtin" type="button" class="gx-icon-btn gx-text-danger" :disabled="!actionAvailable('delete', m)" :aria-label="'Delete files for ' + m.label" :title="'Delete files for ' + m.label" @click="runAction('delete', m)"><i aria-hidden="true" class="bi bi-trash"></i></button>
</div>
</section>
</div>
</section>
</div>
</li>
</ul>
</section>
</template>