Compare commits

...

2 Commits

Author SHA1 Message Date
Elephant Lumps 62463284d9 changeset 2025-05-20 19:11:05 -07:00
Elephant Lumps 21f13f56c3 use navigation directly for openSettings 2025-05-20 19:09:59 -07:00
5 changed files with 12 additions and 14 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": minor
---
Migrate openSettings message to use state navigation handlers
-7
View File
@@ -423,13 +423,6 @@ export class Controller {
break
}
// telemetry
case "openSettings": {
await this.postMessageToWebview({
type: "action",
action: "settingsButtonClicked",
})
break
}
case "telemetrySetting": {
if (message.telemetrySetting) {
await this.updateTelemetrySetting(message.telemetrySetting)
-1
View File
@@ -30,7 +30,6 @@ export interface WebviewMessage {
| "searchCommits"
| "fetchLatestMcpServersFromHub"
| "telemetrySetting"
| "openSettings"
| "invoke"
| "updateSettings"
| "clearAllTaskHistory"
@@ -13,7 +13,7 @@ interface ConnectionInfo {
}
export const BrowserSettingsMenu = () => {
const { browserSettings } = useExtensionState()
const { browserSettings, navigateToSettings } = useExtensionState()
const containerRef = useRef<HTMLDivElement>(null)
const [showInfoPopover, setShowInfoPopover] = useState(false)
const [connectionInfo, setConnectionInfo] = useState<ConnectionInfo>({
@@ -65,10 +65,8 @@ export const BrowserSettingsMenu = () => {
}, [showInfoPopover])
const openBrowserSettings = () => {
// First open the settings panel
vscode.postMessage({
type: "openSettings",
})
// First open the settings panel using direct navigation
navigateToSettings()
// After a short delay, send a message to scroll to browser settings
setTimeout(async () => {
@@ -1,6 +1,7 @@
import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react"
import { memo, useState } from "react"
import styled from "styled-components"
import { useExtensionState } from "@/context/ExtensionStateContext"
import { vscode } from "@/utils/vscode"
import { TelemetrySetting } from "@shared/TelemetrySetting"
@@ -45,9 +46,11 @@ const ButtonContainer = styled.div`
`
const TelemetryBanner = () => {
const { navigateToSettings } = useExtensionState()
const handleOpenSettings = () => {
handleClose()
vscode.postMessage({ type: "openSettings" })
navigateToSettings()
}
const handleClose = () => {