Skip to content

Commit 0651c7b

Browse files
committed
fix(servers): keep Disable available for disconnected enabled servers
The new 'disconnected' action state dropped the Disable button — it only rendered for 'running'/'connected_auto', so an enabled server you Disconnect could no longer be turned off without reconnecting first. Add 'disconnected' to the Disable condition so it shows alongside Connect. Also refreshes a stale comment that still referenced the old hardcoded 'connecting' seed. Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
1 parent b1cc60b commit 0651c7b

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

apps/desktop/src/features/servers/ServersPage.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ export function ServersPage() {
367367
}
368368

369369
// Apply runtime statuses from ServerManager to fix initial connection_status
370-
// (mergeDefinitionsWithStates hardcodes 'connecting' for enabled servers)
370+
// (the view-model builders seed 'disconnected'; ServerManager owns the real
371+
// runtime status, which arrives via events)
371372
const mapStatus = (s: ConnectionStatus): ServerViewModel['connection_status'] => {
372373
if (s === 'refreshing' || s === 'authenticating') return 'connecting';
373374
return s;
@@ -1251,9 +1252,13 @@ export function ServersPage() {
12511252
</button>
12521253
)}
12531254

1254-
{/* Disable button - shown when enabled and connected/running */}
1255+
{/* Disable button - shown when an enabled server is connected,
1256+
running, or sitting disconnected (so it can still be turned off
1257+
without first reconnecting) */}
12551258
{server.enabled &&
1256-
(serverAction === 'running' || serverAction === 'connected_auto') && (
1259+
(serverAction === 'running' ||
1260+
serverAction === 'connected_auto' ||
1261+
serverAction === 'disconnected') && (
12571262
<button
12581263
onClick={() => handleDisableClick(server)}
12591264
disabled={disableLoading}
@@ -1765,7 +1770,6 @@ export function ServersPage() {
17651770
</div>
17661771
</div>
17671772
)}
1768-
17691773
</div>
17701774

17711775
{/* Pinned footer — always visible regardless of form length (#163) */}

0 commit comments

Comments
 (0)