From 6cd650f48c3b63a5ad2ece75556114897e341688 Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Sun, 3 May 2026 19:17:42 -0700 Subject: [PATCH] canvas/EventsTab: theme-flip event colors + a11y for expander rows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Four UIUX fixes for the workspace Events tab. 1. Hardcoded text-yellow-400 (DEGRADED) and text-purple-400 (AGENT_CARD_UPDATED) didn't theme-flip — read fine in dark mode, washed out in warm-paper light. Switched DEGRADED → text-warm (the semantic warm/amber token) and AGENT_CARD_UPDATED → text- accent (informational metadata, accent is the right semantic). 2. Refresh button hover was a no-op (bg-surface-card on top of itself). Lift to surface-elevated, matching the Cancel pattern from ConfirmDialog. Added focus-visible ring. 3. Event expander rows had no aria-expanded — screen readers heard a generic "button" with no indication it toggled. Added aria-expanded + aria-controls pointing to the payload panel id. 4. Added focus-visible ring on each expander button. Hover bg added too so the active row visibly responds. Co-Authored-By: Claude Opus 4.7 (1M context) --- canvas/src/components/tabs/EventsTab.tsx | 88 +++++++++++++++--------- 1 file changed, 55 insertions(+), 33 deletions(-) diff --git a/canvas/src/components/tabs/EventsTab.tsx b/canvas/src/components/tabs/EventsTab.tsx index 266d6389..07c90b09 100644 --- a/canvas/src/components/tabs/EventsTab.tsx +++ b/canvas/src/components/tabs/EventsTab.tsx @@ -15,14 +15,20 @@ interface EventEntry { created_at: string; } +// Use semantic warm-paper tokens so colors flip with theme. Earlier +// the table referenced text-yellow-400 / text-purple-400 (Tailwind +// raw colors, no theme variant), which read fine in dark mode but +// washed out in the warm-paper light theme. text-warm covers the +// "degraded" amber tone in both modes; AGENT_CARD_UPDATED is informational +// metadata, so reuse text-accent for theme-consistency. const EVENT_COLORS: Record = { WORKSPACE_ONLINE: "text-good", WORKSPACE_OFFLINE: "text-ink-mid", - WORKSPACE_DEGRADED: "text-yellow-400", + WORKSPACE_DEGRADED: "text-warm", WORKSPACE_PROVISIONING: "text-accent", WORKSPACE_REMOVED: "text-bad", WORKSPACE_PROVISION_FAILED: "text-bad", - AGENT_CARD_UPDATED: "text-purple-400", + AGENT_CARD_UPDATED: "text-accent", }; export function EventsTab({ workspaceId }: Props) { @@ -64,8 +70,12 @@ export function EventsTab({ workspaceId }: Props) {
{events.length} events @@ -81,39 +91,51 @@ export function EventsTab({ workspaceId }: Props) {

No events yet

) : (
- {events.map((event) => ( -
- + + {event.event_type} + + + {formatTime(event.created_at)} + + + - {expanded === event.id && ( -
-
-                    {JSON.stringify(event.payload, null, 2)}
-                  
-
- ID: {event.id} + {isOpen && ( +
+
+                      {JSON.stringify(event.payload, null, 2)}
+                    
+
+ ID: {event.id} +
-
- )} -
- ))} + )} +
+ ); + })}
)}