fix(aiui): color-scheme meta keeps iframe transparent so background art survives dark shell
Some checks failed
Demo images / Build & push demo images (push) Failing after 34s

Browsers only honor a transparent same-origin iframe canvas when the
embedder and the iframe agree on color-scheme; the neode-ui shell's
:root{color-scheme:dark} was forcing the AIUI frame opaque and hiding
the background art behind the chat.

Also adds neode-ui/vite.preview.config.mts (preview on :8100 against
the mock backend on :5959).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
archipelago 2026-07-23 04:43:42 -04:00
parent fb72e3e159
commit b991c18e73
2 changed files with 13 additions and 0 deletions

View File

@ -3,6 +3,12 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
<!-- Must agree with the embedding neode-ui shell (color-scheme: dark):
browsers only honor a transparent same-origin iframe canvas when
embedder and iframe use the SAME color-scheme — without this, the
shell's :root{color-scheme:dark} forces this frame opaque and the
background art behind the chat vanishes (2026-07-23). -->
<meta name="color-scheme" content="dark light" />
<meta name="theme-color" content="#0a0a0a" media="(prefers-color-scheme: dark)" /> <meta name="theme-color" content="#0a0a0a" media="(prefers-color-scheme: dark)" />
<meta name="theme-color" content="#faf9f6" media="(prefers-color-scheme: light)" /> <meta name="theme-color" content="#faf9f6" media="(prefers-color-scheme: light)" />
<meta name="mobile-web-app-capable" content="yes" /> <meta name="mobile-web-app-capable" content="yes" />

View File

@ -0,0 +1,7 @@
import baseConfig from './vite.config'
const cfg = { ...(baseConfig as Record<string, unknown>) } as any
cfg.server = { ...(cfg.server || {}), port: 8100, strictPort: true }
const proxy = { ...(cfg.server.proxy || {}) }
for (const k of Object.keys(proxy)) proxy[k] = { ...proxy[k], target: 'http://localhost:5959' }
cfg.server.proxy = proxy
export default cfg