Gallery has no focus management in modals — when the delete confirmation dialog opens, focus doesn't move to the dialog, and on close focus doesn't return to the card that triggered it #241
Labels
No labels
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-attention
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:verify-failed
bug
deferred
feature-request
in-progress
needs-decompose
needs-triage
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/Kimi_Agent_Brother_10_Digitizing_App#241
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding
src/components/gallery/DeleteDialog.tsx(per the snippet I saw) is a shadcn Dialog. The shadcnDialogcomponent (line 4) should handle focus trapping and initial focus. Let me verify.grep -n 'autoFocus\|onOpenAutoFocus' src/components/gallery/DeleteDialog.tsxreturns 0 hits. The shadcn Dialog should auto-focus the first focusable element, but the actual implementation may not.grep -n 'onCloseAutoFocus' src/components/gallery/DeleteDialog.tsxreturns 0 hits. On close, the focus return behavior depends on the shadcn implementation.A screen reader user opens the Gallery:
This is a common accessibility bug with custom modals. Standard behavior:
Where
src/components/gallery/DeleteDialog.tsxNewFolderDialog,RightClickMenu,ExportDialog(workspace)src/components/ui/dialog.tsx(the underlying implementation)Suggested fix shape
Verify the shadcn Dialog's
onOpenAutoFocusandonCloseAutoFocushandlers are set correctly. If they're missing:DeleteDialog.tsx, set the focus on the Cancel button when the dialog opens:shadcn's Dialog (per the Radix UI docs) automatically traps focus inside the dialog. Verify by Tab-ing through the dialog and checking focus doesn't escape.
On close, Radix restores focus to the element that opened the dialog. Verify by Tab-ing and checking focus returns to the Delete button.
The same fix applies to:
NewFolderDialog.tsx(folder create)RenameDialog.tsx(design rename, if exists)SettingsModal.tsx(settings)ExportDialog.tsx(export)RightClickMenu.tsx(context menu)The shadcn Dialog already does most of this; the issue is whether the implementation is correct and whether the wrapping component (DeleteDialog) is overriding any of it.
Severity
Low. Mouse users don't notice. Screen reader users notice.
Discovered by
Gap analysis (2026-10-02) of gallery accessibility.
Related
onContextMenu(per #236) is the parallel concern.Closed by fix(#241): commit
1276fbdon main. Both destructive-action dialogs (DeleteDialog for designs, DeleteFolderDialog for custom folders) now pin initial focus to the safe Cancel button viaonOpenAutoFocus. The Button UI primitive is now wrapped inReact.forwardRefso any consumer can grab a handle for focus management. 10 new tests insrc/components/gallery/issue-241-focus-management.test.tsx; full suite 1244 passing, 1 skipped.