Skip to content

Themes: a theme can be one zip file with its shaders, fonts and licence (#499) - #500

Merged
MopigamesYT merged 1 commit into
feat/488-agent-themesfrom
feat/499-theme-zip
Nov 17, 2026
Merged

MopigamesYT merged 1 commit into
feat/488-agent-themesfrom
feat/499-theme-zip

Conversation

@MopigamesYT

Copy link
Copy Markdown
Member

Closes #499

Stacked on #495: this PR targets feat/488-agent-themes; retarget it to dev once #495 merges.

Summary

  • A theme can be one .zip in the themes folder (theme.toml, shaders, fonts, licence, optional preview, relative paths inside). One entry per zip in Settings; adding, replacing or removing a zip is picked up by the existing watcher.
  • A theme folder with the same layout is read like a zip; loose .toml themes still work.
  • Settings: Pack into zip (loose theme), Unpack to edit (zip), Duplicate works for zips and folders.
  • The agent's theme_write now writes <name>.zip (or replaces a theme where it already is, folder or loose); the format reference and docs/THEMES.md describe the layout.
  • Safety: absolute paths and .. refused (zip slip), links refused, at most 200 entries and 64 MB unpacked (also enforced on bytes actually read), only TOML, shaders, fonts, images and text/licence files; broken zips give plain-word errors.

Screenshots

None: I did not run the app on VM 111 for this change; the Settings change is two extra buttons, covered by the loader tests.

Technical details

  • New internal/palette/themepack.go: zip/folder loading, ReadThemeFile (zip entries read in memory via archive/zip, never extracted), PackTheme, UnpackTheme, WriteThemeZip (temp file + rename).
  • Shader, font and picture reads in internal/ui go through palette.ReadThemeFile. The folder watcher stamp now also covers files inside theme folders.
  • Tests: zip load in memory, zip slip/absolute/disallowed type/missing file, size and entry caps, broken zip, loose + folder loading, pack/unpack, duplicate names. gofmt, vet, build, tests for palette, agent, ui pass.

Assisted-by: claude-sonnet-5-5 low

🤖 Generated with Claude Code

@MopigamesYT MopigamesYT added enhancement New feature or request desktop Desktop app (Linux, Windows) agent Agent harness, tools, memory labels Nov 17, 2026
@MopigamesYT
MopigamesYT merged commit ce79d75 into feat/488-agent-themes Nov 17, 2026
3 checks passed
@MopigamesYT
MopigamesYT deleted the feat/499-theme-zip branch November 17, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Agent harness, tools, memory desktop Desktop app (Linux, Windows) enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant