Skip to content

fix(vscode): match Integrated Browser theme to IDE theme - #14898

Merged
marius-kilocode merged 1 commit into
mainfrom
sync-browser-theme-with-ide
Oct 7, 2026
Merged

marius-kilocode merged 1 commit into
mainfrom
sync-browser-theme-with-ide

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The Integrated Browser rendered every page with prefers-color-scheme: light, even in a dark IDE. Sites that honor the color scheme, for example GitHub, stayed bright against the editor theme.

Why This Change Was Made

The Playwright context was created without a colorScheme, so it used Playwright's light default. The broker now takes a theme callback from the extension, sets colorScheme on new contexts from vscode.window.activeColorTheme, and exposes retheme() to re-apply the scheme to live pages when the IDE theme changes. High-contrast-light maps to light.

User Impact

Pages in the Integrated Browser follow the IDE theme, so prefers-color-scheme matches dark or light. Switching the IDE theme while the browser is open updates the page without reopening.

Evidence

  • bun run typecheck, bun run lint, and bun test tests/unit/browser-broker.test.ts (56 pass).
  • Real Chromium probe through the broker: a probe page reported DARK with a dark theme and switched to LIGHT after retheme().
  • Manual check in an isolated VS Code instance: the Integrated Browser loaded a probe page in dark and followed the IDE theme when it changed.

Set the Playwright color scheme from the active VS Code theme so pages that honor prefers-color-scheme render dark or light to match the editor, and re-apply it when the IDE theme changes.
@kilo-code-bot

kilo-code-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • .changeset/browser-ide-theme.md
  • packages/kilo-vscode/src/extension.ts
  • packages/kilo-vscode/src/services/browser-automation/browser-broker.ts
  • packages/kilo-vscode/tests/unit/browser-broker.test.ts

Reviewed by deepseek-v4.1-flash · Input: 59K · Output: 6K · Cached: 327.3K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 8d23322 into main Oct 7, 2026
26 checks passed
@marius-kilocode
marius-kilocode deleted the sync-browser-theme-with-ide branch October 7, 2026 14:08
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.

2 participants