From a15df913fe01709e60b68a87c5f90edcd81d274e Mon Sep 17 00:00:00 2001 From: Cloudkkk <445218339@qq.com> Date: Wed, 9 Apr 2025 11:32:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Add=20clear=20button?= =?UTF-8?q?=20for=20error=20notifications?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/App.tsx | 5 +++++ client/src/components/Sidebar.tsx | 18 +++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index 4f99ffd..04be204 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -467,6 +467,10 @@ const App = () => { setLogLevel(level); }; + const clearStdErrNotifications = () => { + setStdErrNotifications([]); + }; + if (window.location.pathname === "/oauth/callback") { const OAuthCallback = React.lazy( () => import("./components/OAuthCallback"), @@ -502,6 +506,7 @@ const App = () => { logLevel={logLevel} sendLogLevelRequest={sendLogLevelRequest} loggingSupported={!!serverCapabilities?.logging || false} + clearStdErrNotifications={clearStdErrNotifications} />
diff --git a/client/src/components/Sidebar.tsx b/client/src/components/Sidebar.tsx index 4633d64..b84ea5d 100644 --- a/client/src/components/Sidebar.tsx +++ b/client/src/components/Sidebar.tsx @@ -54,6 +54,7 @@ interface SidebarProps { onConnect: () => void; onDisconnect: () => void; stdErrNotifications: StdErrNotification[]; + clearStdErrNotifications: () => void; logLevel: LoggingLevel; sendLogLevelRequest: (level: LoggingLevel) => void; loggingSupported: boolean; @@ -78,6 +79,7 @@ const Sidebar = ({ onConnect, onDisconnect, stdErrNotifications, + clearStdErrNotifications, logLevel, sendLogLevelRequest, loggingSupported, @@ -470,9 +472,19 @@ const Sidebar = ({ {stdErrNotifications.length > 0 && ( <>
-

- Error output from MCP server -

+
+

+ Error output from MCP server +

+ +
{stdErrNotifications.map((notification, index) => (
Date: Sat, 12 Apr 2025 14:30:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?test:=20=F0=9F=92=8D=20Add=20test=20case=20?= =?UTF-8?q?property?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/__tests__/Sidebar.test.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/components/__tests__/Sidebar.test.tsx b/client/src/components/__tests__/Sidebar.test.tsx index 8e72b00..bce9737 100644 --- a/client/src/components/__tests__/Sidebar.test.tsx +++ b/client/src/components/__tests__/Sidebar.test.tsx @@ -29,6 +29,7 @@ describe("Sidebar Environment Variables", () => { onConnect: jest.fn(), onDisconnect: jest.fn(), stdErrNotifications: [], + clearStdErrNotifications: jest.fn(), logLevel: "info" as const, sendLogLevelRequest: jest.fn(), loggingSupported: true,