From c401c2cda4eb79a0ec689a1391417aa5269f4c15 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Tue, 29 Jul 2025 12:46:20 +0530 Subject: [PATCH] put a spinner to show authentication progress --- core/index.d.ts | 2 +- .../Lump/sections/mcp/MCPSection.tsx | 23 ++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/core/index.d.ts b/core/index.d.ts index f71b200bb..f9e85f72d 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -1262,10 +1262,10 @@ export interface MCPOptions { } export type MCPConnectionStatus = - | "authenticating" | "connecting" | "connected" | "error" + | "authenticating" | "not-connected"; export type MCPPromptArgs = { diff --git a/gui/src/components/mainInput/Lump/sections/mcp/MCPSection.tsx b/gui/src/components/mainInput/Lump/sections/mcp/MCPSection.tsx index 51e3368da..d771aad4a 100644 --- a/gui/src/components/mainInput/Lump/sections/mcp/MCPSection.tsx +++ b/gui/src/components/mainInput/Lump/sections/mcp/MCPSection.tsx @@ -3,6 +3,7 @@ import { ArrowPathIcon, CircleStackIcon, CommandLineIcon, + GlobeAltIcon, InformationCircleIcon, ShieldCheckIcon, ShieldExclamationIcon, @@ -20,10 +21,6 @@ import { Button } from "../../../../ui"; import EditBlockButton from "../../EditBlockButton"; import { ExploreBlocksButton } from "../ExploreBlocksButton"; -function has401Error(errors: string[]) { - return !!errors.find((error) => error.includes("401")); -} - interface MCPServerStatusProps { server: MCPServerStatus; serverFromYaml?: NonNullable[number]; @@ -61,6 +58,7 @@ function MCPServerPreview({ server, serverFromYaml }: MCPServerStatusProps) { }; const onRemoveAuth = async () => { + updateMCPServerStatus("authenticating"); await ideMessenger.request("mcp/removeAuthentication", server); }; @@ -76,7 +74,7 @@ function MCPServerPreview({ server, serverFromYaml }: MCPServerStatusProps) { style={{ fontSize: fontSize(-2), }} - className="flex flex-row items-center justify-between gap-3" + className={`flex flex-row items-center justify-between gap-3 ${server.status === "authenticating" ? "my-0.5" : ""}`} >
{/* Name and Status */} @@ -152,7 +150,7 @@ function MCPServerPreview({ server, serverFromYaml }: MCPServerStatusProps) {
- {server.isProtectedResource && server.status !== "authenticating" && ( + {server.isProtectedResource && ( <>
{server.status === "error" ? ( - ) : server.status === "connecting" ? null : ( + ) : server.status === "authenticating" ? ( + + ) : ( )}
- +