Skip to content

feat(themes): theme marker, per-overlay theme CSS and SDK theme identity - #316

Merged
egdev6 merged 1 commit into
feat/saved-themesfrom
feat/saved-themes-marker
Nov 23, 2026
Merged

egdev6 merged 1 commit into
feat/saved-themesfrom
feat/saved-themes-marker

Conversation

@egdev6

@egdev6 egdev6 commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Refs #313 · Phase 3 of saved themes → integration branch feat/saved-themes.

  • data-tema="<id>" on overlay, widgets, interview, teleprompter and custom overlay frames, live. The alert overlay switches it with the deferred look when the visible alert exits; idle overlay and other pages switch immediately.
  • Per custom overlay «CSS de este tema»: stored in the theme look (duplicated, swapped on activate), injected live into the sandboxed frame via the trusted shell (textContent, own frame only), no frame reload, overlay code/approval untouched. Editor honours the X-Antena-Theme fence. Size caps per entry and for the whole map.
  • Custom overlay SDK exposes the theme { id, name }; identity + look + theme CSS arrive as one atomic snapshot.
  • Still previews of every alert type use the previewed theme (read-only).
  • Stream contract unchanged: existing events and initial frames byte-identical for overlay/preview/widget/teleprompter over SSE and WebSocket; activeTheme (themeInfo=1) and customOverlayTheme (customTheme=1) are opt-in, sent after them. /api/state shape unchanged.

Verification (independent, Risk 2+3): S4 met; deferral met; stream differential vs feat/saved-themes identical without opt-in params; CSS cannot escape the sandbox, limits hold with nothing written on rejection; v3 configs load byte-identical, export/import round-trip identical. New tests: overlay-theme-deferral, custom-overlays-sdk, saved-themes-marker-contract + browser coverage. Local: unit, browser, platform and typecheck green.

Known follow-up (advisory): every custom shell receives the whole theme-CSS map on theme/CSS changes; fine for typical sizes, could be narrowed per overlay later.

Not in this phase: theme export/import with media (phase 4).

- Overlay, widgets, interview, teleprompter and custom overlay frames carry
  data-tema="<theme id>" on <html>, updated live. The alert overlay switches
  its marker together with the deferred look when the visible alert exits;
  an idle overlay and the other pages switch immediately.
- Each custom overlay gets a theme-owned «CSS de este tema» (stored in the
  theme look, copied on duplicate, swapped on activate). It is injected live
  into the sandboxed frame through the trusted shell without reloading it;
  the overlay's own code and approval never change. The editor honours the
  theme fence.
- The custom overlay SDK exposes the theme { id, name } and receives
  identity, look and theme CSS as one atomic snapshot.
- Still previews of every alert type use the previewed theme read-only.
- Stream contract unchanged: existing events and initial frames are
  byte-identical; activeTheme (themeInfo=1) and customOverlayTheme
  (customTheme=1) are opt-in events sent after them. /api/state shape is
  unchanged.

Refs #313
@egdev6
egdev6 merged commit 6d85530 into feat/saved-themes Nov 23, 2026
5 checks passed
@egdev6
egdev6 deleted the feat/saved-themes-marker branch November 23, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant