From cbc523a2d99f271f54af5fa895b1d7f3c30cb2b5 Mon Sep 17 00:00:00 2001 From: Molecule AI Frontend Engineer Date: Fri, 17 Apr 2026 20:33:52 +0000 Subject: [PATCH] fix(canvas): wire aria-controls on MemoryEntryRow expand toggle Add bodyId derived from entry.key, attach aria-controls={bodyId} to the toggle button, and add id={bodyId} role="region" aria-label to the collapsible body div. Screen readers can now announce the expand/collapse relationship between the button and the region it controls (WCAG 4.1.2). Co-Authored-By: Claude Sonnet 4.6 --- canvas/src/components/MemoryInspectorPanel.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/canvas/src/components/MemoryInspectorPanel.tsx b/canvas/src/components/MemoryInspectorPanel.tsx index ed54d8b5..70ed8b8e 100644 --- a/canvas/src/components/MemoryInspectorPanel.tsx +++ b/canvas/src/components/MemoryInspectorPanel.tsx @@ -410,6 +410,7 @@ function MemoryEntryRow({ onCancelEdit, onDelete, }: MemoryEntryRowProps) { + const bodyId = `memory-body-${entry.key.replace(/\s+/g, "-")}`; return (
{/* Header row — click to expand/collapse */} @@ -417,6 +418,7 @@ function MemoryEntryRow({ className="w-full flex items-center gap-2 px-3 py-2.5 text-left hover:bg-zinc-800/30 transition-colors" onClick={onToggle} aria-expanded={isExpanded} + aria-controls={bodyId} > {entry.key} @@ -444,7 +446,12 @@ function MemoryEntryRow({ {/* Expanded body */} {isExpanded && ( -
+
{entry.expires_at && (

Expires: {new Date(entry.expires_at).toLocaleString()}