mirror of
https://github.com/andrepimenta/claude-code-chat.git
synced 2025-12-15 05:29:41 +00:00
fix: input overflow and flexible panel positioning
This commit is contained in:
@@ -10,9 +10,9 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
console.log('Claude Code Chat extension is being activated!');
|
||||
const provider = new ClaudeChatProvider(context.extensionUri, context);
|
||||
|
||||
const disposable = vscode.commands.registerCommand('claude-code-chat.openChat', () => {
|
||||
const disposable = vscode.commands.registerCommand('claude-code-chat.openChat', (column?: vscode.ViewColumn) => {
|
||||
console.log('Claude Code Chat command executed!');
|
||||
provider.show();
|
||||
provider.show(column);
|
||||
});
|
||||
|
||||
const loadConversationDisposable = vscode.commands.registerCommand('claude-code-chat.loadConversation', (filename: string) => {
|
||||
@@ -134,21 +134,22 @@ class ClaudeChatProvider {
|
||||
this._currentSessionId = latestConversation?.sessionId;
|
||||
}
|
||||
|
||||
public show() {
|
||||
const column = vscode.ViewColumn.Two;
|
||||
public show(column: vscode.ViewColumn | vscode.Uri = vscode.ViewColumn.Two) {
|
||||
// Handle case where a URI is passed instead of ViewColumn
|
||||
const actualColumn = column instanceof vscode.Uri ? vscode.ViewColumn.Two : column;
|
||||
|
||||
// Close sidebar if it's open
|
||||
this._closeSidebar();
|
||||
|
||||
if (this._panel) {
|
||||
this._panel.reveal(column);
|
||||
this._panel.reveal(actualColumn);
|
||||
return;
|
||||
}
|
||||
|
||||
this._panel = vscode.window.createWebviewPanel(
|
||||
'claudeChat',
|
||||
'Claude Code Chat',
|
||||
column,
|
||||
actualColumn,
|
||||
{
|
||||
enableScripts: true,
|
||||
retainContextWhenHidden: true,
|
||||
|
||||
@@ -1350,13 +1350,14 @@ const styles = `
|
||||
|
||||
.input-field {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: transparent;
|
||||
color: var(--vscode-input-foreground);
|
||||
border: none;
|
||||
padding: 12px;
|
||||
outline: none;
|
||||
font-family: var(--vscode-editor-font-family);
|
||||
min-height: 20px;
|
||||
min-height: 68px;
|
||||
line-height: 1.4;
|
||||
overflow-y: hidden;
|
||||
resize: none;
|
||||
|
||||
@@ -943,6 +943,10 @@ const html = `<!DOCTYPE html>
|
||||
addMessage(completionText, 'system');
|
||||
return; // Don't show the result message
|
||||
}
|
||||
|
||||
if(data.isError && data.content === "File has not been read yet. Read it first before writing to it."){
|
||||
return addMessage("File has not been read yet. Let me read it first before writing to it.", 'system');
|
||||
}
|
||||
|
||||
const messageDiv = document.createElement('div');
|
||||
messageDiv.className = data.isError ? 'message error' : 'message tool-result';
|
||||
|
||||
Reference in New Issue
Block a user