Save message in text box

This commit is contained in:
andrepimenta
2025-07-28 23:45:42 +01:00
parent 3b534cfce2
commit 5abb1fedd9
2 changed files with 41 additions and 0 deletions

View File

@@ -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');