fix(kiosk): pin AIUI to dark theme on kiosk displays

AIUI persists aiui-theme in localStorage and a stored value beats its
prefers-color-scheme fallback, so kiosk profiles from before the launcher
forced a dark color scheme keep white panels forever. Kiosk boot now pins
the same-origin key to dark, healing existing profiles on next load.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
archipelago 2026-07-21 13:27:04 -04:00
parent dc55ef8a54
commit 5951d31637

View File

@ -131,6 +131,13 @@ function syncKioskSafeArea() {
// (--in-process-gpu / --disable-gpu), where heavy compositing effects
// (3D bg layers, animated mix-blend overlays) fail and paint black.
document.documentElement.classList.toggle('kiosk-mode', isKiosk)
if (isKiosk) {
// AIUI (same-origin iframe) themes from localStorage['aiui-theme'], and a
// stored value beats its prefers-color-scheme fallback. Kiosk profiles
// that ran before the launcher forced a dark color-scheme have "light"
// baked in white panels on an otherwise dark TV UI so pin it dark.
try { localStorage.setItem('aiui-theme', 'dark') } catch { /* storage full/denied */ }
}
const rawSafeArea = localStorage.getItem('archipelago_kiosk_safe_area_px') || '0'
const safeArea = /^\d{1,3}$/.test(rawSafeArea) ? Number(rawSafeArea) : 0
const rawSafeAreaX = localStorage.getItem('archipelago_kiosk_safe_area_x_px') || rawSafeArea