From 38b1af3b84b969b15539e41e90f6c1ef6e31f6dd Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Sun, 3 May 2026 20:39:29 -0700 Subject: [PATCH] canvas/FilesTab: fix Delete-LIGHTER + Cancel no-op + alertdialog role + focus rings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three matched fixes for the inline Delete-All and Delete-File confirm banners — same patterns shipped on ConfirmDialog/ApprovalBanner/ DeleteCascade: 1. Delete buttons hovered LIGHTER (bg-red-500 over bg-red-600). On white text drops below AA contrast. Flipped to bg-red-700. 2. Cancel buttons hover was a no-op (bg-surface-card on top of itself). Lift to surface-elevated, matching the Cancel pattern in ConfirmDialog. 3. None of the four buttons had focus-visible rings. Added danger ring on Delete, accent ring on Cancel, with ring-offset-surface so the offset color matches the inline banner backdrop. 4. Wrapped both confirm banners in role="alertdialog" + aria- labelledby pointing to the prompt text — SR users hear the destructive prompt immediately instead of as ambient text. Co-Authored-By: Claude Opus 4.7 (1M context) --- canvas/src/components/tabs/FilesTab.tsx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/canvas/src/components/tabs/FilesTab.tsx b/canvas/src/components/tabs/FilesTab.tsx index 2f3c7381..a3b895b7 100644 --- a/canvas/src/components/tabs/FilesTab.tsx +++ b/canvas/src/components/tabs/FilesTab.tsx @@ -162,25 +162,29 @@ export function FilesTab({ workspaceId }: Props) { /> {showDeleteAll && ( -
-

Delete all {files.filter((f) => !f.dir).length} files? This cannot be undone.

+ // role=alertdialog so SR users hear this destructive prompt + // immediately. Delete-All hovers DARKER (bg-red-700) — same AA + // contrast trap that bit ConfirmDialog/ApprovalBanner. Cancel + // lifts to surface-elevated instead of the prior no-op hover. +
+

Delete all {files.filter((f) => !f.dir).length} files? This cannot be undone.

- - + +
)} {error && ( -
{error}
+
{error}
)} {confirmDelete && ( -
-

Delete {confirmDelete}{files.find((f) => f.path === confirmDelete && f.dir) ? " and all its contents" : ""}?

+
+

Delete {confirmDelete}{files.find((f) => f.path === confirmDelete && f.dir) ? " and all its contents" : ""}?

- - + +
)}