Skip to content

Commit 4563b53

Browse files
hongziocte
authored andcommitted
Fix: focusInput open roo code panel (#2626) (#2817)
* Fix: focusInput open roo code panel (#2626) * Fix: `roo-cline.focusInput` open roo code panel * fixup! Fix: focusInput open roo code panel (#2626)
1 parent 40d1708 commit 4563b53

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/activate/registerCommands.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,20 @@ 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" })
117+
"roo-cline.focusInput": async () => {
118+
try {
119+
const panel = getPanel()
120+
if (!panel) {
121+
await vscode.commands.executeCommand("workbench.view.extension.roo-cline-ActivityBar")
122+
} else if (panel === tabPanel) {
123+
panel.reveal(vscode.ViewColumn.Active, false)
124+
} else if (panel === sidebarPanel) {
125+
await vscode.commands.executeCommand(`${ClineProvider.sideBarId}.focus`)
126+
provider.postMessageToWebview({ type: "action", action: "focusInput" })
127+
}
128+
} catch (error) {
129+
outputChannel.appendLine(`Error focusing input: ${error}`)
130+
}
119131
},
120132
"roo.acceptInput": () => {
121133
const visibleProvider = getVisibleProviderOrLog(outputChannel)

0 commit comments

Comments
 (0)