From 1364917adab81b01d30c9cc5325569dc22397635 Mon Sep 17 00:00:00 2001 From: Joel Brock Date: Tue, 9 Jun 2026 13:44:33 -0700 Subject: [PATCH] Form: confirm dialog before submitting check-in Adds a native window.confirm() inside onSubmit, after the uploads-in-flight guard and before the submitting-state flip. Runs only after react-hook-form validation passes, so users who hit Submit on an incomplete form still see the existing field-level errors via onInvalid rather than a confusing "are you sure?" prompt. Cancelling leaves the form state untouched. --- components/EngagementForm.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/EngagementForm.tsx b/components/EngagementForm.tsx index 92515e3..b19e111 100644 --- a/components/EngagementForm.tsx +++ b/components/EngagementForm.tsx @@ -300,6 +300,12 @@ export function EngagementForm({ config, cid, cs }: EngagementFormProps) { }); return; } + const confirmed = window.confirm( + "Submit your check-in?\n\n" + + "Please confirm your responses are complete and ready. " + + "After submitting, you can come back later and submit another check-in with updates.", + ); + if (!confirmed) return; setSubmitState({ kind: "submitting" }); try { // Strip values for hidden fields — never write data the user couldn't see.