Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tasty-insects-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Fix VSCode webview assets
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,6 @@ class WebViewManager(var project: Project) : Disposable, ThemeChangeListener {
fun updateWebViewHtml(data: WebviewHtmlUpdateData) {
data.htmlContent = data.htmlContent.replace("/jetbrains/resources/kilocode/", "./")
data.htmlContent = data.htmlContent.replace("<html lang=\"en\">", "<html lang=\"en\" style=\"background: var(--vscode-sideBar-background);\">")
// Replace index.css/index.js with main.css/main.js to match actual build output
data.htmlContent = data.htmlContent.replace("assets/index.css", "assets/main.css")
data.htmlContent = data.htmlContent.replace("assets/index.js", "assets/main.js")
val encodedState = getLatestWebView()?.state.toString().replace("\"", "\\\"")
val mRst = """<script\s+nonce="([A-Za-z0-9]{32})">""".toRegex().find(data.htmlContent)
val str = mRst?.value ?: ""
Expand Down
2 changes: 1 addition & 1 deletion webview-ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default defineConfig(({ mode }) => {
cssCodeSplit: true, // kilocode_change: enable CSS code splitting so CSS files are generated
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
index: resolve(__dirname, "index.html"),
"agent-manager": resolve(__dirname, "agent-manager.html"), // kilocode_change
},
external: ["vscode"], // kilocode_change: we inadvertently import vscode into the webview: @roo/modes => src/shared/modes => ../core/prompts/sections/custom-instructions
Expand Down