Skip to content

Commit 88cac3c

Browse files
authored
feat: add command to focus Roo Code input field (#2369)
* feat: add command to focus Roo Code input field * fixup! feat: add command to focus Roo Code input field * fixup! feat: add command to focus Roo Code input field
1 parent 84c703e commit 88cac3c

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@
174174
"command": "roo-cline.setCustomStoragePath",
175175
"title": "Set Custom Storage Path",
176176
"category": "Roo Code"
177+
},
178+
{
179+
"command": "roo-cline.focusInput",
180+
"title": "Focus Input Field",
181+
"category": "Roo Code"
177182
}
178183
],
179184
"menus": {

src/activate/registerCommands.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
114114
const { promptForCustomStoragePath } = await import("../shared/storagePathManager")
115115
await promptForCustomStoragePath()
116116
},
117+
"roo-cline.focusInput": () => {
118+
provider.postMessageToWebview({ type: "action", action: "focusInput" })
119+
},
117120
}
118121
}
119122

src/shared/ExtensionMessage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export interface ExtensionMessage {
7777
| "historyButtonClicked"
7878
| "promptsButtonClicked"
7979
| "didBecomeVisible"
80+
| "focusInput"
8081
invoke?: "newChat" | "sendMessage" | "primaryButtonClick" | "secondaryButtonClick" | "setChatBoxMessage"
8182
state?: ExtensionState
8283
images?: string[]

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,9 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
497497
textAreaRef.current?.focus()
498498
}
499499
break
500+
case "focusInput":
501+
textAreaRef.current?.focus()
502+
break
500503
}
501504
break
502505
case "selectedImages":

0 commit comments

Comments
 (0)