feat(ux): accessible confirm dialog replaces window.confirm

- new components/ui/confirm.tsx: ConfirmProvider + useConfirm() built
  on the existing Radix alert-dialog (focus trap, ESC, aria for free)
- wired once into the app layout
- all 13 native window.confirm() delete/remove guards now use the
  styled, accessible confirm with a destructive action button
This commit is contained in:
Moheeb Zara
2026-05-15 22:18:15 -07:00
parent 64d7d626db
commit 1db9434930
14 changed files with 132 additions and 13 deletions
+3
View File
@@ -1,6 +1,7 @@
import { createClient } from '@/lib/supabase/server'
import { redirect } from 'next/navigation'
import { AppSidebar } from '@/components/app-sidebar'
import { ConfirmProvider } from '@/components/ui/confirm'
import { getRoleLabelMap } from '@/lib/role-labels'
// This layout is the auth/onboarding gate for the whole app. It must never be
@@ -56,6 +57,7 @@ export default async function AppLayout({ children }: { children: React.ReactNod
const roleName = roleMap[member.role]?.name ?? member.role
return (
<ConfirmProvider>
<div className="flex h-screen bg-background overflow-hidden">
<a
href="#main-content"
@@ -83,5 +85,6 @@ export default async function AppLayout({ children }: { children: React.ReactNod
)}
</main>
</div>
</ConfirmProvider>
)
}