Skip to content

Implement OS color scheme auto-detection for new users#302761

Merged
mrleemurray merged 5 commits intomainfrom
mrleemurray/yucky-fuchsia-catshark
Mar 18, 2026
Merged

Implement OS color scheme auto-detection for new users#302761
mrleemurray merged 5 commits intomainfrom
mrleemurray/yucky-fuchsia-catshark

Conversation

@mrleemurray
Copy link
Contributor

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.

Copilot AI review requested due to automatic review settings March 18, 2026 11:00
@mrleemurray mrleemurray enabled auto-merge (squash) March 18, 2026 11:00
@mrleemurray mrleemurray self-assigned this Mar 18, 2026
@vs-code-engineering
Copy link
Contributor

vs-code-engineering bot commented Mar 18, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@bpasero

Matched files:

  • src/vs/platform/windows/electron-main/windowsMainService.ts

@vs-code-engineering vs-code-engineering bot added this to the 1.113.0 milestone Mar 18, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ThemeConfiguration with “new user” logic to treat window.autoDetectColorScheme as enabled when unset on first run.
  • Persist window.autoDetectColorScheme=true for new installs (migration) so the behavior becomes stable across restarts.
  • Update Electron main-process theme plumbing to default autoDetectColorScheme from a new IThemeMainService.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().

mrleemurray and others added 2 commits March 18, 2026 11:07
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>
@mrleemurray mrleemurray merged commit 331c3ba into main Mar 18, 2026
20 checks passed
@mrleemurray mrleemurray deleted the mrleemurray/yucky-fuchsia-catshark branch March 18, 2026 12:57
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.

3 participants