From 3445b1314dfd515463ce50fa8a1f4b9d587c793d Mon Sep 17 00:00:00 2001 From: Daniel Riccio Date: Mon, 16 Jun 2025 12:03:03 -0500 Subject: [PATCH] fix: enhance UI layout and improve accessibility for tool controls --- webview-ui/src/components/mcp/McpToolRow.tsx | 107 +++++++------------ 1 file changed, 38 insertions(+), 69 deletions(-) diff --git a/webview-ui/src/components/mcp/McpToolRow.tsx b/webview-ui/src/components/mcp/McpToolRow.tsx index 74e8964564..25bfe2ab41 100644 --- a/webview-ui/src/components/mcp/McpToolRow.tsx +++ b/webview-ui/src/components/mcp/McpToolRow.tsx @@ -37,34 +37,44 @@ const McpToolRow = ({ tool, serverName, serverSource, alwaysAllowMcp }: McpToolR } return ( -
+
e.stopPropagation()}> + {/* Tool name section */}
- - + + {tool.name}
-
- {" "} - {/* Wrapper for checkboxes */} - {serverName && ( + + {/* Controls section */} + {serverName && ( +
+ {/* Always Allow checkbox */} + {alwaysAllowMcp && ( + + + {t("mcp:tool.alwaysAllow")} + + + )} + + {/* Enabled switch */}
{ if (e.key === "Enter" || e.key === " ") { @@ -75,46 +85,22 @@ const McpToolRow = ({ tool, serverName, serverSource, alwaysAllowMcp }: McpToolR data-tool-prompt-toggle={tool.name} title={t("mcp:tool.togglePromptInclusion")}>
- )} - {serverName && alwaysAllowMcp && ( - - {t("mcp:tool.alwaysAllow")} - - )} -
+
+ )}
{tool.description && ( -
- {tool.description} -
+
{tool.description}
)} {tool.inputSchema && "properties" in tool.inputSchema && Object.keys(tool.inputSchema.properties as Record).length > 0 && ( -
-
+
+
{t("mcp:tool.parameters")}
{Object.entries(tool.inputSchema.properties as Record).map( @@ -126,29 +112,12 @@ const McpToolRow = ({ tool, serverName, serverSource, alwaysAllowMcp }: McpToolR tool.inputSchema.required.includes(paramName) return ( -
- +
+ {paramName} - {isRequired && ( - * - )} + {isRequired && *} - + {schema.description || t("mcp:tool.noDescription")}