Skip to content

feat(themes): export and import a single theme with its media - #317

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

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

Conversation

@egdev6

@egdev6 egdev6 commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

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

  • Export GET /api/themes/:id/export: ZIP (config.json manifest, kind theme + media/) with name, avatar, full look (live sections for the active theme) and every referenced media file — alert/variation/command/timer media and sounds, fonts, icons, avatar, and CSS url()/@import/@font-face references resolved per surface (overlay, widgets, custom frames; documented in docs/themes.md). No secrets/connections/sessions/system sections, no custom overlay code (only its theme CSS).
  • Import preview (no side effects) → creates a new inactive theme: unique name on clash, 10-theme limit, colliding media renamed with references rewritten (quoting preserved), identical files reused, theme CSS for missing overlays dropped with a warning. All-or-nothing.
  • Reuses the config-transfer ZIP reader, streamed upload, limits, fingerprint and scratch; full config export/import unchanged.
  • Panel: «Exportar» and «Importar tema» (preview dialog). MCP: exportar_tema, importar_tema_guardado (importar_tema preset tool untouched).

Verification (independent, Risk 1+2+3): export contents exact, no secrets; import side-effect-free preview, inactive creation, injected commit failure leaves nothing; 42 hostile ZIP cases refused with nothing written (zip-slip variants, symlinks, duplicates, bombs/oversize, bad CRC, bad manifests, wrong kind both ways, SVG/APNG avatar, non-media files); full config export/import differential identical. Local: unit, browser, platform, typecheck green.

Known limits / follow-up: absolute media URLs are left untouched with a warning; dependencies of an imported .css file are not scanned; a .css installed by a theme import is skipped by the full config backup (reported in its skipped list) — decided: phase 5 makes the full config backup carry these .css files.

- 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
@egdev6
egdev6 merged commit ab9f7c4 into feat/saved-themes Nov 23, 2026
5 checks passed
@egdev6
egdev6 deleted the feat/saved-themes-transfer branch November 23, 2026 02:17
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