Skip to content

feat(ui): load user theme files and resolve custom themes by name#476

Open
indaco wants to merge 1 commit into
mainfrom
feat/custom-theme-registry-loader
Open

feat(ui): load user theme files and resolve custom themes by name#476
indaco wants to merge 1 commit into
mainfrom
feat/custom-theme-registry-loader

Conversation

@indaco

@indaco indaco commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Description

Users can now define their own semantic colour themes in a JSON file and have both the CLI and the mt tui dashboard honour them - with no call-site change.
The file lives at MALT_THEMES_FILE (else {prefix}/etc/malt/themes.json), carries multiple named palettes and a default marker, and is read once at boot

Validation is strict and all-or-nothing: a version gate, theme-count and name caps, all six roles present, in-range colours, and a resolvable default. Any single failure rejects the whole file and malt keeps the built-in themes - one
notice, never a crash, never a partial apply. A custom name can never shadow a built-in (an explicit MALT_THEME=dracula always selects the built-in), and a theme whose polarity contradicts the detected background degrades to the default exactly like a built-in. Degradation is wholesale on the truecolor gate, with one refinement: a theme written entirely from 256-colour indexes also paints on a 256-colour terminal, so that colour form is not dead weight.

Related Issue

  • None

Notes for Reviewers

  • None

This is part 2 of 2 in a stack made with GitButler:

@indaco indaco changed the title ## Description feat(ui): load user theme files and resolve custom themes by name Jun 10, 2026
Base automatically changed from feat/custom-theme-value-parser to main June 11, 2026 06:15
Users can define their own semantic colour palettes in a JSON file and
have both the CLI and the dashboard honour them, selected by name or a
file default. The file is read once at boot through a hardened path and
validated all-or-nothing, falling back to the built-in themes on any
problem so a bad file is never a crash or a partial apply. A custom name
can never shadow a built-in.
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