mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 20:31:37 -05:00
Add 'Open In New Tab' command pallete option
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
{
|
{
|
||||||
"type": "webview",
|
"type": "webview",
|
||||||
"id": "claude-dev.ClaudeDevProvider",
|
"id": "claude-dev.ClaudeDevProvider",
|
||||||
"name": ""
|
"name": "Claude Dev"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -60,7 +60,12 @@
|
|||||||
"command": "claude-dev.settingsButtonTapped",
|
"command": "claude-dev.settingsButtonTapped",
|
||||||
"title": "Settings",
|
"title": "Settings",
|
||||||
"icon": "$(settings-gear)"
|
"icon": "$(settings-gear)"
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"command": "claude-dev.openInNewTab",
|
||||||
|
"title": "Open In New Tab",
|
||||||
|
"category": "Claude Dev"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"menus": {
|
"menus": {
|
||||||
"view/title": [
|
"view/title": [
|
||||||
|
|||||||
@@ -47,28 +47,25 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
context.subscriptions.push(
|
const openClaudeDevInNewTab = async () => {
|
||||||
vscode.commands.registerCommand("claude-dev.popoutButtonTapped", async () => {
|
// (this example uses webviewProvider activation event which is necessary to deserialize cached webview, but since we use retainContextWhenHidden, we don't need to use that event)
|
||||||
// (this example uses webviewProvider activation event which is necessary to deserialize cached webview, but since we use retainContextWhenHidden, we don't need to use that event)
|
// https://github.com/microsoft/vscode-extension-samples/blob/main/webview-sample/src/extension.ts
|
||||||
// https://github.com/microsoft/vscode-extension-samples/blob/main/webview-sample/src/extension.ts
|
const tabProvider = new ClaudeDevProvider(context)
|
||||||
const tabProvider = new ClaudeDevProvider(context)
|
//const column = vscode.window.activeTextEditor ? vscode.window.activeTextEditor.viewColumn : undefined
|
||||||
const column = vscode.window.activeTextEditor ? vscode.window.activeTextEditor.viewColumn : undefined
|
const lastCol = Math.max(...vscode.window.visibleTextEditors.map((editor) => editor.viewColumn || 0))
|
||||||
const panel = vscode.window.createWebviewPanel(
|
const targetCol = Math.max(lastCol + 1, 1)
|
||||||
ClaudeDevProvider.viewType,
|
const panel = vscode.window.createWebviewPanel(ClaudeDevProvider.viewType, "Claude Dev", targetCol, {
|
||||||
"Claude Dev",
|
enableScripts: true,
|
||||||
column || vscode.ViewColumn.One,
|
retainContextWhenHidden: true,
|
||||||
{
|
localResourceRoots: [context.extensionUri],
|
||||||
enableScripts: true,
|
|
||||||
retainContextWhenHidden: true,
|
|
||||||
localResourceRoots: [context.extensionUri],
|
|
||||||
}
|
|
||||||
)
|
|
||||||
// TODO: use better svg icon with light and dark variants (see https://stackoverflow.com/questions/58365687/vscode-extension-iconpath)
|
|
||||||
panel.iconPath = vscode.Uri.joinPath(context.extensionUri, "icon.png")
|
|
||||||
|
|
||||||
tabProvider.resolveWebviewView(panel)
|
|
||||||
})
|
})
|
||||||
)
|
// TODO: use better svg icon with light and dark variants (see https://stackoverflow.com/questions/58365687/vscode-extension-iconpath)
|
||||||
|
panel.iconPath = vscode.Uri.joinPath(context.extensionUri, "icon.png")
|
||||||
|
tabProvider.resolveWebviewView(panel)
|
||||||
|
}
|
||||||
|
|
||||||
|
context.subscriptions.push(vscode.commands.registerCommand("claude-dev.popoutButtonTapped", openClaudeDevInNewTab))
|
||||||
|
context.subscriptions.push(vscode.commands.registerCommand("claude-dev.openInNewTab", openClaudeDevInNewTab))
|
||||||
|
|
||||||
context.subscriptions.push(
|
context.subscriptions.push(
|
||||||
vscode.commands.registerCommand("claude-dev.settingsButtonTapped", () => {
|
vscode.commands.registerCommand("claude-dev.settingsButtonTapped", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user