feat(desktop): allow custom theme mapping for System theme mode#2548
Closed
github-actions[bot] wants to merge 1 commit into
Closed
feat(desktop): allow custom theme mapping for System theme mode#2548github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Add systemLightThemeId and systemDarkThemeId fields to the theme store, letting users configure which theme to use for each OS mode when "System" is selected. The SystemThemeCard now shows dropdown selectors (filtered by theme type) when active. Defaults match current behavior (dark/light). Refs #2547
Contributor
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/desktop/src/renderer/stores/theme/store.ts">
<violation number="1" location="apps/desktop/src/renderer/stores/theme/store.ts:262">
P2: After removing a custom theme used by system mapping, the store resets mapping IDs but does not re-apply the active system theme. This can leave `activeTheme`/UI state on a deleted theme until a later theme change occurs.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Comment on lines
+262
to
+267
| if (state.systemDarkThemeId === themeId) { | ||
| set({ systemDarkThemeId: "dark" }); | ||
| } | ||
| if (state.systemLightThemeId === themeId) { | ||
| set({ systemLightThemeId: "light" }); | ||
| } |
Contributor
There was a problem hiding this comment.
P2: After removing a custom theme used by system mapping, the store resets mapping IDs but does not re-apply the active system theme. This can leave activeTheme/UI state on a deleted theme until a later theme change occurs.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/desktop/src/renderer/stores/theme/store.ts, line 262:
<comment>After removing a custom theme used by system mapping, the store resets mapping IDs but does not re-apply the active system theme. This can leave `activeTheme`/UI state on a deleted theme until a later theme change occurs.</comment>
<file context>
@@ -210,6 +258,14 @@ export const useThemeStore = create<ThemeState>()(
}
+ // If removing a theme used in system mapping, reset to built-in
+ if (state.systemDarkThemeId === themeId) {
+ set({ systemDarkThemeId: "dark" });
+ }
</file context>
Suggested change
| if (state.systemDarkThemeId === themeId) { | |
| set({ systemDarkThemeId: "dark" }); | |
| } | |
| if (state.systemLightThemeId === themeId) { | |
| set({ systemLightThemeId: "light" }); | |
| } | |
| const removedMappedSystemTheme = | |
| state.systemDarkThemeId === themeId || | |
| state.systemLightThemeId === themeId; | |
| if (state.systemDarkThemeId === themeId) { | |
| set({ systemDarkThemeId: "dark" }); | |
| } | |
| if (state.systemLightThemeId === themeId) { | |
| set({ systemLightThemeId: "light" }); | |
| } | |
| if (removedMappedSystemTheme && state.activeThemeId === SYSTEM_THEME_ID) { | |
| state.setTheme(SYSTEM_THEME_ID); | |
| } |
6 tasks
Collaborator
|
Closing as stale: bot PR created 6+ weeks ago with no iteration since. Re-attempt from a fresh branch if a fix is still wanted. Bulk audit 2026-05-06. |
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.
Summary
systemLightThemeIdandsystemDarkThemeIdfields to the theme store, allowing users to configure which installed theme to use for each OS mode when "System" is selectedresolveThemeIdto use these custom mappings instead of hardcoded"dark"/"light"built-in IDsSystemThemeCardto show two dropdown selectors (filtered by theme type) when System is the active theme, letting users pick any matching-type theme for dark and light OS modes"dark"for dark mode,"light"for light mode)Test plan
store.test.ts) — 7 tests covering default mappings, resolution for dark/light OS modes, custom mapping, re-apply on mapping change, no-op when system not active, and reset on custom theme removalCloses #2547
Summary by cubic
Adds custom mapping for System theme mode so users can choose which theme applies in dark and light OS modes. Implements #2547; defaults to built-in dark/light and resets mappings if a chosen theme is removed.
systemLightThemeIdandsystemDarkThemeIdto the theme store and updated resolution logic to honor them.Written for commit a0725cc. Summary will update on new commits.