Browse Source

Focus textbox and add newlines after adding to context (#8877)

Matt Rubens 4 months ago
parent
commit
0d3817505e
1 changed files with 12 additions and 2 deletions
  1. 12 2
      src/core/webview/ClineProvider.ts

+ 12 - 2
src/core/webview/ClineProvider.ts

@@ -677,7 +677,12 @@ export class ClineProvider
 		const prompt = supportPrompt.create(promptType, params, customSupportPrompts)
 		const prompt = supportPrompt.create(promptType, params, customSupportPrompts)
 
 
 		if (command === "addToContext") {
 		if (command === "addToContext") {
-			await visibleProvider.postMessageToWebview({ type: "invoke", invoke: "setChatBoxMessage", text: prompt })
+			await visibleProvider.postMessageToWebview({
+				type: "invoke",
+				invoke: "setChatBoxMessage",
+				text: `${prompt}\n\n`,
+			})
+			await visibleProvider.postMessageToWebview({ type: "action", action: "focusInput" })
 			return
 			return
 		}
 		}
 
 
@@ -701,7 +706,12 @@ export class ClineProvider
 		const prompt = supportPrompt.create(promptType, params, customSupportPrompts)
 		const prompt = supportPrompt.create(promptType, params, customSupportPrompts)
 
 
 		if (command === "terminalAddToContext") {
 		if (command === "terminalAddToContext") {
-			await visibleProvider.postMessageToWebview({ type: "invoke", invoke: "setChatBoxMessage", text: prompt })
+			await visibleProvider.postMessageToWebview({
+				type: "invoke",
+				invoke: "setChatBoxMessage",
+				text: `${prompt}\n\n`,
+			})
+			await visibleProvider.postMessageToWebview({ type: "action", action: "focusInput" })
 			return
 			return
 		}
 		}