Repository navigation
feat(themes): saved themes - #319
Merged
Merged
Conversation
A theme is a full copy of the element configuration: appearance, alerts, overlay, widgets (incl. chat variants and goals), interactive config, commands and timers, plus a reserved per-custom-overlay CSS map. One theme is active; its sections stay in place, so every existing reader and writer keeps working and edits go to the active theme. - Config migration v3 creates «Normal» from the current config and freezes its effective look (resolved defaults, variation conditions, sparse commands/timers), so later default changes do not alter an install. The previous file is backed up byte for byte. - /api/themes: list, duplicate (max 10), rename, delete (not the active one), activate and create from the default look. Activation is one save with a backup and pushes theme, alerts, widgets and custom overlays live. Generic config writes cannot touch themes. - MCP: listar_temas, activar_tema, duplicar_tema, renombrar_tema, borrar_tema (activation and deletion require confirmation). - The alert overlay applies a new theme after the alert on screen ends. Refs #313
feat(themes): saved themes with an atomic switch (data and API)
…l preview Implements the chosen artboard design/saved-themes/03-detalle-con-vista-previa: - Apariencia gets a «Temas» tab: saved themes (n/10), select to preview without activating, a large preview rendered by the real overlay, goal and chat renderers with the selected theme's own look (read-only projection), and Activar / Duplicar / Renombrar / Borrar (disabled on the active theme). «Nuevo tema» duplicates a theme or starts from «Color de cada plataforma». - The panel sidebar footer shows the active theme with a quick switcher; the dock shows it in its header and adds a «Tema» tab (narrow and wide). - Stream Deck action to activate a theme; all surfaces follow a switch live. - Presets are reduced to «Color de cada plataforma», now the look of new installs and of themes created from the default; migrated installs keep their previous default look. - Theme-owned panel writes carry the theme they were edited against: if the active theme changed meanwhile the server answers 409 and writes nothing (mixed overlay + themed writes are atomic); stale drafts stay visible, cannot be saved and can be discarded. API/MCP writes without the header keep writing the active theme. Refs #313
Dark grid stage with a dashed safe area and compact height so the goal and chat previews and the action row fit at 1440x900; each theme's dot shows its accent or the multicolour platform dot; the selected theme shows «Vista previa seleccionada». Refs #313
Each saved theme can carry an avatar (theme metadata, outside the copied look): an uploaded image cropped to a circle and/or a colour drawn as its ring; without one, the theme's dot shows inside the same ring. It is set in «Nuevo tema» and in «Editar» (formerly «Renombrar») and shown in every theme list: Apariencia (list, detail header, «Nuevo tema» origins), the sidebar switcher and the dock header and «Tema» tab. MCP renombrar_tema accepts optional color and imagen. Images must be PNG, JPG, WebP or GIF regular files in the media folder (SVG and symlinks are refused); removing an avatar or deleting a theme never deletes media. Duplicating a theme does not copy its avatar; activation keeps both themes' avatars. Refs #313
.d-btn, declared later with the same specificity, forced a column layout on the theme choices; the artboard shows avatar, name and action in one row. Refs #313
feat(themes): Apariencia › Temas, sidebar and dock selectors, faithful preview
- 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
feat(themes): theme marker, per-overlay theme CSS and SDK theme identity
- GET /api/themes/:id/export downloads a ZIP (config.json manifest with kind theme + media/) holding the theme name, avatar, full look (live sections for the active theme) and every media file it references: alert/variation/command/timer media and sounds, fonts, icons, the avatar and CSS url()/@import/@font-face references per rendering surface. Never secrets, connections, sessions or other system sections, nor custom overlay code (only its theme CSS). - POST /api/themes/import/preview shows name, media, conflicts and warnings without side effects; POST /api/themes/import creates a NEW inactive theme (unique name on clash, 10-theme limit). Colliding media get free names and the references are rewritten preserving their quoting; identical files are reused; theme CSS for missing overlays is dropped with a warning. All-or-nothing: any failure leaves config and media unchanged. - Reuses the config-transfer ZIP reader, streamed upload, limits, fingerprint and scratch handling; full configuration export/import is unchanged. - Apariencia › Temas gets «Exportar» and «Importar tema» (preview dialog); MCP gains exportar_tema and importar_tema_guardado. Refs #313
feat(themes): export and import a single theme with its media
- crear_tema creates an inactive theme from «Color de cada plataforma» or as a copy, with name and avatar. - Theme-owned MCP write and read tools accept an optional `tema`: the existing handler runs against a request-isolated copy of that saved look and the result is committed atomically with the usual conflict check. It never activates the theme, never touches the live config and sends nothing to overlays; the full look is validated before saving (400, nothing written); targeted writes create no backups so restore points survive an authoring session. Without `tema` every tool behaves exactly as before. Live counters stay on the current session. - MCP prompt «disenar_tema» guides the agent through what to ask, one topic at a time, shows the preview URLs and activates only on explicit request. - The full configuration backup now carries the media `.css` files that the active or saved looks reference; unreferenced CSS is still skipped and refused, and the historical error order of the import is kept. Refs #313
…s symlinks The two new referenced-CSS symlink tests skipped on every Windows run with a reason the CI baseline does not allow. They now try to create the symlink and skip with the allowed reason only on EPERM/ENOTSUP, like the other symlink tests. Refs #313
feat(themes): create and edit saved themes from an agent over MCP
This was referenced Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #313. Integration branch with the five reviewed phases of saved themes (each merged into
feat/saved-themesafter its own CI and independent verification).What streamers get
/sd/tema/<id>.data-temaon overlay, widgets and custom overlays; custom overlay SDK gets the theme{ id, name }and its theme CSS live..cssmedia themes reference.temaon theme-owned tools edits a saved theme without activating it; promptdisenar_temaguides an agent through designing one.Phases: #314 data + switch · #315 UI, preview, fence, avatar · #316 marker, per-overlay CSS, SDK · #317 export/import · #318 MCP authoring + CSS in full backup.
Compatibility: migration v3 creates «Normal» freezing the effective look (byte-identical rendering verified on v0/v1/v2 configs); live stream events and initial frames unchanged (new events opt-in); MCP tools and panel routes without the new parameters unchanged (differentials per phase).
Local on the integrated branch: unit, browser, platform groups and typecheck green.