diff --git a/openpilot/starpilot/galaxy/tests/browser/layout-scenes.cjs b/openpilot/starpilot/galaxy/tests/browser/layout-scenes.cjs index 81ad2f123a..588fefe98d 100644 --- a/openpilot/starpilot/galaxy/tests/browser/layout-scenes.cjs +++ b/openpilot/starpilot/galaxy/tests/browser/layout-scenes.cjs @@ -54,6 +54,7 @@ print(json.dumps(dict(native=native,projection=projection))) await page.getByRole('combobox', { name: 'Preview scene', exact: true }).click() await page.getByRole('option', { name: scene.label, exact: true }).click() if (!nativeArt) { + await page.waitForFunction(() => window.editor.state.art.status === 'unavailable') assert.equal(await page.locator('.gx-layout__widget [data-preview-source="sketch"]').count(), await page.evaluate(() => window.editor.renderWidgets.filter(w => !window.editor.profile.runtimePreviewWidgets.includes(w.id)).length), `${target}/${scene.id}: each widget has artwork without a device render`) } diff --git a/openpilot/starpilot/galaxy/tests/browser/widget-layers.cjs b/openpilot/starpilot/galaxy/tests/browser/widget-layers.cjs index 260982c54e..3e4f7695ec 100644 --- a/openpilot/starpilot/galaxy/tests/browser/widget-layers.cjs +++ b/openpilot/starpilot/galaxy/tests/browser/widget-layers.cjs @@ -218,6 +218,7 @@ const projection = JSON.parse(execFileSync(process.env.PYTHON || 'python3', ['-c assert.equal(await page.evaluate(() => window.editor.state.draft.layouts.large.nav_home.display), 'icons') assert.equal(await page.evaluate(() => window.editor.state.draft.layouts.large.nav_work.display), 'words') const homePreview = page.locator('svg.gx-layout__preview .gx-layout__widget').filter({has:page.locator('.gx-layout__hit[width="110"]')}) + await page.waitForFunction(() => !window.editor.artLoading) assert.equal(await homePreview.count(), 1) assert.equal(await homePreview.locator('[data-preview-source="sketch"]').count(), 0) assert.equal(await homePreview.locator('.gx-layout-widget-art text').count(), 0) @@ -227,10 +228,12 @@ const projection = JSON.parse(execFileSync(process.env.PYTHON || 'python3', ['-c assert.equal(await homeDisplay.getByRole('button', {name:'Icons', exact:true}).getAttribute('aria-pressed'), 'true') await page.evaluate(() => { window.editor.state.selected = 'nav_work' }) await page.getByRole('group', {name:'Work display', exact:true}).getByRole('button', {name:'Icons', exact:true}).click() + await page.waitForFunction(() => !window.editor.artLoading) assert.equal(await homePreview.count(), 2) assert.equal(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), true) await page.screenshot({path:path.join(tmpdir(), 'starport-favorite-icons.png'),fullPage:true}) await page.getByRole('group', {name:'Work display', exact:true}).getByRole('button', {name:'Words', exact:true}).click() + await page.waitForFunction(() => !window.editor.artLoading) assert.equal(await homePreview.count(), 1) assert.equal(await page.evaluate(() => window.editor.layout.bookmark.enabled), false) await page.getByRole('combobox', {name:/^Selected widget/}).click() @@ -243,6 +246,7 @@ const projection = JSON.parse(execFileSync(process.env.PYTHON || 'python3', ['-c await opacity.fill('45') await opacity.dispatchEvent('change') const bookmarkPreview = page.locator('.gx-layout__widget[aria-label^="Bookmark"] .gx-layout-widget-art') + await bookmarkPreview.waitFor({state:'attached'}) assert.equal(await bookmarkPreview.locator('rect').count(), 0) assert.equal(await bookmarkPreview.locator('[data-preview-source="sketch"]').count(), 0) assert.equal(await page.evaluate(() => window.editor.layout.bookmark.opacity), 45) diff --git a/openpilot/starpilot/galaxy/web/js/onroad-layout.js b/openpilot/starpilot/galaxy/web/js/onroad-layout.js index 41e73cd425..e4a56490a9 100644 --- a/openpilot/starpilot/galaxy/web/js/onroad-layout.js +++ b/openpilot/starpilot/galaxy/web/js/onroad-layout.js @@ -621,7 +621,10 @@ export const OnroadLayoutPage = { return [id, narrow] })) } }, - artLoading() { return this.mode === 'local' && !!this.state.data?.editable && !this.layers.art.url && this.state.art.status !== 'unavailable' }, + artLoading() { + return this.mode === 'local' && !!this.state.data?.editable && !this.layers.art.url && + ['idle', 'updating'].includes(this.state.art.status) + }, // Widget art and the backdrop always come from the same scene, so a half-switched pair never overlaps. layers() { const { art, backdrop } = this.state, profile = this.projection ? "projection" : this.state.profile diff --git a/prebuilt.json b/prebuilt.json index 18f025208a..e0791136f9 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "774c3d90a22e068dafe383f454e58a1c799499b702b56b363ffb63fcee109889", "schema_version": 1} +{"protected_inventory_sha256": "3b11b00ff35671c4775ee301e86072b6b2bee27c59a74ef18b0018f00b105df0", "schema_version": 1}