From db7ea9fc86f97c3cb5b04e1a05429c31b0c4ed01 Mon Sep 17 00:00:00 2001 From: lorentz Date: Sat, 18 Jul 2026 13:20:48 +0000 Subject: [PATCH] fix(tasks): block Cancel and Escape from closing generate dialog mid-request AlertDialogCancel and Escape both closed the confirmation dialog via Radix's default onOpenChange(false) while the generate-and-assign fetch was still in flight, leaving an orphaned request that could resolve after the user believed they'd cancelled and could leave `generating` stuck true. Disable Cancel and suppress onEscapeKeyDown while `generating` is true so the dialog can only close intentionally once the request settles. --- ondeck/src/app/(dashboard)/tasks/assign/page-client.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ondeck/src/app/(dashboard)/tasks/assign/page-client.tsx b/ondeck/src/app/(dashboard)/tasks/assign/page-client.tsx index 2c065a5..4091e70 100644 --- a/ondeck/src/app/(dashboard)/tasks/assign/page-client.tsx +++ b/ondeck/src/app/(dashboard)/tasks/assign/page-client.tsx @@ -329,7 +329,11 @@ export function BulkAssignClient({ users, clients, designations }: BulkAssignCli { if (!open) setPreview(null) }}> - + { + if (generating) event.preventDefault() + }} + > Generate {preview?.totalEstimatedTasks} task{preview && preview.totalEstimatedTasks !== 1 ? 's' : ''}? @@ -358,7 +362,7 @@ export function BulkAssignClient({ users, clients, designations }: BulkAssignCli - Cancel + Cancel {generating ? 'Generating...' : 'Confirm'}