feat(themes): Themes settings tab with Light/Dark/System appearance mode#116
Merged
Conversation
- classic: #4c6fff → #4267ff (4.17→4.55:1 on #0d1117) - islands-dark: #548af7 → #286cf5 (3.30→4.61:1 on #0f1923) - islands-light: #3574f0 → #2c6def (4.27→4.60:1 on #f5f7fa)
- isLookPreset: valid presets, unknown string, non-string values - persistence: defaults, all three appearance modes, invalid mode fallback, valid/invalid dark/light preset restore, custom ID handling, and all three backward-compat paths for the old single themePreset field Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The ack was sent immediately on every close request, which canceled the backend's 5s force-destroy fallback before captureWindowState(), saveState(), and CountRunningAgents had completed. A hang in any of those left the window stuck open permanently — the fallback that would have recovered it was gone. Move the ack into the preventDefault() callback so the backend timer stays armed through the async pre-work and is only cleared once the renderer has decided to show the running-terminals dialog. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
Owner
|
Thank you very much for this! <3 |
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
This PR adds a Themes tab to the Settings dialog that lets users choose their appearance mode (Light / Dark / System) and pick independent theme presets for each mode. It also includes a contrast fix for three built-in themes and a reliability fix for the close-dialog fallback timer.
What's included
Themes settings tab (
SettingsDialog.tsx,look.ts,ui.ts,store/)window.matchMedia('prefers-color-scheme: dark')).appearanceMode,darkThemePreset,lightThemePreset,darkThemeCustomId,lightThemeCustomId).themePresetfield saved will have it migrated into the correct dark/light slot automatically on first load.WCAG AA contrast fix (
styles.css)Three built-in themes had accent colours that failed WCAG AA (4.5:1) against their panel backgrounds:
#4c6fff#4267ff#548af7#286cf5#3574f0#2c6defClose-dialog fallback timer fix (
window.ts)When the "Cancel option" close dialog feature was added,
WindowCloseHandling(which cancels the backend's 5 s force-destroy fallback) was being sent immediately on every close request — before the async pre-work (captureWindowState,saveState,CountRunningAgents) had completed. A hang in any of those left the window permanently stuck because the safety net was already gone.Fixed by moving the ack into the
preventDefault()callback so the timer stays armed through the pre-work and is only cleared once the renderer has decided to show the interactive dialog.Tests
isLookPresettype guard: valid preset IDs, unknown strings, non-string values.themePresetfield (13 new tests, 475 total passing).How to test
"themePreset": "classic"in the saved state file and relaunch withoutappearanceMode— should restore dark mode with Classic.🤖 Generated with Claude Code