feat(terminal): older TVs get a legacy build with a compatibility layer; modern output unchanged

- @vitejs/plugin-legacy: browsers without import.meta.resolve (older than Chrome 105 /
  Firefox 106 / Safari 16.4) load a second copy built for Chrome 79 / Firefox 78 / Safari 13
  with polyfills. The modern targets and the stylesheet stay on Vite's own defaults, so modern
  chunks are byte-identical to before (only plugin-legacy's 230-byte guard in the entry).
- terminal/src/compat.js (legacy copy only): swaps in <name>.compat.css (lightningcss for the
  older targets), sets container-size variables for signage slides, emulates flex gap.
- @xenia/signage cq()/CQ_BOX: container units as before where supported, calc(var()) fallback
  otherwise; EmbeddedSlide no longer uses inline `inset`.
- Shared Notice (@xenia/ui); "Devices that work" in Pair a device and Signage -> Screens (EN/EL).
- tests/e2e/compat.mjs: modern browser loads nothing extra; a simulated older TV runs the legacy
  copy and the layer, pairs, and plays a slide at the same sizes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 17:26:16 +02:00
co-authored by Claude Opus 5.5
parent aa8ba5d1d4
commit 14d592d963
23 changed files with 625 additions and 40 deletions
@@ -0,0 +1,18 @@
// Which devices run the apps (2026-11-21): modern browsers run everything; older ones (a TV's built-in
// browser from 2021–2023) get the compatibility layer (terminal/vite.config.js, terminal/src/compat.js);
// older still, a blank page. Shown in the "Pair a device" dialog and on Signage → Screens.
import { useTranslation } from '@xenia/i18n'
import { Notice } from '@xenia/ui'
import { MonitorSmartphone } from 'lucide-react'
export function DeviceSupport({ className }) {
const { t } = useTranslation('manager')
return (
<Notice tone="info" icon={<MonitorSmartphone size={16} />} title={t('devices.support.title')} className={className} data-testid="device-support"
items={[
{ tone: 'success', label: t('devices.support.bestLabel'), text: t('devices.support.best') },
{ tone: 'warning', label: t('devices.support.compatLabel'), text: t('devices.support.compat') },
{ tone: 'danger', label: t('devices.support.oldLabel'), text: t('devices.support.old') },
]} />
)
}
@@ -12,6 +12,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react'
import { useSearchParams } from 'react-router-dom'
import toast from 'react-hot-toast'
import { MonitorSmartphone, Plus } from 'lucide-react'
import { DeviceSupport } from './DeviceSupport'
import { errorMessage, parseError } from '@xenia/api'
import { useTranslation, useFormat } from '@xenia/i18n'
import { Button, Dialog, EmptyState, Field, Input, Page, Select, Spinner } from '@xenia/ui'
@@ -244,6 +245,7 @@ function PairDialog({ apps, usage, devices, appName, limitLabel, initialApp, onC
<Input value={code} onChange={e => setCode(normalizeCode(e.target.value))} autoComplete="off" spellCheck={false}
className="font-mono tracking-[0.3em] text-center uppercase" autoFocus />
</Field>
<DeviceSupport />
<Field label={t('devices.form.app')} error={full ? t('devices.form.full', { label: limitLabel(appKey), max: usage[appKey].max }) : undefined}>
<Select value={appKey} onChange={e => {
const next = e.target.value