From 77a5fa504412b1e5874b7c5e1de6fbed0d2530be Mon Sep 17 00:00:00 2001 From: elpresidank Date: Fri, 10 Apr 2026 07:48:01 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20QA=20regression=20pass=20=E2=80=94=20gra?= =?UTF-8?q?ph=20sizing,=20focus=20trap,=20contrast,=20accessibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix graph canvas using window dimensions instead of container by using ResizeObserver ref callback (attaches when conditionally-rendered container mounts) - Fix dialog focus trap escaping to background — filter hidden/disabled elements from focusable selector - Fix sidebar connection status and disconnection banner contrast — use semantic text-warning/bg-warning instead of amber-400 (1.65:1 → 4.5:1+) - Add aria-label to chat textarea, htmlFor/id pairs to flows dialog inputs - Add ARIA tab pattern to prompts page (role=tablist/tab/tabpanel, aria-selected, aria-controls) - Fix prompts heading hierarchy (H1→H2 instead of H1→H3) - Add flex-wrap to flows page header, fix badge contrast across pages - Fix service-call race condition with early returns instead of console.log Co-Authored-By: Claude Opus 4.6 (1M context) --- ts/packages/client/src/socket/service-call.ts | 21 ++---- .../src/components/layout/root-layout.tsx | 12 +++- .../src/components/layout/sidebar.tsx | 7 +- .../workbench/src/components/ui/dialog.tsx | 69 ++++++++++++++++++- ts/packages/workbench/src/pages/chat.tsx | 14 +++- ts/packages/workbench/src/pages/flows.tsx | 16 +++-- ts/packages/workbench/src/pages/graph.tsx | 67 ++++++++++++++---- .../workbench/src/pages/knowledge-cores.tsx | 2 +- ts/packages/workbench/src/pages/library.tsx | 33 ++++++--- ts/packages/workbench/src/pages/prompts.tsx | 24 ++++--- ts/packages/workbench/src/pages/settings.tsx | 17 +++-- .../workbench/src/pages/token-cost.tsx | 2 +- 12 files changed, 214 insertions(+), 70 deletions(-) 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 */}
-