Fix: normalize Windows drive letter in VS Code extension webview paths (#1052)
Extract normalizeWindowsDriveLetter to shared pathUtils module Normalize workspaceFolder to uppercase drive letter to match OpenCode server's path normalization. This fixes session visibility issues where VS Code extension sessions don't appear in CLI/desktop and vice versa due to case-sensitive directory comparison on Windows. Changes: - Create pathUtils.ts with shared normalizeWindowsDriveLetter function - Update opencode.ts to import from pathUtils instead of inline definition - Update ChatViewProvider.ts, AgentManagerPanelProvider.ts, SessionEditorPanelProvider.ts to import from pathUtils
This commit is contained in:
@@ -6,6 +6,7 @@ import { getWebviewShikiThemes } from './shikiThemes';
|
||||
import { getWebviewHtml } from './webviewHtml';
|
||||
import { openSseProxy } from './sseProxy';
|
||||
import { resolveWebviewDevServerUrl } from './webviewDevServer';
|
||||
import { normalizeWindowsDriveLetter } from './pathUtils';
|
||||
|
||||
export class ChatViewProvider implements vscode.WebviewViewProvider {
|
||||
public static readonly viewType = 'openchamber.chatView';
|
||||
@@ -392,7 +393,9 @@ export class ChatViewProvider implements vscode.WebviewViewProvider {
|
||||
}
|
||||
|
||||
private _getHtmlForWebview(webview: vscode.Webview) {
|
||||
const workspaceFolder = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath || '';
|
||||
const workspaceFolder = normalizeWindowsDriveLetter(
|
||||
vscode.workspace.workspaceFolders?.[0]?.uri.fsPath || ''
|
||||
);
|
||||
// Use cached values which are updated by onStatusChange callback
|
||||
const initialStatus = this._cachedStatus;
|
||||
const cliAvailable = this._openCodeManager?.isCliAvailable() ?? false;
|
||||
|
||||
Reference in New Issue
Block a user