Skip to content

Commit 941e5ae

Browse files
committed
refactor: remove “Open in Editor” and openInNewTab features, commands, and menus; update tests
1 parent f839d4c commit 941e5ae

File tree

6 files changed

+3
-205
lines changed

6 files changed

+3
-205
lines changed

apps/vscode-e2e/src/suite/extension.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ suite("Roo Code Extension", function () {
1717
"plusButtonClicked",
1818
"mcpButtonClicked",
1919
"promptsButtonClicked",
20-
"popoutButtonClicked",
21-
"openInNewTab",
2220
"settingsButtonClicked",
2321
"historyButtonClicked",
2422
"showHumanRelayDialog",

packages/build/src/__tests__/index.test.ts

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ describe("generatePackageJson", () => {
3737
title: "%command.newTask.title%",
3838
icon: "$(edit)",
3939
},
40-
{
41-
command: "roo-cline.openInNewTab",
42-
title: "%command.openInNewTab.title%",
43-
category: "%configuration.title%",
44-
},
4540
],
4641
menus: {
4742
"editor/context": [
@@ -56,23 +51,6 @@ describe("generatePackageJson", () => {
5651
group: "1_actions@1",
5752
},
5853
],
59-
"editor/title": [
60-
{
61-
command: "roo-cline.plusButtonClicked",
62-
group: "navigation@1",
63-
when: "activeWebviewPanelId == roo-cline.TabPanelProvider",
64-
},
65-
{
66-
command: "roo-cline.settingsButtonClicked",
67-
group: "navigation@6",
68-
when: "activeWebviewPanelId == roo-cline.TabPanelProvider",
69-
},
70-
{
71-
command: "roo-cline.accountButtonClicked",
72-
group: "navigation@6",
73-
when: "activeWebviewPanelId == roo-cline.TabPanelProvider",
74-
},
75-
],
7654
},
7755
submenus: [
7856
{
@@ -150,11 +128,6 @@ describe("generatePackageJson", () => {
150128
title: "%command.newTask.title%",
151129
icon: "$(edit)",
152130
},
153-
{
154-
command: "roo-code-nightly.openInNewTab",
155-
title: "%command.openInNewTab.title%",
156-
category: "%configuration.title%",
157-
},
158131
],
159132
menus: {
160133
"editor/context": [
@@ -169,23 +142,6 @@ describe("generatePackageJson", () => {
169142
group: "1_actions@1",
170143
},
171144
],
172-
"editor/title": [
173-
{
174-
command: "roo-code-nightly.plusButtonClicked",
175-
group: "navigation@1",
176-
when: "activeWebviewPanelId == roo-code-nightly.TabPanelProvider",
177-
},
178-
{
179-
command: "roo-code-nightly.settingsButtonClicked",
180-
group: "navigation@6",
181-
when: "activeWebviewPanelId == roo-code-nightly.TabPanelProvider",
182-
},
183-
{
184-
command: "roo-code-nightly.accountButtonClicked",
185-
group: "navigation@6",
186-
when: "activeWebviewPanelId == roo-code-nightly.TabPanelProvider",
187-
},
188-
],
189145
},
190146
submenus: [
191147
{

packages/types/src/vscode.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,9 @@ export const commandIds = [
3434
"mcpButtonClicked",
3535
"historyButtonClicked",
3636
"marketplaceButtonClicked",
37-
"popoutButtonClicked",
3837
"cloudButtonClicked",
3938
"settingsButtonClicked",
4039

41-
"openInNewTab",
42-
4340
"showHumanRelayDialog",
4441
"registerHumanRelayCallback",
4542
"unregisterHumanRelayCallback",

src/activate/registerCommands.ts

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
import * as vscode from "vscode"
2-
import delay from "delay"
32

43
import type { CommandId } from "@roo-code/types"
54
import { TelemetryService } from "@roo-code/telemetry"
65

76
import { Package } from "../shared/package"
87
import { getCommand } from "../utils/commands"
98
import { ClineProvider } from "../core/webview/ClineProvider"
10-
import { ContextProxy } from "../core/config/ContextProxy"
119
import { focusPanel } from "../utils/focusPanel"
1210

1311
import { registerHumanRelayCallback, unregisterHumanRelayCallback, handleHumanRelayResponse } from "./humanRelay"
1412
import { handleNewTask } from "./handleTask"
15-
import { CodeIndexManager } from "../services/code-index/manager"
1613
import { importSettingsWithFeedback } from "../core/config/importExport"
17-
import { MdmService } from "../services/mdm/MdmService"
18-
import { t } from "../i18n"
1914

2015
/**
2116
* Helper to get the visible ClineProvider instance or log if not found.
@@ -123,12 +118,6 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
123118

124119
visibleProvider.postMessageToWebview({ type: "action", action: "promptsButtonClicked" })
125120
},
126-
popoutButtonClicked: () => {
127-
TelemetryService.instance.captureTitleButtonClicked("popout")
128-
129-
return openClineInNewTab({ context, outputChannel })
130-
},
131-
openInNewTab: () => openClineInNewTab({ context, outputChannel }),
132121
settingsButtonClicked: () => {
133122
const visibleProvider = getVisibleProviderOrLog(outputChannel)
134123

@@ -234,79 +223,3 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
234223
})
235224
},
236225
})
237-
238-
export const openClineInNewTab = async ({ context, outputChannel }: Omit<RegisterCommandOptions, "provider">) => {
239-
// (This example uses webviewProvider activation event which is necessary to
240-
// deserialize cached webview, but since we use retainContextWhenHidden, we
241-
// don't need to use that event).
242-
// https://github.com/microsoft/vscode-extension-samples/blob/main/webview-sample/src/extension.ts
243-
const contextProxy = await ContextProxy.getInstance(context)
244-
const codeIndexManager = CodeIndexManager.getInstance(context)
245-
246-
// Get the existing MDM service instance to ensure consistent policy enforcement
247-
let mdmService: MdmService | undefined
248-
try {
249-
mdmService = MdmService.getInstance()
250-
} catch (error) {
251-
// MDM service not initialized, which is fine - extension can work without it
252-
mdmService = undefined
253-
}
254-
255-
const tabProvider = new ClineProvider(context, outputChannel, "editor", contextProxy, mdmService)
256-
const lastCol = Math.max(...vscode.window.visibleTextEditors.map((editor) => editor.viewColumn || 0))
257-
258-
// Check if there are any visible text editors, otherwise open a new group
259-
// to the right.
260-
const hasVisibleEditors = vscode.window.visibleTextEditors.length > 0
261-
262-
if (!hasVisibleEditors) {
263-
await vscode.commands.executeCommand("workbench.action.newGroupRight")
264-
}
265-
266-
const targetCol = hasVisibleEditors ? Math.max(lastCol + 1, 1) : vscode.ViewColumn.Two
267-
268-
const newPanel = vscode.window.createWebviewPanel(ClineProvider.tabPanelId, "Roo Code", targetCol, {
269-
enableScripts: true,
270-
retainContextWhenHidden: true,
271-
localResourceRoots: [context.extensionUri],
272-
})
273-
274-
// Save as tab type panel.
275-
setPanel(newPanel, "tab")
276-
277-
// TODO: Use better svg icon with light and dark variants (see
278-
// https://stackoverflow.com/questions/58365687/vscode-extension-iconpath).
279-
newPanel.iconPath = {
280-
light: vscode.Uri.joinPath(context.extensionUri, "assets", "icons", "panel_light.png"),
281-
dark: vscode.Uri.joinPath(context.extensionUri, "assets", "icons", "panel_dark.png"),
282-
}
283-
284-
await tabProvider.resolveWebviewView(newPanel)
285-
286-
// Add listener for visibility changes to notify webview
287-
newPanel.onDidChangeViewState(
288-
(e) => {
289-
const panel = e.webviewPanel
290-
if (panel.visible) {
291-
panel.webview.postMessage({ type: "action", action: "didBecomeVisible" }) // Use the same message type as in SettingsView.tsx
292-
}
293-
},
294-
null, // First null is for `thisArgs`
295-
context.subscriptions, // Register listener for disposal
296-
)
297-
298-
// Handle panel closing events.
299-
newPanel.onDidDispose(
300-
() => {
301-
setPanel(undefined, "tab")
302-
},
303-
null,
304-
context.subscriptions, // Also register dispose listener
305-
)
306-
307-
// Lock the editor group so clicking on files doesn't open them over the panel.
308-
await delay(100)
309-
await vscode.commands.executeCommand("workbench.action.lockEditorGroup")
310-
311-
return tabProvider
312-
}

src/extension/api.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { IpcServer } from "@roo-code/ipc"
2323

2424
import { Package } from "../shared/package"
2525
import { ClineProvider } from "../core/webview/ClineProvider"
26-
import { openClineInNewTab } from "../activate/registerCommands"
2726

2827
export class API extends EventEmitter<RooCodeEvents> implements RooCodeAPI {
2928
private readonly outputChannel: vscode.OutputChannel
@@ -118,17 +117,9 @@ export class API extends EventEmitter<RooCodeEvents> implements RooCodeAPI {
118117
}) {
119118
let provider: ClineProvider
120119

121-
if (newTab) {
122-
await vscode.commands.executeCommand("workbench.action.files.revert")
123-
await vscode.commands.executeCommand("workbench.action.closeAllEditors")
124-
125-
provider = await openClineInNewTab({ context: this.context, outputChannel: this.outputChannel })
126-
this.registerListeners(provider)
127-
} else {
128-
await vscode.commands.executeCommand(`${Package.name}.SidebarProvider.focus`)
129-
130-
provider = this.sidebarProvider
131-
}
120+
// Always use the sidebar provider; "open in editor" tab mode has been removed
121+
await vscode.commands.executeCommand(`${Package.name}.SidebarProvider.focus`)
122+
provider = this.sidebarProvider
132123

133124
await provider.removeClineFromStack()
134125
await provider.postStateToWebview()

src/package.json

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@
9595
"title": "%command.marketplace.title%",
9696
"icon": "$(extensions)"
9797
},
98-
{
99-
"command": "roo-cline.popoutButtonClicked",
100-
"title": "%command.openInEditor.title%",
101-
"icon": "$(link-external)"
102-
},
10398
{
10499
"command": "roo-cline.cloudButtonClicked",
105100
"title": "%command.cloud.title%",
@@ -110,11 +105,6 @@
110105
"title": "%command.settings.title%",
111106
"icon": "$(settings-gear)"
112107
},
113-
{
114-
"command": "roo-cline.openInNewTab",
115-
"title": "%command.openInNewTab.title%",
116-
"category": "%configuration.title%"
117-
},
118108
{
119109
"command": "roo-cline.explainCode",
120110
"title": "%command.explainCode.title%",
@@ -257,53 +247,6 @@
257247
"command": "roo-cline.mcpButtonClicked",
258248
"group": "overflow@3",
259249
"when": "view == roo-cline.SidebarProvider"
260-
},
261-
{
262-
"command": "roo-cline.popoutButtonClicked",
263-
"group": "overflow@4",
264-
"when": "view == roo-cline.SidebarProvider"
265-
}
266-
],
267-
"editor/title": [
268-
{
269-
"command": "roo-cline.plusButtonClicked",
270-
"group": "navigation@1",
271-
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
272-
},
273-
{
274-
"command": "roo-cline.marketplaceButtonClicked",
275-
"group": "navigation@2",
276-
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
277-
},
278-
{
279-
"command": "roo-cline.settingsButtonClicked",
280-
"group": "navigation@3",
281-
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
282-
},
283-
{
284-
"command": "roo-cline.cloudButtonClicked",
285-
"group": "navigation@4",
286-
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
287-
},
288-
{
289-
"command": "roo-cline.historyButtonClicked",
290-
"group": "overflow@1",
291-
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
292-
},
293-
{
294-
"command": "roo-cline.promptsButtonClicked",
295-
"group": "overflow@2",
296-
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
297-
},
298-
{
299-
"command": "roo-cline.mcpButtonClicked",
300-
"group": "overflow@3",
301-
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
302-
},
303-
{
304-
"command": "roo-cline.popoutButtonClicked",
305-
"group": "overflow@4",
306-
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
307250
}
308251
]
309252
},

0 commit comments

Comments
 (0)