Skip to content

Commit 0b8ec9e

Browse files
mrubenscte
authored andcommitted
Revert "Always focus the panel when clicked to ensure menu buttons are visible" (#4592)
Revert "Always focus the panel when clicked to ensure menu buttons are visibl…" This reverts commit 1b1e5a2.
1 parent c808533 commit 0b8ec9e

File tree

10 files changed

+9
-95
lines changed

10 files changed

+9
-95
lines changed

.changeset/khaki-clocks-float.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/telemetry/src/TelemetryService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export class TelemetryService {
173173
itemType,
174174
itemName,
175175
target,
176-
...(properties || {}),
176+
... (properties || {}),
177177
})
178178
}
179179

packages/types/src/vscode.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export const commandIds = [
5151

5252
"focusInput",
5353
"acceptInput",
54-
"focusPanel",
5554
] as const
5655

5756
export type CommandId = (typeof commandIds)[number]

src/activate/registerCommands.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { Package } from "../shared/package"
88
import { getCommand } from "../utils/commands"
99
import { ClineProvider } from "../core/webview/ClineProvider"
1010
import { ContextProxy } from "../core/config/ContextProxy"
11-
import { focusPanel } from "../utils/focusPanel"
1211

1312
import { registerHumanRelayCallback, unregisterHumanRelayCallback, handleHumanRelayResponse } from "./humanRelay"
1413
import { handleNewTask } from "./handleTask"
@@ -173,23 +172,20 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
173172
},
174173
focusInput: async () => {
175174
try {
176-
await focusPanel(tabPanel, sidebarPanel)
177-
178-
// Send focus input message only for sidebar panels
179-
if (sidebarPanel && getPanel() === sidebarPanel) {
175+
const panel = getPanel()
176+
177+
if (!panel) {
178+
await vscode.commands.executeCommand(`workbench.view.extension.${Package.name}-ActivityBar`)
179+
} else if (panel === tabPanel) {
180+
panel.reveal(vscode.ViewColumn.Active, false)
181+
} else if (panel === sidebarPanel) {
182+
await vscode.commands.executeCommand(`${ClineProvider.sideBarId}.focus`)
180183
provider.postMessageToWebview({ type: "action", action: "focusInput" })
181184
}
182185
} catch (error) {
183186
outputChannel.appendLine(`Error focusing input: ${error}`)
184187
}
185188
},
186-
focusPanel: async () => {
187-
try {
188-
await focusPanel(tabPanel, sidebarPanel)
189-
} catch (error) {
190-
outputChannel.appendLine(`Error focusing panel: ${error}`)
191-
}
192-
},
193189
acceptInput: () => {
194190
const visibleProvider = getVisibleProviderOrLog(outputChannel)
195191

src/core/webview/webviewMessageHandler.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,11 +1475,6 @@ export const webviewMessageHandler = async (
14751475
}
14761476
break
14771477
}
1478-
case "focusPanelRequest": {
1479-
// Execute the focusPanel command to focus the WebView
1480-
await vscode.commands.executeCommand(getCommand("focusPanel"))
1481-
break
1482-
}
14831478
case "filterMarketplaceItems": {
14841479
// Check if marketplace is enabled before making API calls
14851480
const { experiments } = await provider.getState()

src/shared/WebviewMessage.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ export interface WebviewMessage {
150150
| "clearIndexData"
151151
| "indexingStatusUpdate"
152152
| "indexCleared"
153-
| "focusPanelRequest"
154153
| "codebaseIndexConfig"
155154
| "setHistoryPreviewCollapsed"
156155
| "openExternal"

src/utils/focusPanel.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

webview-ui/src/App.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { MarketplaceView } from "./components/marketplace/MarketplaceView"
1818
import ModesView from "./components/modes/ModesView"
1919
import { HumanRelayDialog } from "./components/human-relay/HumanRelayDialog"
2020
import { AccountView } from "./components/account/AccountView"
21-
import { useAddNonInteractiveClickListener } from "./components/ui/hooks/useNonInteractiveClick"
2221

2322
type Tab = "settings" | "history" | "mcp" | "modes" | "chat" | "marketplace" | "account"
2423

@@ -136,13 +135,6 @@ const App = () => {
136135
// Tell the extension that we are ready to receive messages.
137136
useEffect(() => vscode.postMessage({ type: "webviewDidLaunch" }), [])
138137

139-
// Focus the WebView when non-interactive content is clicked
140-
useAddNonInteractiveClickListener(
141-
useCallback(() => {
142-
vscode.postMessage({ type: "focusPanelRequest" })
143-
}, []),
144-
)
145-
146138
if (!didHydrateState) {
147139
return null
148140
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export * from "./useClipboard"
22
export * from "./useRooPortal"
3-
export * from "./useNonInteractiveClick"

webview-ui/src/components/ui/hooks/useNonInteractiveClick.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)