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
+22
View File
@@ -221,3 +221,25 @@ test('owner review 5: the venue badges, several per product; a board with its ow
assert.equal(badgeName(mine[0], 'el'), 'Gluten free')
assert.equal(badgeName(DEFAULT_BADGES[1], 'el'), 'Πρόταση σεφ')
})
test('container units: written exactly as before where the browser has them (older TVs, 2026-11-21)', async () => {
const { cq, CQ_BOX, CQ_NATIVE } = await import('../src/cq.js')
const { fitUnit } = await import('../src/logic.js')
assert.equal(CQ_NATIVE, true)
assert.equal(cq(3), '3cqmin')
assert.equal(cq(4.5, 'h'), '4.5cqh')
assert.equal(cq(0.25, 'w'), '0.25cqw')
assert.deepEqual(CQ_BOX, {})
assert.equal(fitUnit(4, 20)(2), 'calc(2 * min(25cqh, 5cqw))')
})
test('container units: an older browser gets calc() of the variables the compat layer sets', async () => {
globalThis.CSS = { supports: () => false }
try {
const { cq, CQ_BOX, CQ_NATIVE } = await import('../src/cq.js?older')
assert.equal(CQ_NATIVE, false)
assert.equal(cq(3), 'calc(3 * var(--xcqmin, 1vmin))')
assert.equal(cq(4.5, 'h'), 'calc(4.5 * var(--xcqh, 1vh))')
assert.deepEqual(CQ_BOX, { 'data-cq': '' })
} finally { delete globalThis.CSS }
})