kimi-code icon indicating copy to clipboard operation
kimi-code copied to clipboard

fix(vscode): recognize dark high-contrast themes

Open saime428 opened this issue 4 months ago • 1 comments

Related Issue

Resolve #2158

Problem

The VS Code webview only treated vscode-dark as a dark theme, so dark high-contrast themes rendered using the light UI theme.

What changed

Treat vscode-high-contrast as dark while explicitly keeping vscode-high-contrast-light light. VS Code adds the generic high-contrast class to light high-contrast themes for backward compatibility.

Validation

  • [x] pnpm -C apps/vscode run typecheck
  • [x] pnpm -C apps/vscode run build:webview
  • [x] Verified dark, dark high contrast, light, and light high contrast class combinations
  • [ ] pnpm -C apps/vscode run test — 293 passed; 3 unrelated Windows path tests failed

Checklist

  • [x] I have read the CONTRIBUTING document.
  • [x] I have linked a related issue.
  • [ ] I have added tests that prove my feature works.
  • [x] Ran gen-changesets; this private VS Code package change needs no changeset.
  • [x] No documentation update is required.

saime428 avatar Jul 25 '26 07:07 saime428

⚠️ No Changeset found

Latest commit: 43cb8a3bb3260f5b7c7c8cf6ead1a10625fb526c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Jul 25 '26 07:07 changeset-bot[bot]

Checking in on this fix for #2158. It only changes the VS Code webview theme detection. Typecheck and the webview build pass, and gen-changesets confirmed that this private package does not need a changeset. Is there anything else you would want before reviewing it?

saime428 avatar Aug 07 '26 04:08 saime428

@wbxl2000 could you take a look at this one? You are the last person to touch apps/vscode/webview-ui/src/main.tsx, so you are probably the right reviewer.

It has been open since 2026-07-25 with no maintainer response, and #2158 is still open and unassigned. The change is 4 lines in that one file: the webview only recognized vscode-dark, so the two high-contrast dark themes fell through to the light palette.

Still MERGEABLE. Typecheck and the webview build pass, and gen-changesets confirms this private package needs no changeset. Glad to change the approach if you would rather detect the theme some other way.

saime428 avatar Aug 18 '26 01:08 saime428

Closing this to keep the review queue clear rather than leave it sitting open. Nothing is blocked on anyone here.

The branch stays up, so this can be reopened if it turns out to be useful. I have not kept it rebased, so it would need a refresh first.

saime428 avatar Sep 08 '26 15:09 saime428