diff --git a/ts/packages/client/src/socket/service-call.ts b/ts/packages/client/src/socket/service-call.ts index f3990aa9..efc96211 100644 --- a/ts/packages/client/src/socket/service-call.ts +++ b/ts/packages/client/src/socket/service-call.ts @@ -76,9 +76,8 @@ export class ServiceCall { * @param resp - The response object received from the server */ onReceived(resp: object) { - // Defensive check - this shouldn't happen but log if it does - if (this.complete == true) - console.log(this.mid, "should not happen, request is already complete"); + // Guard: ignore duplicate responses after completion + if (this.complete) return; // Mark as complete to prevent duplicate processing this.complete = true; @@ -151,12 +150,8 @@ export class ServiceCall { * Triggers another attempt if retries are available */ onTimeout() { - // Defensive check - this shouldn't happen but log if it does - if (this.complete == true) - console.log( - this.mid, - "timeout should not happen, request is already complete", - ); + // Guard: ignore timeout after completion + if (this.complete) return; console.log("Request", this.mid, "timed out"); @@ -184,12 +179,8 @@ export class ServiceCall { * Handles retries and waits for BaseApi to handle reconnection */ attempt() { - // Defensive check - this shouldn't be called on completed requests - if (this.complete == true) - console.log( - this.mid, - "attempt should not be called, request is already complete", - ); + // Guard: don't retry completed requests + if (this.complete) return; // Decrement retry counter this.retries--; diff --git a/ts/packages/workbench/src/components/layout/root-layout.tsx b/ts/packages/workbench/src/components/layout/root-layout.tsx index 2d1dbdc5..671bcf1f 100644 --- a/ts/packages/workbench/src/components/layout/root-layout.tsx +++ b/ts/packages/workbench/src/components/layout/root-layout.tsx @@ -31,6 +31,14 @@ export function RootLayout() { return (
+ {/* Skip to main content link (visible on focus for keyboard users) */} + + Skip to content + + {/* Global loading bar */} @@ -44,14 +52,14 @@ export function RootLayout() { {/* Connection lost banner */} {isDisconnected && ( -
+
Connection lost. Attempting to reconnect...
)} {/* Page content */} -
+
diff --git a/ts/packages/workbench/src/components/layout/sidebar.tsx b/ts/packages/workbench/src/components/layout/sidebar.tsx index bcd3346d..282e7883 100644 --- a/ts/packages/workbench/src/components/layout/sidebar.tsx +++ b/ts/packages/workbench/src/components/layout/sidebar.tsx @@ -69,7 +69,7 @@ function ConnectionBadge() { className={cn( "flex items-center gap-2 rounded-lg px-3 py-2 text-xs font-medium", isWarning - ? "text-amber-400" + ? "text-warning" : isConnected ? "text-success" : "text-fg-subtle", @@ -79,7 +79,7 @@ function ConnectionBadge() { className={cn( "h-2 w-2 shrink-0 rounded-full", isWarning - ? "bg-amber-400 animate-pulse" + ? "bg-warning animate-pulse" : isConnected ? "bg-success animate-pulse" : "bg-fg-subtle", @@ -111,12 +111,13 @@ function FlowSelectorDropdown() {
{/* Flow selector */}
-