What version of Kimi Code is running?
moonshot-ai.kimi-code 0.6.4
Which open platform/subscription were you using?
Allegretto
Which model were you using?
No response
What platform is your computer?
No response
What issue are you seeing?
Summary
When VS Code is set to a dark high-contrast color theme (e.g. the built-in "Dark High Contrast"), the Kimi Code panel renders with a light (white) UI instead of a dark one.
Environment
- Extension:
moonshot-ai.kimi-code v0.6.3 / v0.6.4 (win32-x64, but platform-independent)
- VS Code: 1.100+
- OS: Windows (likely affects all platforms)
Root cause
The theme-detection code in the webview bundle only recognizes the vscode-dark body class:
function mU() {
const e = document.body.classList.contains("vscode-dark");
document.documentElement.classList.toggle("dark", e);
}
mU(),
new MutationObserver(mU).observe(document.body, { attributes: !0, attributeFilter: ["class"] });
VS Code sets one of these classes on the webview <body>:
| VS Code theme kind |
Body class |
| Light |
vscode-light |
| Dark |
vscode-dark |
| Dark High Contrast |
vscode-high-contrast |
| Light High Contrast |
vscode-high-contrast-light |
Under a dark high-contrast theme the body gets vscode-high-contrast, which contains("vscode-dark") does not match, so the dark class is removed from <html> and the app falls back to its light palette.
Proposed fix
Treat vscode-high-contrast as a dark theme (light high-contrast already falls through correctly):
const isDark =
document.body.classList.contains("vscode-dark") ||
document.body.classList.contains("vscode-high-contrast");
document.documentElement.classList.toggle("dark", isDark);
I verified this locally by patching the bundled dist/webview.js — the panel then renders dark under Dark High Contrast, and light/high-contrast-light themes still render light. The existing MutationObserver keeps live theme switching working.
A possible follow-up (out of scope for this fix): a dedicated high-contrast palette for the webview instead of reusing the regular dark palette, e.g. by honoring vscode-high-contrast / vscode-high-contrast-light classes with higher-contrast tokens.
What steps can reproduce the bug?
Steps to reproduce
- In VS Code:
Ctrl+K Ctrl+T → select Dark High Contrast (or any dark high-contrast theme).
- Open the Kimi Code panel.
Expected: the webview renders its dark theme.
Actual: the webview renders its light theme (all white).
What is the expected behavior?
No response
Additional information
No response
What version of Kimi Code is running?
moonshot-ai.kimi-code 0.6.4
Which open platform/subscription were you using?
Allegretto
Which model were you using?
No response
What platform is your computer?
No response
What issue are you seeing?
Summary
When VS Code is set to a dark high-contrast color theme (e.g. the built-in "Dark High Contrast"), the Kimi Code panel renders with a light (white) UI instead of a dark one.
Environment
moonshot-ai.kimi-codev0.6.3 / v0.6.4 (win32-x64, but platform-independent)Root cause
The theme-detection code in the webview bundle only recognizes the
vscode-darkbody class:VS Code sets one of these classes on the webview
<body>:vscode-lightvscode-darkvscode-high-contrastvscode-high-contrast-lightUnder a dark high-contrast theme the body gets
vscode-high-contrast, whichcontains("vscode-dark")does not match, so thedarkclass is removed from<html>and the app falls back to its light palette.Proposed fix
Treat
vscode-high-contrastas a dark theme (light high-contrast already falls through correctly):I verified this locally by patching the bundled
dist/webview.js— the panel then renders dark under Dark High Contrast, and light/high-contrast-light themes still render light. The existingMutationObserverkeeps live theme switching working.A possible follow-up (out of scope for this fix): a dedicated high-contrast palette for the webview instead of reusing the regular dark palette, e.g. by honoring
vscode-high-contrast/vscode-high-contrast-lightclasses with higher-contrast tokens.What steps can reproduce the bug?
Steps to reproduce
Ctrl+K Ctrl+T→ select Dark High Contrast (or any dark high-contrast theme).Expected: the webview renders its dark theme.
Actual: the webview renders its light theme (all white).
What is the expected behavior?
No response
Additional information
No response