From 7f1131dfaea916d76cee192e5079ffacf5667ec3 Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 10 Oct 2025 11:58:40 +0800 Subject: [PATCH] refactor(mcp): improve UI consistency and i18n MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add MCP-specific green button style (buttonStyles.mcp) - Unify MCP panel and form buttons with emerald theme - Adjust MCP entry button width to match AppSwitcher (px-3) - Reduce JSON editor height from h-64 to h-48 - Update translations: "Add/Edit Server" → "Add/Edit MCP" - Change form label to "MCP Title (Unique)" for clarity - Move config wizard button to right side of JSON label - Fix McpListItem enabled state check (explicit true check) --- src/App.tsx | 10 +++++----- src/components/mcp/McpFormModal.tsx | 6 +++--- src/components/mcp/McpListItem.tsx | 4 ++-- src/components/mcp/McpPanel.tsx | 4 ++-- src/i18n/locales/en.json | 8 ++++---- src/i18n/locales/zh.json | 8 ++++---- src/lib/styles.ts | 4 ++++ 7 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index af9e551..d71c732 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -23,7 +23,7 @@ function App() { const [currentProviderId, setCurrentProviderId] = useState(""); const [isAddModalOpen, setIsAddModalOpen] = useState(false); const [editingProviderId, setEditingProviderId] = useState( - null, + null ); const [notification, setNotification] = useState<{ message: string; @@ -44,7 +44,7 @@ function App() { const showNotification = ( message: string, type: "success" | "error", - duration = 3000, + duration = 3000 ) => { // 清除之前的定时器 if (timeoutRef.current) { @@ -196,7 +196,7 @@ function App() { ? t("notifications.removedFromClaudePlugin") : t("notifications.appliedToClaudePlugin"), "success", - 2000, + 2000 ); } } catch (error: any) { @@ -219,7 +219,7 @@ function App() { showNotification( t("notifications.switchSuccess", { appName }), "success", - 2000, + 2000 ); // 更新托盘菜单 await window.api.updateTrayMenu(); @@ -310,7 +310,7 @@ function App() { diff --git a/src/components/mcp/McpFormModal.tsx b/src/components/mcp/McpFormModal.tsx index 6b09858..89260f2 100644 --- a/src/components/mcp/McpFormModal.tsx +++ b/src/components/mcp/McpFormModal.tsx @@ -244,13 +244,13 @@ const McpFormModal: React.FC = ({