Implement OS color scheme auto-detection for new users#302761
Merged
mrleemurray merged 5 commits intomainfrom Mar 18, 2026
Merged
Implement OS color scheme auto-detection for new users#302761mrleemurray merged 5 commits intomainfrom
mrleemurray merged 5 commits intomainfrom
Conversation
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-run OS color scheme auto-detection so fresh installs pick light/dark (and high-contrast) automatically, and wires this through both renderer theme selection and the Electron main-process nativeTheme configuration.
Changes:
- Extend
ThemeConfigurationwith “new user” logic to treatwindow.autoDetectColorSchemeas enabled when unset on first run. - Persist
window.autoDetectColorScheme=truefor new installs (migration) so the behavior becomes stable across restarts. - Update Electron main-process theme plumbing to default
autoDetectColorSchemefrom a newIThemeMainService.isAutoDetectColorScheme()helper. - Add unit tests covering new-user auto-detect behavior, including high-contrast priority cases.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/services/themes/test/common/workbenchThemeService.test.ts | Adds unit tests for new-user scheme detection and HC priority behavior. |
| src/vs/workbench/services/themes/common/themeConfiguration.ts | Introduces isNewUser and new auto-detect decision logic. |
| src/vs/workbench/services/themes/browser/workbenchThemeService.ts | Passes “new user” signal and migrates/persists auto-detect setting for new installs. |
| src/vs/platform/windows/electron-main/windowsMainService.ts | Defaults window config’s autoDetectColorScheme using main theme service helper. |
| src/vs/platform/theme/electron-main/themeMainServiceImpl.ts | Implements isAutoDetectColorScheme() and uses it to drive nativeTheme decisions. |
| src/vs/platform/theme/electron-main/themeMainService.ts | Extends main theme service interface with isAutoDetectColorScheme(). |
src/vs/workbench/services/themes/browser/workbenchThemeService.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
ulugbekna
approved these changes
Mar 18, 2026
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.
Introduce a feature that automatically detects the OS color scheme for new users, ensuring a seamless experience without requiring explicit configuration. Add tests to verify the detection logic for high contrast themes.