Repository navigation
feat: pick a theme from installed theme packages - #26
Merged
Merged
Conversation
This was referenced Oct 16, 2026
9 tasks
|
🎉 This PR is included in version 0.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Problem
A theme today is an ordinary include or package. Several can be enabled at once and layer over each other, setup and Customize have no theme picker, widget packages have no shared token names to rely on, and the Packages tab reviews a theme for commands it never needs. Fixes #19.
Changes
"kind": "theme"inpackage.json. A theme may contain onlytokens,defaults,bar,groupsandprofiles, and its profiles are checked too. Widgets, templates, overrides, providers, environment and popups are rejected with aWidgetPackageErrorat install, review and load."theme": { "id": "…", "version": "…" }selects one installed theme. A theme can't be listed inpackages, and a widget package can't be used astheme.tokensact as fallbacks that any theme replaces, so a package can write@token.textMuted, pass review on its own and still follow the active theme. Your includes and main file still win over the theme.surface,surfaceRaised,text,textMuted,accent,track,hairline,warningandcritical.themeand themes have no Commands section. All of them write a newthemeedit inConfigurationEdits.swift, which--batchcan also use. Built-in removes the key.--inspect-packageand--install-packageskip the commands heading for themes.defaults, which would otherwise beat the theme.examples/themes/slate, defining all nine tokens with a dark variant as a profile.Testing
swift test: 104 passed.ThemePackageTests: forbidden content is rejected, including inside profiles; themes and widget packages can't take each other's place; precedence: the theme beats a package's token, a package-only token keeps its value, includes and the main file beat the theme, and the theme's dark profile applies.WidgetTestssetup case: choosing a theme removes setup's colour keys and keeps the rest ofdefaults.--validate.examples/modular,examples/interactiveand the starter configuration still validate.Known limitations:
profilesreplace the theme's profiles, so anyone with a profile of their own loses the theme's dark variant. Tracked in Merge profiles by name across includes, packages and the main file #24.Merging
One commit, so any merge method keeps it in the changelog.
Claude Opus 5.5 via Claude Code