Skip to content

Commit e757bd4

Browse files
committed
fix: replace enabled switch with button
1 parent 35572c3 commit e757bd4

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

webview-ui/src/components/mcp/McpToolRow.tsx

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,30 +66,25 @@ const McpToolRow = ({ tool, serverName, serverSource, alwaysAllowMcp }: McpToolR
6666
</VSCodeCheckbox>
6767
)}
6868

69-
{/* Enabled switch */}
70-
<div
71-
role="switch"
72-
aria-checked={tool.enabledForPrompt}
69+
{/* Enabled eye button */}
70+
<button
71+
role="button"
72+
aria-pressed={tool.enabledForPrompt}
7373
aria-label={t("mcp:tool.togglePromptInclusion")}
74-
tabIndex={0}
75-
className={`relative h-5 w-9 cursor-pointer rounded-full transition-colors ${
76-
tool.enabledForPrompt ? "bg-vscode-button-background" : "bg-vscode-input-background"
74+
className={`p-1 rounded hover:bg-vscode-toolbar-hoverBackground transition-colors ${
75+
tool.enabledForPrompt
76+
? "text-vscode-foreground"
77+
: "text-vscode-descriptionForeground opacity-60"
7778
}`}
7879
onClick={handleEnabledForPromptChange}
79-
onKeyDown={(e) => {
80-
if (e.key === "Enter" || e.key === " ") {
81-
e.preventDefault()
82-
handleEnabledForPromptChange()
83-
}
84-
}}
8580
data-tool-prompt-toggle={tool.name}
8681
title={t("mcp:tool.togglePromptInclusion")}>
87-
<div
88-
className={`absolute top-0.5 h-4 w-4 rounded-full bg-vscode-button-foreground shadow-sm transition-transform ${
89-
tool.enabledForPrompt ? "translate-x-4" : "translate-x-0.5"
90-
}`}
82+
<span
83+
className={`codicon ${
84+
tool.enabledForPrompt ? "codicon-eye" : "codicon-eye-closed"
85+
} text-base`}
9186
/>
92-
</div>
87+
</button>
9388
</div>
9489
)}
9590
</div>

0 commit comments

Comments
 (0)