mirror of
https://github.com/andrepimenta/claude-code-chat.git
synced 2025-12-13 13:49:47 +00:00
Save message in text box
This commit is contained in:
@@ -127,6 +127,7 @@ class ClaudeChatProvider {
|
||||
private _currentClaudeProcess: cp.ChildProcess | undefined;
|
||||
private _selectedModel: string = 'default'; // Default model
|
||||
private _isProcessing: boolean | undefined;
|
||||
private _draftMessage: string = '';
|
||||
|
||||
constructor(
|
||||
private readonly _extensionUri: vscode.Uri,
|
||||
@@ -236,6 +237,14 @@ class ClaudeChatProvider {
|
||||
|
||||
// Send current settings to webview
|
||||
this._sendCurrentSettings();
|
||||
|
||||
// Send saved draft message if any
|
||||
if (this._draftMessage) {
|
||||
this._postMessage({
|
||||
type: 'restoreInputText',
|
||||
data: this._draftMessage
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private _handleWebviewMessage(message: any) {
|
||||
@@ -324,6 +333,9 @@ class ClaudeChatProvider {
|
||||
case 'enableYoloMode':
|
||||
this._enableYoloMode();
|
||||
return;
|
||||
case 'saveInputText':
|
||||
this._saveInputText(message.text);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,6 +442,9 @@ class ClaudeChatProvider {
|
||||
|
||||
this._isProcessing = true;
|
||||
|
||||
// Clear draft message since we're sending it
|
||||
this._draftMessage = '';
|
||||
|
||||
// Show original user input in chat and save to conversation (without mode prefixes)
|
||||
this._sendAndSaveMessage({
|
||||
type: 'userInput',
|
||||
@@ -2149,6 +2164,10 @@ class ClaudeChatProvider {
|
||||
}
|
||||
}
|
||||
|
||||
private _saveInputText(text: string): void {
|
||||
this._draftMessage = text || '';
|
||||
}
|
||||
|
||||
private async _updateSettings(settings: { [key: string]: any }): Promise<void> {
|
||||
const config = vscode.workspace.getConfiguration('claudeCodeChat');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user