Merge branch 'main' into cli-and-config-file-support

This commit is contained in:
Nicolas Barraud
2025-04-14 18:51:33 -04:00
committed by GitHub
4 changed files with 22 additions and 4 deletions

View File

@@ -467,6 +467,10 @@ const App = () => {
setLogLevel(level); setLogLevel(level);
}; };
const clearStdErrNotifications = () => {
setStdErrNotifications([]);
};
if (window.location.pathname === "/oauth/callback") { if (window.location.pathname === "/oauth/callback") {
const OAuthCallback = React.lazy( const OAuthCallback = React.lazy(
() => import("./components/OAuthCallback"), () => import("./components/OAuthCallback"),
@@ -502,6 +506,7 @@ const App = () => {
logLevel={logLevel} logLevel={logLevel}
sendLogLevelRequest={sendLogLevelRequest} sendLogLevelRequest={sendLogLevelRequest}
loggingSupported={!!serverCapabilities?.logging || false} loggingSupported={!!serverCapabilities?.logging || false}
clearStdErrNotifications={clearStdErrNotifications}
/> />
<div className="flex-1 flex flex-col overflow-hidden"> <div className="flex-1 flex flex-col overflow-hidden">
<div className="flex-1 overflow-auto"> <div className="flex-1 overflow-auto">

View File

@@ -227,7 +227,7 @@ const JsonNode = memo(
)} )}
<pre <pre
className={clsx( className={clsx(
typeStyleMap.string, isError ? typeStyleMap.error : typeStyleMap.string,
"break-all whitespace-pre-wrap", "break-all whitespace-pre-wrap",
)} )}
> >

View File

@@ -54,6 +54,7 @@ interface SidebarProps {
onConnect: () => void; onConnect: () => void;
onDisconnect: () => void; onDisconnect: () => void;
stdErrNotifications: StdErrNotification[]; stdErrNotifications: StdErrNotification[];
clearStdErrNotifications: () => void;
logLevel: LoggingLevel; logLevel: LoggingLevel;
sendLogLevelRequest: (level: LoggingLevel) => void; sendLogLevelRequest: (level: LoggingLevel) => void;
loggingSupported: boolean; loggingSupported: boolean;
@@ -78,6 +79,7 @@ const Sidebar = ({
onConnect, onConnect,
onDisconnect, onDisconnect,
stdErrNotifications, stdErrNotifications,
clearStdErrNotifications,
logLevel, logLevel,
sendLogLevelRequest, sendLogLevelRequest,
loggingSupported, loggingSupported,
@@ -514,9 +516,19 @@ const Sidebar = ({
{stdErrNotifications.length > 0 && ( {stdErrNotifications.length > 0 && (
<> <>
<div className="mt-4 border-t border-gray-200 pt-4"> <div className="mt-4 border-t border-gray-200 pt-4">
<h3 className="text-sm font-medium"> <div className="flex justify-between items-center">
Error output from MCP server <h3 className="text-sm font-medium">
</h3> Error output from MCP server
</h3>
<Button
variant="outline"
size="sm"
onClick={clearStdErrNotifications}
className="h-8 px-2"
>
Clear
</Button>
</div>
<div className="mt-2 max-h-80 overflow-y-auto"> <div className="mt-2 max-h-80 overflow-y-auto">
{stdErrNotifications.map((notification, index) => ( {stdErrNotifications.map((notification, index) => (
<div <div

View File

@@ -29,6 +29,7 @@ describe("Sidebar Environment Variables", () => {
onConnect: jest.fn(), onConnect: jest.fn(),
onDisconnect: jest.fn(), onDisconnect: jest.fn(),
stdErrNotifications: [], stdErrNotifications: [],
clearStdErrNotifications: jest.fn(),
logLevel: "info" as const, logLevel: "info" as const,
sendLogLevelRequest: jest.fn(), sendLogLevelRequest: jest.fn(),
loggingSupported: true, loggingSupported: true,