Skip to content

Agents web: auto-detect OS color scheme by default#314878

Merged
osortega merged 1 commit into
mainfrom
osortega/agents-web-auto-detect-color-scheme
May 7, 2026
Merged

Agents web: auto-detect OS color scheme by default#314878
osortega merged 1 commit into
mainfrom
osortega/agents-web-auto-detect-color-scheme

Conversation

@osortega
Copy link
Copy Markdown
Contributor

@osortega osortega commented May 6, 2026

What

For the agents window on web (vscode.dev/agents) only, default window.autoDetectColorScheme to true so the workbench picks Dark 2026 / Light 2026 based on the user's prefers-color-scheme media query instead of always loading Light 2026.

Why

After #314551 removed the welcome theme picker, vscode.dev/agents had no path to set a theme during onboarding, so users always landed on the web default theme (Light 2026 — see themeConfiguration.ts line 37).

BrowserHostColorSchemeService is already registered in sessions.web.main.ts and the auto-detect machinery already exists, so flipping the default for the agents web target is the minimal change to get OS-aware theming back.

How

agentsWindow.default overrides are only consumed by the sessions ConfigurationService (SessionsDefaultConfiguration.getDefaultValue in src/vs/sessions/services/configuration/browser/configurationService.ts), so this affects only the agents window. The override is gated on isWeb so the desktop agents window and regular VS Code keep their existing defaults.

Surface window.autoDetectColorScheme default
Regular VS Code (desktop & web) false (unchanged)
Agents window — desktop false (unchanged)
Agents window — web true (auto-detects)

Users can still override via settings; this only changes the default, not readOnly.

Test plan

  • vscode.dev/agents with OS in dark mode → loads Dark 2026
  • vscode.dev/agents with OS in light mode → loads Light 2026
  • OS color-scheme toggle live-switches the theme
  • Regular VS Code (web and desktop) still defaults to false (no auto-switching unless user opts in)
  • Desktop agents window still defaults to false

Default `window.autoDetectColorScheme` to `true` for the agents window
on web only, so vscode.dev/agents picks the user's preferred dark/light
theme via `prefers-color-scheme` instead of always loading Light 2026.

Scoped via `isWeb` so the desktop agents window and regular VS Code
remain unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 23:39
Copy link
Copy Markdown
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@osortega osortega marked this pull request as ready for review May 7, 2026 02:25
@osortega osortega enabled auto-merge (squash) May 7, 2026 02:25
@osortega osortega merged commit d51ed87 into main May 7, 2026
26 checks passed
@osortega osortega deleted the osortega/agents-web-auto-detect-color-scheme branch May 7, 2026 02:29
@vs-code-engineering vs-code-engineering Bot added this to the 1.120.0 milestone May 7, 2026
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.

4 participants