diff --git a/src/extension.ts b/src/extension.ts index 12f0326..e26c198 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -128,7 +128,7 @@ class ClaudeChatProvider { }> = []; private _treeProvider: ClaudeChatViewProvider | undefined; private _currentClaudeProcess: cp.ChildProcess | undefined; - private _selectedModel: string = 'opus'; // Default model + private _selectedModel: string = 'default'; // Default model constructor( private readonly _extensionUri: vscode.Uri, @@ -143,7 +143,7 @@ class ClaudeChatProvider { this._conversationIndex = this._context.workspaceState.get('claude.conversationIndex', []); // Load saved model preference - this._selectedModel = this._context.workspaceState.get('claude.selectedModel', 'opus'); + this._selectedModel = this._context.workspaceState.get('claude.selectedModel', 'default'); // Resume session from latest conversation const latestConversation = this._getLatestConversation(); @@ -216,6 +216,9 @@ class ClaudeChatProvider { case 'selectModel': this._setSelectedModel(message.model); return; + case 'openModelTerminal': + this._openModelTerminal(); + return; } }, null, @@ -1198,6 +1201,34 @@ class ClaudeChatProvider { } } + private _openModelTerminal(): void { + const config = vscode.workspace.getConfiguration('claude'); + const wslEnabled = config.get('wsl.enabled', false); + const wslDistro = config.get('wsl.distro', 'Ubuntu'); + const claudePath = config.get('wsl.claudePath', '/usr/local/bin/claude'); + + // Create terminal with the claude /model command + const terminal = vscode.window.createTerminal('Claude Model Selection'); + if (wslEnabled) { + terminal.sendText(`wsl -d ${wslDistro} ${claudePath} /model`); + } else { + terminal.sendText('claude /model'); + } + terminal.show(); + + // Show info message + vscode.window.showInformationMessage( + 'Check the terminal to update your default model configuration. Come back to this chat here after making changes.', + 'OK' + ); + + // Send message to UI about terminal + this._panel?.webview.postMessage({ + type: 'terminalOpened', + data: 'Check the terminal to update your default model configuration. Come back to this chat here after making changes.' + }); + } + public dispose() { if (this._panel) { this._panel.dispose(); diff --git a/src/ui-styles.ts b/src/ui-styles.ts new file mode 100644 index 0000000..821fa32 --- /dev/null +++ b/src/ui-styles.ts @@ -0,0 +1,1165 @@ +const styles = ` +` + +export default styles \ No newline at end of file diff --git a/src/ui.ts b/src/ui.ts index 05153b5..e49a0ae 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -1,1101 +1,11 @@ +import styles from './ui-styles' const html = ` Claude Code Chat - + ${styles}
@@ -1320,35 +230,43 @@ const html = `