feat: add color scheme customization#2263
Conversation
There was a problem hiding this comment.
Pull request overview
Adds operator-configurable color scheme branding so the Electron main process can load a JSON theme, serialize allowed color tokens to CSS, and expose it to the renderer before React mounts.
Changes:
- Adds branding config schema, token sanitization/serialization utilities, loader, and tests.
- Passes generated branding CSS from main to preload via
additionalArguments, then injects it in the renderer. - Adds a sample test theme, documentation, and a dev launch script for custom-theme verification.
Reviewed changes
Copilot reviewed 49 out of 49 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
common/branding/color-tokens.ts |
Defines allowed color tokens and serializes safe overrides to CSS. |
common/branding/__tests__/color-tokens.test.ts |
Tests token filtering, sanitization, and CSS output. |
common/branding/schema.ts |
Defines the branding JSON schema. |
main/src/branding/load.ts |
Loads branding config and converts color tokens to CSS. |
main/src/branding/__tests__/load.test.ts |
Tests config loading, invalid inputs, and CSS generation. |
main/src/branding/paths.ts |
Resolves the branding config path. |
main/src/main-window.ts |
Loads branding CSS and passes it to the renderer process. |
preload/src/api/branding.ts |
Reads and decodes branding CSS from process arguments. |
preload/src/api/__tests__/branding.test.ts |
Tests preload branding argument handling. |
preload/src/preload.ts |
Exposes the branding API through electronAPI. |
renderer/src/renderer.tsx |
Injects branding CSS before mounting React. |
renderer/src/index.css |
Adds additional themeable color variables. |
renderer/src/common/mocks/electronAPI.ts |
Adds branding to the renderer test Electron API mock. |
vitest.setup.ts |
Adds branding to the global Electron API test stub. |
branding-examples/README.md |
Documents branding examples and usage. |
branding-examples/test-theme.json |
Adds a sample custom color theme. |
scripts/start-custom-theme.ts |
Adds a helper for launching with the sample theme. |
package.json |
Adds the start:customTheme script. |
|
@claude deep review please |
|
Claude finished @kantord's task in 5m 19s —— View job Deep review — color scheme customization (PR #2263)
Nice piece of work — clean main/preload/renderer separation, robust sanitization, decent tests, and the 🔴 Visual regressions to fix1. Textarea border disappears in light mode —
2.
This usage is the first time
The cloud-ui parity should mirror whatever choice you make there. Fix this → 🟡 Design / architecture3. Single-window branding propagation —
Not blocking — only a concern when more windows arrive. 4. Schema doesn't include chart colors —
5.
6. Schema strips unknown nested keys silently Top-level uses 🟢 Nits / polish7. Node's 8. Fits any reasonable color value; the limit is fine. 9. No coverage assertion that all A 10. 11. ✅ Things done well
Out of scope (acknowledged in the PR description)
| Branch: |
This PR allows for design tokens to be overridden on the user level.
What is included:
What is only partially included:
-things related to the marketing call to action feature: still considering the best approach for those, but in practice theme overriding won't be needed for those, they just need to look good with the default theme. Best course of action might be to ignore the issue.
What is not included:
"stacklok theme" (NOT made default yet)
after this pr is merged, we need to decide if we want to make this the default theme
recording-2026-05-19_12-26-44.mp4
"demo theme" for testing
Not meant to be particularly pretty, intentionally very different from the default theme to make it easier to spot problems/"stress" test override capability.
recording-2026-05-19_11-22-17.mp4