Keep Galaxy widget previews visible while editing

This commit is contained in:
firestar5683
2026-11-20 19:15:36 -06:00
parent e29879ca79
commit ef3b03444c
4 changed files with 10 additions and 2 deletions
@@ -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`)
}
@@ -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)
@@ -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
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "774c3d90a22e068dafe383f454e58a1c799499b702b56b363ffb63fcee109889", "schema_version": 1}
{"protected_inventory_sha256": "3b11b00ff35671c4775ee301e86072b6b2bee27c59a74ef18b0018f00b105df0", "schema_version": 1}