diff --git a/package.json b/package.json index d245cca60c7c..d79391eea670 100644 --- a/package.json +++ b/package.json @@ -174,6 +174,11 @@ "command": "roo-cline.setCustomStoragePath", "title": "Set Custom Storage Path", "category": "Roo Code" + }, + { + "command": "roo-cline.focusInput", + "title": "Focus Input Field", + "category": "Roo Code" } ], "menus": { diff --git a/src/activate/registerCommands.ts b/src/activate/registerCommands.ts index 827c3cd45576..6f00cde46b19 100644 --- a/src/activate/registerCommands.ts +++ b/src/activate/registerCommands.ts @@ -92,6 +92,9 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt const { promptForCustomStoragePath } = await import("../shared/storagePathManager") await promptForCustomStoragePath() }, + "roo-cline.focusInput": () => { + provider.postMessageToWebview({ type: "action", action: "focusInput" }) + }, } } diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index 60c20b6503fb..3aac25ce563e 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -77,6 +77,7 @@ export interface ExtensionMessage { | "historyButtonClicked" | "promptsButtonClicked" | "didBecomeVisible" + | "focusInput" invoke?: "newChat" | "sendMessage" | "primaryButtonClick" | "secondaryButtonClick" | "setChatBoxMessage" state?: ExtensionState images?: string[] diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index 407548573218..9877f12753df 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -495,6 +495,9 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie textAreaRef.current?.focus() } break + case "focusInput": + textAreaRef.current?.focus() + break } break case "selectedImages":