From c9b0acfa06d1a519a207086a17c04651d584b36f Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Sat, 6 Jun 2026 18:35:40 -0400 Subject: [PATCH] feat(badges): two-step confirm before sending email review link Replace the single alert() call with an inline confirmation row per badge. Clicking "Email Link" shows "Send / Cancel" in place so accidental sends are avoided. Only one badge can be in confirm state at a time. Co-Authored-By: Claude Sonnet 4.6 --- .../badges/ae_comp__badge_obj_li.svelte | 50 ++++++++++++++----- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_obj_li.svelte b/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_obj_li.svelte index c4598a57..bb7c5608 100644 --- a/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_obj_li.svelte +++ b/src/routes/events/[event_id]/(badges)/badges/ae_comp__badge_obj_li.svelte @@ -42,6 +42,9 @@ import { // Track per-badge copy state for the "Review Link" clipboard button let copy_status: Record = $state({}); +// Track which badge has a pending email confirmation (null = none pending) +let email_confirm_badge_id: string | null = $state(null); + // Access level shortcuts let is_trusted = $derived($ae_loc.trusted_access === true); let is_admin = $derived($ae_loc.administrator_access === true); @@ -80,8 +83,13 @@ async function copy_review_link(event_badge_obj: any) { } } -// TODO: replace alert with actual email API call when available -function send_review_email(event_badge_obj: any) { +// TODO: replace with actual email API call when available +function confirm_send_review_email(event_badge_obj: any) { + email_confirm_badge_id = event_badge_obj.event_badge_id; +} + +function do_send_review_email(event_badge_obj: any) { + email_confirm_badge_id = null; const name = event_badge_obj?.full_name_override ?? event_badge_obj?.full_name ?? @@ -404,16 +412,34 @@ let visible_badge_obj_li = $derived( {#if is_admin && (is_edit_mode || is_manager)} - + {#if email_confirm_badge_id === event_badge_obj.event_badge_id} + +
+ Send link to {display_name}? + + +
+ {:else} + + {/if} {/if}