Revert "Better logic for choosing the view column when opening Roo in a tab" (#2285)

* Revert "Better logic for choosing the view column when opening Roo in a tab (…"

This reverts commit 7eea755703.

* Create hip-pumpkins-mate.md
This commit is contained in:
Matt Rubens 2025-04-04 02:14:33 -04:00 committed by GitHub
parent 98b04eb8d1
commit 16c1ab9ab5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 13 deletions

View file

@ -0,0 +1,5 @@
---
"roo-cline": patch
---
Revert "Better logic for choosing the view column when opening Roo in a tab"

View file

@ -123,26 +123,18 @@ export const openClineInNewTab = async ({ context, outputChannel }: Omit<Registe
// don't need to use that event).
// https://github.com/microsoft/vscode-extension-samples/blob/main/webview-sample/src/extension.ts
const tabProvider = new ClineProvider(context, outputChannel, "editor")
const lastCol = Math.max(...vscode.window.visibleTextEditors.map((editor) => editor.viewColumn || 0))
const activeEditor = vscode.window.activeTextEditor
// Check if there are any visible text editors, otherwise open a new group
// to the right.
const hasVisibleEditors = vscode.window.visibleTextEditors.length > 0
let targetCol: vscode.ViewColumn
if (!hasVisibleEditors) {
// No editors open, open in first column
targetCol = vscode.ViewColumn.One
} else if (activeEditor && activeEditor.document.isUntitled && vscode.window.visibleTextEditors.length === 1) {
// Only one editor and it's empty (untitled), reuse it
targetCol = activeEditor.viewColumn ?? vscode.ViewColumn.One
} else {
// Otherwise, create a new group to the right
await vscode.commands.executeCommand("workbench.action.newGroupRight")
// New group becomes the last + 1
const lastCol = Math.max(...vscode.window.visibleTextEditors.map((e) => e.viewColumn || 1))
targetCol = (lastCol + 1) as vscode.ViewColumn
}
const targetCol = hasVisibleEditors ? Math.max(lastCol + 1, 1) : vscode.ViewColumn.Two
const newPanel = vscode.window.createWebviewPanel(ClineProvider.tabPanelId, "Roo Code", targetCol, {
enableScripts: true,
retainContextWhenHidden: true,