From 031ea3a58ff62b66f4553586eb30658af4ef57a6 Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 16 Nov 2025 11:31:27 +0800 Subject: [PATCH] style(mcp): refine panel layout for better visual hierarchy and compactness - Replace checkboxes with toggle switches for app selection (more intuitive for enable/disable actions) - Change switch color from blue to emerald to match MCP button theme - Stack app options vertically with labels on left to save horizontal space - Reduce panel width from max-w-4xl to max-w-3xl for more compact design - Move docs button next to server name for better information grouping --- src/components/mcp/UnifiedMcpPanel.tsx | 82 +++++++++++++------------- src/components/ui/switch.tsx | 2 +- 2 files changed, 43 insertions(+), 41 deletions(-) diff --git a/src/components/mcp/UnifiedMcpPanel.tsx b/src/components/mcp/UnifiedMcpPanel.tsx index 908be51..ab96746 100644 --- a/src/components/mcp/UnifiedMcpPanel.tsx +++ b/src/components/mcp/UnifiedMcpPanel.tsx @@ -9,7 +9,7 @@ import { DialogHeader, DialogTitle, } from "@/components/ui/dialog"; -import { Checkbox } from "@/components/ui/checkbox"; +import { Switch } from "@/components/ui/switch"; import { useAllMcpServers, useToggleMcpApp } from "@/hooks/useMcp"; import type { McpServer } from "@/types"; import type { AppId } from "@/lib/api/types"; @@ -117,7 +117,7 @@ const UnifiedMcpPanel: React.FC = ({ return ( <> - +
{t("mcp.unifiedPanel.title")} @@ -264,9 +264,22 @@ const UnifiedMcpListItem: React.FC = ({
{/* 左侧:服务器信息 */}
-

- {name} -

+
+

+ {name} +

+ {docsUrl && ( + + )} +
{description && (

{description} @@ -279,70 +292,59 @@ const UnifiedMcpListItem: React.FC = ({ )}

- {/* 中间:应用复选框 */} -
-
- - onToggleApp(id, "claude", checked === true) - } - /> + {/* 中间:应用开关 */} +
+
-
- -
- - onToggleApp(id, "codex", checked === true) + onToggleApp(id, "claude", checked) } /> +
+ +
-
- -
- - onToggleApp(id, "gemini", checked === true) + onToggleApp(id, "codex", checked) } /> +
+ +
+ + onToggleApp(id, "gemini", checked) + } + />
{/* 右侧:操作按钮 */}
- {docsUrl && ( - - )}