-
Notifications
You must be signed in to change notification settings - Fork 744
Add loading state for Connect/Restart buttons #631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…oading state to buttons.
This looks good! |
I like this too. Usability ✨ are great additions. 👍 What about going all the way, and indicating exactly what was clicked? diff --git a/client/src/components/Sidebar.tsx b/client/src/components/Sidebar.tsx
index 134397c..bdd785c 100644
--- a/client/src/components/Sidebar.tsx
+++ b/client/src/components/Sidebar.tsx
@@ -243,6 +243,10 @@ const Sidebar = ({
}
}, [generateMCPServerFile, toast, reportError]);
+ const connectButtonConfig = transportType === "stdio"
+ ? { label: "Restart", loadingText: "Restarting" }
+ : { label: "Reconnect", loadingText: "Reconnecting" };
+
return (
<div className="bg-card border-r border-border flex flex-col h-full">
<div className="flex items-center justify-between p-4 border-b border-gray-200 dark:border-border">
@@ -700,9 +704,10 @@ const Sidebar = ({
data-testid="connect-button"
onClick={handleRestart}
loading={isConnecting}
+ loadingText={connectButtonConfig.loadingText}
>
<RotateCcw className="w-4 h-4 mr-2" />
- {transportType === "stdio" ? "Restart" : "Reconnect"}
+ {connectButtonConfig.label}
</Button>
<Button onClick={onDisconnect}>
<RefreshCwOff className="w-4 h-4 mr-2" />
@@ -715,6 +720,7 @@ const Sidebar = ({
className="w-full"
onClick={handleConnect}
loading={isConnecting}
+ loadingText="Connecting"
>
<Play className="w-4 h-4 mr-2" />
Connect |
Hi @bfmvsa I think this is a great idea, however I was testing this locally and ran into this situation:
Could we add something to handle that scenario more gracefully? |
Hi @olaservo, good catch! BTW, the same issue is the root of the problem in the current release screenshot.2025-08-12.at.15.42.37.mp4 |
Added loading state indication to buttons. Implemented loading/loadingText props for the button component and updated the Connect/Restart buttons.
Motivation and Context
Users had no visual feedback when clicking buttons that triggered connect/restart operations, leading to confusion and potential duplicate clicks. This change provides immediate loading feedback.
How Has This Been Tested?
Breaking Changes
None.
Types of changes
Checklist
Additional context
screenshot.2025-07-19.at.18.17.44.mov