Selaa lähdekoodia

Redesign the confirmation dialog with key hints, affected items and a phone sheet (#610)

* Redesign the confirmation dialog with key hints, affected items and a phone sheet

* Ignore composing Enter in type to confirm and name selected rows from other pages
Bernt Christian Egeland 6 päivää sitten
vanhempi
sitoutus
572f4e3e9a
54 muutettua tiedostoa jossa 786 lisäystä ja 42 poistoa
  1. 6 0
      messages/de/common.json
  2. 2 0
      messages/de/settings.json
  3. 6 0
      messages/en/common.json
  4. 2 0
      messages/en/settings.json
  5. 6 0
      messages/es/common.json
  6. 2 0
      messages/es/settings.json
  7. 6 0
      messages/fr/common.json
  8. 2 0
      messages/fr/settings.json
  9. 6 0
      messages/it/common.json
  10. 2 0
      messages/it/settings.json
  11. 6 0
      messages/lt/common.json
  12. 2 0
      messages/lt/settings.json
  13. 6 0
      messages/nb/common.json
  14. 2 0
      messages/nb/settings.json
  15. 6 0
      messages/nl/common.json
  16. 2 0
      messages/nl/settings.json
  17. 6 0
      messages/pl/common.json
  18. 2 0
      messages/pl/settings.json
  19. 6 0
      messages/pt-BR/common.json
  20. 2 0
      messages/pt-BR/settings.json
  21. 6 0
      messages/pt-PT/common.json
  22. 2 0
      messages/pt-PT/settings.json
  23. 6 0
      messages/ru/common.json
  24. 2 0
      messages/ru/settings.json
  25. 6 0
      messages/tr/common.json
  26. 2 0
      messages/tr/settings.json
  27. 23 0
      src/__tests__/app/customers/customers-client-delete.test.tsx
  28. 259 0
      src/__tests__/components/confirm-dialog.test.tsx
  29. 2 0
      src/app/(authenticated)/(dashboard)/dashboard-client.tsx
  30. 19 1
      src/app/(authenticated)/customers/customers-client.tsx
  31. 16 1
      src/app/(authenticated)/inventory/inventory-client.tsx
  32. 1 0
      src/app/(authenticated)/labor-presets/labor-presets-client.tsx
  33. 1 0
      src/app/(authenticated)/settings/email-templates/email-template-gallery.tsx
  34. 1 0
      src/app/(authenticated)/settings/team/team-settings.tsx
  35. 1 0
      src/app/(authenticated)/timesheets/timesheets-client.tsx
  36. 1 0
      src/app/(authenticated)/tire-hotel/[id]/tire-set-client.tsx
  37. 2 0
      src/app/(authenticated)/tire-hotel/storage/storage-client.tsx
  38. 1 0
      src/app/(authenticated)/vehicles/vehicles-client.tsx
  39. 315 35
      src/components/confirm-dialog.tsx
  40. 4 1
      src/features/admin/Components/admin-organizations.tsx
  41. 1 0
      src/features/admin/Components/admin-users.tsx
  42. 7 0
      src/features/calendar/Components/EventContextMenu.tsx
  43. 3 1
      src/features/custom-fields/Components/CustomFieldsManager.tsx
  44. 5 0
      src/features/email/Components/EmailDesigner.tsx
  45. 5 1
      src/features/invoice-designer/Components/InvoiceDesigner.tsx
  46. 2 0
      src/features/quotes/Components/useQuoteFormState.ts
  47. 1 0
      src/features/time-tracking/Components/JobClockSection.tsx
  48. 1 0
      src/features/tire-hotel/Components/TireAttachmentsCard.tsx
  49. 4 0
      src/features/vehicles/Components/service-page/useServiceActions.ts
  50. 2 1
      src/features/workboard/Components/TechnicianDialog.tsx
  51. 2 1
      src/features/workboard/Components/WorkBayDialog.tsx
  52. 1 0
      src/features/workshop-calendar/Components/ClosedDaysCard.tsx
  53. 1 0
      src/features/workshop-calendar/Components/TimeOffDialog.tsx
  54. 1 0
      src/features/workshop-calendar/Components/TimeOffList.tsx

+ 6 - 0
messages/de/common.json

@@ -289,5 +289,11 @@
     "dismiss": "Schließen",
     "dismiss": "Schließen",
     "selectAll": "Alle auswählen",
     "selectAll": "Alle auswählen",
     "selectRow": "{name} auswählen"
     "selectRow": "{name} auswählen"
+  },
+  "confirmDialog": {
+    "title": "Sind Sie sicher?",
+    "irreversible": "Dies kann nicht rückgängig gemacht werden.",
+    "andMore": "und {count} weitere",
+    "typeToConfirm": "Geben Sie <b>{text}</b> zur Bestätigung ein"
   }
   }
 }
 }

+ 2 - 0
messages/de/settings.json

@@ -2511,6 +2511,7 @@
     "leaveTitle": "Ohne Speichern verlassen?",
     "leaveTitle": "Ohne Speichern verlassen?",
     "leaveBody": "Ihre Änderungen an diesem Design wurden nicht gespeichert und gehen verloren.",
     "leaveBody": "Ihre Änderungen an diesem Design wurden nicht gespeichert und gehen verloren.",
     "leaveConfirm": "Verlassen",
     "leaveConfirm": "Verlassen",
+    "leaveCancel": "Weiter bearbeiten",
     "boldField": "Fett",
     "boldField": "Fett",
     "deleteDesignDrafts": "{count, plural, one {# Rechnungsentwurf} other {# Rechnungsentwürfe}} mit diesem Design fallen auf das Standarddesign zurück.",
     "deleteDesignDrafts": "{count, plural, one {# Rechnungsentwurf} other {# Rechnungsentwürfe}} mit diesem Design fallen auf das Standarddesign zurück.",
     "deleteDesignCustomers": "{count, plural, one {# Kunde} other {# Kunden}} mit diesem Design fallen auf das Standarddesign zurück.",
     "deleteDesignCustomers": "{count, plural, one {# Kunde} other {# Kunden}} mit diesem Design fallen auf das Standarddesign zurück.",
@@ -2767,6 +2768,7 @@
     "leaveTitle": "Ohne Speichern verlassen?",
     "leaveTitle": "Ohne Speichern verlassen?",
     "leaveBody": "Ihre Änderungen an dieser Vorlage wurden nicht gespeichert. Sie gehen verloren.",
     "leaveBody": "Ihre Änderungen an dieser Vorlage wurden nicht gespeichert. Sie gehen verloren.",
     "leaveConfirm": "Verlassen",
     "leaveConfirm": "Verlassen",
+    "leaveCancel": "Weiter bearbeiten",
     "subjectAndTheme": "Betreff und Design",
     "subjectAndTheme": "Betreff und Design",
     "settingsSubtitle": "Gilt für die ganze E-Mail",
     "settingsSubtitle": "Gilt für die ganze E-Mail",
     "blocksTitle": "Blöcke",
     "blocksTitle": "Blöcke",

+ 6 - 0
messages/en/common.json

@@ -289,5 +289,11 @@
     "dismiss": "Dismiss",
     "dismiss": "Dismiss",
     "selectAll": "Select all",
     "selectAll": "Select all",
     "selectRow": "Select {name}"
     "selectRow": "Select {name}"
+  },
+  "confirmDialog": {
+    "title": "Are you sure?",
+    "irreversible": "This cannot be undone.",
+    "andMore": "and {count} more",
+    "typeToConfirm": "Type <b>{text}</b> to confirm"
   }
   }
 }
 }

+ 2 - 0
messages/en/settings.json

@@ -2511,6 +2511,7 @@
     "leaveTitle": "Leave without saving?",
     "leaveTitle": "Leave without saving?",
     "leaveBody": "Your changes to this design have not been saved. They will be lost.",
     "leaveBody": "Your changes to this design have not been saved. They will be lost.",
     "leaveConfirm": "Leave",
     "leaveConfirm": "Leave",
+    "leaveCancel": "Keep editing",
     "boldField": "Bold",
     "boldField": "Bold",
     "deleteDesignDrafts": "{count, plural, one {# draft invoice} other {# draft invoices}} using it will go back to the default design.",
     "deleteDesignDrafts": "{count, plural, one {# draft invoice} other {# draft invoices}} using it will go back to the default design.",
     "deleteDesignCustomers": "{count, plural, one {# customer} other {# customers}} set to it will go back to the default design.",
     "deleteDesignCustomers": "{count, plural, one {# customer} other {# customers}} set to it will go back to the default design.",
@@ -2767,6 +2768,7 @@
     "leaveTitle": "Leave without saving?",
     "leaveTitle": "Leave without saving?",
     "leaveBody": "Your changes to this template have not been saved. They will be lost.",
     "leaveBody": "Your changes to this template have not been saved. They will be lost.",
     "leaveConfirm": "Leave",
     "leaveConfirm": "Leave",
+    "leaveCancel": "Keep editing",
     "subjectAndTheme": "Subject and theme",
     "subjectAndTheme": "Subject and theme",
     "settingsSubtitle": "Applies to the whole email",
     "settingsSubtitle": "Applies to the whole email",
     "blocksTitle": "Blocks",
     "blocksTitle": "Blocks",

+ 6 - 0
messages/es/common.json

@@ -289,5 +289,11 @@
     "dismiss": "Cerrar",
     "dismiss": "Cerrar",
     "selectAll": "Seleccionar todo",
     "selectAll": "Seleccionar todo",
     "selectRow": "Seleccionar {name}"
     "selectRow": "Seleccionar {name}"
+  },
+  "confirmDialog": {
+    "title": "¿Está seguro?",
+    "irreversible": "Esta acción no se puede deshacer.",
+    "andMore": "y {count} más",
+    "typeToConfirm": "Escriba <b>{text}</b> para confirmar"
   }
   }
 }
 }

+ 2 - 0
messages/es/settings.json

@@ -2511,6 +2511,7 @@
     "leaveTitle": "¿Salir sin guardar?",
     "leaveTitle": "¿Salir sin guardar?",
     "leaveBody": "Los cambios de este diseño no se han guardado y se perderán.",
     "leaveBody": "Los cambios de este diseño no se han guardado y se perderán.",
     "leaveConfirm": "Salir",
     "leaveConfirm": "Salir",
+    "leaveCancel": "Seguir editando",
     "boldField": "Negrita",
     "boldField": "Negrita",
     "deleteDesignDrafts": "{count, plural, one {# borrador de factura} other {# borradores de factura}} que lo usan volverán al diseño predeterminado.",
     "deleteDesignDrafts": "{count, plural, one {# borrador de factura} other {# borradores de factura}} que lo usan volverán al diseño predeterminado.",
     "deleteDesignCustomers": "{count, plural, one {# cliente} other {# clientes}} asignados a él volverán al diseño predeterminado.",
     "deleteDesignCustomers": "{count, plural, one {# cliente} other {# clientes}} asignados a él volverán al diseño predeterminado.",
@@ -2767,6 +2768,7 @@
     "leaveTitle": "¿Salir sin guardar?",
     "leaveTitle": "¿Salir sin guardar?",
     "leaveBody": "Los cambios en esta plantilla no se han guardado. Se perderán.",
     "leaveBody": "Los cambios en esta plantilla no se han guardado. Se perderán.",
     "leaveConfirm": "Salir",
     "leaveConfirm": "Salir",
+    "leaveCancel": "Seguir editando",
     "subjectAndTheme": "Asunto y tema",
     "subjectAndTheme": "Asunto y tema",
     "settingsSubtitle": "Se aplica a todo el correo",
     "settingsSubtitle": "Se aplica a todo el correo",
     "blocksTitle": "Bloques",
     "blocksTitle": "Bloques",

+ 6 - 0
messages/fr/common.json

@@ -289,5 +289,11 @@
     "dismiss": "Fermer",
     "dismiss": "Fermer",
     "selectAll": "Tout sélectionner",
     "selectAll": "Tout sélectionner",
     "selectRow": "Sélectionner {name}"
     "selectRow": "Sélectionner {name}"
+  },
+  "confirmDialog": {
+    "title": "Êtes-vous sûr ?",
+    "irreversible": "Cette action est irréversible.",
+    "andMore": "et {count} de plus",
+    "typeToConfirm": "Saisissez <b>{text}</b> pour confirmer"
   }
   }
 }
 }

+ 2 - 0
messages/fr/settings.json

@@ -2511,6 +2511,7 @@
     "leaveTitle": "Quitter sans enregistrer ?",
     "leaveTitle": "Quitter sans enregistrer ?",
     "leaveBody": "Les modifications de cette maquette ne sont pas enregistrées et seront perdues.",
     "leaveBody": "Les modifications de cette maquette ne sont pas enregistrées et seront perdues.",
     "leaveConfirm": "Quitter",
     "leaveConfirm": "Quitter",
+    "leaveCancel": "Continuer à modifier",
     "boldField": "Gras",
     "boldField": "Gras",
     "deleteDesignDrafts": "{count, plural, one {# brouillon de facture} other {# brouillons de facture}} qui l'utilisent reviendront au design par défaut.",
     "deleteDesignDrafts": "{count, plural, one {# brouillon de facture} other {# brouillons de facture}} qui l'utilisent reviendront au design par défaut.",
     "deleteDesignCustomers": "{count, plural, one {# client} other {# clients}} qui y sont associés reviendront au design par défaut.",
     "deleteDesignCustomers": "{count, plural, one {# client} other {# clients}} qui y sont associés reviendront au design par défaut.",
@@ -2767,6 +2768,7 @@
     "leaveTitle": "Quitter sans enregistrer ?",
     "leaveTitle": "Quitter sans enregistrer ?",
     "leaveBody": "Vos modifications de ce modèle n'ont pas été enregistrées. Elles seront perdues.",
     "leaveBody": "Vos modifications de ce modèle n'ont pas été enregistrées. Elles seront perdues.",
     "leaveConfirm": "Quitter",
     "leaveConfirm": "Quitter",
+    "leaveCancel": "Continuer à modifier",
     "subjectAndTheme": "Objet et thème",
     "subjectAndTheme": "Objet et thème",
     "settingsSubtitle": "S'applique à tout l'e-mail",
     "settingsSubtitle": "S'applique à tout l'e-mail",
     "blocksTitle": "Blocs",
     "blocksTitle": "Blocs",

+ 6 - 0
messages/it/common.json

@@ -289,5 +289,11 @@
     "dismiss": "Chiudi",
     "dismiss": "Chiudi",
     "selectAll": "Seleziona tutto",
     "selectAll": "Seleziona tutto",
     "selectRow": "Seleziona {name}"
     "selectRow": "Seleziona {name}"
+  },
+  "confirmDialog": {
+    "title": "Sei sicuro?",
+    "irreversible": "Questa azione non può essere annullata.",
+    "andMore": "e altri {count}",
+    "typeToConfirm": "Digita <b>{text}</b> per confermare"
   }
   }
 }
 }

+ 2 - 0
messages/it/settings.json

@@ -2511,6 +2511,7 @@
     "leaveTitle": "Uscire senza salvare?",
     "leaveTitle": "Uscire senza salvare?",
     "leaveBody": "Le modifiche a questo design non sono state salvate e andranno perse.",
     "leaveBody": "Le modifiche a questo design non sono state salvate e andranno perse.",
     "leaveConfirm": "Esci",
     "leaveConfirm": "Esci",
+    "leaveCancel": "Continua a modificare",
     "boldField": "Grassetto",
     "boldField": "Grassetto",
     "deleteDesignDrafts": "{count, plural, one {# bozza di fattura} other {# bozze di fattura}} che lo usano torneranno al design predefinito.",
     "deleteDesignDrafts": "{count, plural, one {# bozza di fattura} other {# bozze di fattura}} che lo usano torneranno al design predefinito.",
     "deleteDesignCustomers": "{count, plural, one {# cliente} other {# clienti}} impostati su di esso torneranno al design predefinito.",
     "deleteDesignCustomers": "{count, plural, one {# cliente} other {# clienti}} impostati su di esso torneranno al design predefinito.",
@@ -2767,6 +2768,7 @@
     "leaveTitle": "Uscire senza salvare?",
     "leaveTitle": "Uscire senza salvare?",
     "leaveBody": "Le modifiche a questo modello non sono state salvate. Andranno perse.",
     "leaveBody": "Le modifiche a questo modello non sono state salvate. Andranno perse.",
     "leaveConfirm": "Esci",
     "leaveConfirm": "Esci",
+    "leaveCancel": "Continua a modificare",
     "subjectAndTheme": "Oggetto e tema",
     "subjectAndTheme": "Oggetto e tema",
     "settingsSubtitle": "Vale per l'intera email",
     "settingsSubtitle": "Vale per l'intera email",
     "blocksTitle": "Blocchi",
     "blocksTitle": "Blocchi",

+ 6 - 0
messages/lt/common.json

@@ -289,5 +289,11 @@
     "dismiss": "Uždaryti",
     "dismiss": "Uždaryti",
     "selectAll": "Pasirinkti visus",
     "selectAll": "Pasirinkti visus",
     "selectRow": "Pasirinkti: {name}"
     "selectRow": "Pasirinkti: {name}"
+  },
+  "confirmDialog": {
+    "title": "Ar tikrai?",
+    "irreversible": "Šio veiksmo negalima atšaukti.",
+    "andMore": "ir dar {count}",
+    "typeToConfirm": "Įveskite <b>{text}</b>, kad patvirtintumėte"
   }
   }
 }
 }

+ 2 - 0
messages/lt/settings.json

@@ -2511,6 +2511,7 @@
     "leaveTitle": "Išeiti neišsaugojus?",
     "leaveTitle": "Išeiti neišsaugojus?",
     "leaveBody": "Šio dizaino pakeitimai neišsaugoti ir bus prarasti.",
     "leaveBody": "Šio dizaino pakeitimai neišsaugoti ir bus prarasti.",
     "leaveConfirm": "Išeiti",
     "leaveConfirm": "Išeiti",
+    "leaveCancel": "Toliau redaguoti",
     "boldField": "Paryškinta",
     "boldField": "Paryškinta",
     "deleteDesignDrafts": "{count, plural, one {# sąskaitos juodraštis} few {# sąskaitų juodraščiai} other {# sąskaitų juodraščių}}, kurie jį naudoja, grįš prie numatytojo dizaino.",
     "deleteDesignDrafts": "{count, plural, one {# sąskaitos juodraštis} few {# sąskaitų juodraščiai} other {# sąskaitų juodraščių}}, kurie jį naudoja, grįš prie numatytojo dizaino.",
     "deleteDesignCustomers": "{count, plural, one {# klientas} few {# klientai} other {# klientų}}, kuriems jis priskirtas, grįš prie numatytojo dizaino.",
     "deleteDesignCustomers": "{count, plural, one {# klientas} few {# klientai} other {# klientų}}, kuriems jis priskirtas, grįš prie numatytojo dizaino.",
@@ -2767,6 +2768,7 @@
     "leaveTitle": "Išeiti neišsaugojus?",
     "leaveTitle": "Išeiti neišsaugojus?",
     "leaveBody": "Jūsų šio šablono pakeitimai neišsaugoti. Jie bus prarasti.",
     "leaveBody": "Jūsų šio šablono pakeitimai neišsaugoti. Jie bus prarasti.",
     "leaveConfirm": "Išeiti",
     "leaveConfirm": "Išeiti",
+    "leaveCancel": "Toliau redaguoti",
     "subjectAndTheme": "Tema ir dizainas",
     "subjectAndTheme": "Tema ir dizainas",
     "settingsSubtitle": "Taikoma visam laiškui",
     "settingsSubtitle": "Taikoma visam laiškui",
     "blocksTitle": "Blokai",
     "blocksTitle": "Blokai",

+ 6 - 0
messages/nb/common.json

@@ -289,5 +289,11 @@
     "dismiss": "Lukk",
     "dismiss": "Lukk",
     "selectAll": "Velg alle",
     "selectAll": "Velg alle",
     "selectRow": "Velg {name}"
     "selectRow": "Velg {name}"
+  },
+  "confirmDialog": {
+    "title": "Er du sikker?",
+    "irreversible": "Dette kan ikke angres.",
+    "andMore": "og {count} til",
+    "typeToConfirm": "Skriv <b>{text}</b> for å bekrefte"
   }
   }
 }
 }

+ 2 - 0
messages/nb/settings.json

@@ -2511,6 +2511,7 @@
     "leaveTitle": "Forlate uten å lagre?",
     "leaveTitle": "Forlate uten å lagre?",
     "leaveBody": "Endringene i dette designet er ikke lagret. De går tapt.",
     "leaveBody": "Endringene i dette designet er ikke lagret. De går tapt.",
     "leaveConfirm": "Forlat",
     "leaveConfirm": "Forlat",
+    "leaveCancel": "Fortsett å redigere",
     "boldField": "Fet",
     "boldField": "Fet",
     "deleteDesignDrafts": "{count, plural, one {# fakturautkast} other {# fakturautkast}} som bruker det, går tilbake til standarddesignet.",
     "deleteDesignDrafts": "{count, plural, one {# fakturautkast} other {# fakturautkast}} som bruker det, går tilbake til standarddesignet.",
     "deleteDesignCustomers": "{count, plural, one {# kunde} other {# kunder}} som er satt til det, går tilbake til standarddesignet.",
     "deleteDesignCustomers": "{count, plural, one {# kunde} other {# kunder}} som er satt til det, går tilbake til standarddesignet.",
@@ -2767,6 +2768,7 @@
     "leaveTitle": "Forlate uten å lagre?",
     "leaveTitle": "Forlate uten å lagre?",
     "leaveBody": "Endringene dine i denne malen er ikke lagret. De går tapt.",
     "leaveBody": "Endringene dine i denne malen er ikke lagret. De går tapt.",
     "leaveConfirm": "Forlat",
     "leaveConfirm": "Forlat",
+    "leaveCancel": "Fortsett å redigere",
     "subjectAndTheme": "Emne og tema",
     "subjectAndTheme": "Emne og tema",
     "settingsSubtitle": "Gjelder hele e-posten",
     "settingsSubtitle": "Gjelder hele e-posten",
     "blocksTitle": "Blokker",
     "blocksTitle": "Blokker",

+ 6 - 0
messages/nl/common.json

@@ -289,5 +289,11 @@
     "dismiss": "Sluiten",
     "dismiss": "Sluiten",
     "selectAll": "Alles selecteren",
     "selectAll": "Alles selecteren",
     "selectRow": "{name} selecteren"
     "selectRow": "{name} selecteren"
+  },
+  "confirmDialog": {
+    "title": "Weet u het zeker?",
+    "irreversible": "Dit kan niet ongedaan worden gemaakt.",
+    "andMore": "en {count} meer",
+    "typeToConfirm": "Typ <b>{text}</b> om te bevestigen"
   }
   }
 }
 }

+ 2 - 0
messages/nl/settings.json

@@ -2511,6 +2511,7 @@
     "leaveTitle": "Weggaan zonder opslaan?",
     "leaveTitle": "Weggaan zonder opslaan?",
     "leaveBody": "Je wijzigingen aan dit ontwerp zijn niet opgeslagen en gaan verloren.",
     "leaveBody": "Je wijzigingen aan dit ontwerp zijn niet opgeslagen en gaan verloren.",
     "leaveConfirm": "Weggaan",
     "leaveConfirm": "Weggaan",
+    "leaveCancel": "Verder bewerken",
     "boldField": "Vet",
     "boldField": "Vet",
     "deleteDesignDrafts": "{count, plural, one {# conceptfactuur} other {# conceptfacturen}} die het gebruiken, vallen terug op het standaardontwerp.",
     "deleteDesignDrafts": "{count, plural, one {# conceptfactuur} other {# conceptfacturen}} die het gebruiken, vallen terug op het standaardontwerp.",
     "deleteDesignCustomers": "{count, plural, one {# klant} other {# klanten}} die erop zijn ingesteld, vallen terug op het standaardontwerp.",
     "deleteDesignCustomers": "{count, plural, one {# klant} other {# klanten}} die erop zijn ingesteld, vallen terug op het standaardontwerp.",
@@ -2767,6 +2768,7 @@
     "leaveTitle": "Verlaten zonder op te slaan?",
     "leaveTitle": "Verlaten zonder op te slaan?",
     "leaveBody": "Uw wijzigingen aan dit sjabloon zijn niet opgeslagen. Ze gaan verloren.",
     "leaveBody": "Uw wijzigingen aan dit sjabloon zijn niet opgeslagen. Ze gaan verloren.",
     "leaveConfirm": "Verlaten",
     "leaveConfirm": "Verlaten",
+    "leaveCancel": "Verder bewerken",
     "subjectAndTheme": "Onderwerp en thema",
     "subjectAndTheme": "Onderwerp en thema",
     "settingsSubtitle": "Geldt voor de hele e-mail",
     "settingsSubtitle": "Geldt voor de hele e-mail",
     "blocksTitle": "Blokken",
     "blocksTitle": "Blokken",

+ 6 - 0
messages/pl/common.json

@@ -289,5 +289,11 @@
     "dismiss": "Zamknij",
     "dismiss": "Zamknij",
     "selectAll": "Zaznacz wszystko",
     "selectAll": "Zaznacz wszystko",
     "selectRow": "Zaznacz: {name}"
     "selectRow": "Zaznacz: {name}"
+  },
+  "confirmDialog": {
+    "title": "Czy na pewno?",
+    "irreversible": "Tej operacji nie można cofnąć.",
+    "andMore": "i jeszcze {count}",
+    "typeToConfirm": "Wpisz <b>{text}</b>, aby potwierdzić"
   }
   }
 }
 }

+ 2 - 0
messages/pl/settings.json

@@ -2511,6 +2511,7 @@
     "leaveTitle": "Wyjść bez zapisywania?",
     "leaveTitle": "Wyjść bez zapisywania?",
     "leaveBody": "Zmiany w tym projekcie nie zostały zapisane i zostaną utracone.",
     "leaveBody": "Zmiany w tym projekcie nie zostały zapisane i zostaną utracone.",
     "leaveConfirm": "Wyjdź",
     "leaveConfirm": "Wyjdź",
+    "leaveCancel": "Kontynuuj edycję",
     "boldField": "Pogrubienie",
     "boldField": "Pogrubienie",
     "deleteDesignDrafts": "{count, plural, one {# szkic faktury} few {# szkice faktur} many {# szkiców faktur} other {# szkicu faktury}} z tym projektem wróci do projektu domyślnego.",
     "deleteDesignDrafts": "{count, plural, one {# szkic faktury} few {# szkice faktur} many {# szkiców faktur} other {# szkicu faktury}} z tym projektem wróci do projektu domyślnego.",
     "deleteDesignCustomers": "{count, plural, one {# klient} few {# klientów} many {# klientów} other {# klienta}} z tym projektem wróci do projektu domyślnego.",
     "deleteDesignCustomers": "{count, plural, one {# klient} few {# klientów} many {# klientów} other {# klienta}} z tym projektem wróci do projektu domyślnego.",
@@ -2767,6 +2768,7 @@
     "leaveTitle": "Wyjść bez zapisywania?",
     "leaveTitle": "Wyjść bez zapisywania?",
     "leaveBody": "Twoje zmiany w tym szablonie nie zostały zapisane. Zostaną utracone.",
     "leaveBody": "Twoje zmiany w tym szablonie nie zostały zapisane. Zostaną utracone.",
     "leaveConfirm": "Wyjdź",
     "leaveConfirm": "Wyjdź",
+    "leaveCancel": "Kontynuuj edycję",
     "subjectAndTheme": "Temat i motyw",
     "subjectAndTheme": "Temat i motyw",
     "settingsSubtitle": "Dotyczy całego e-maila",
     "settingsSubtitle": "Dotyczy całego e-maila",
     "blocksTitle": "Bloki",
     "blocksTitle": "Bloki",

+ 6 - 0
messages/pt-BR/common.json

@@ -289,5 +289,11 @@
     "dismiss": "Fechar",
     "dismiss": "Fechar",
     "selectAll": "Selecionar tudo",
     "selectAll": "Selecionar tudo",
     "selectRow": "Selecionar {name}"
     "selectRow": "Selecionar {name}"
+  },
+  "confirmDialog": {
+    "title": "Tem certeza?",
+    "irreversible": "Esta ação não pode ser desfeita.",
+    "andMore": "e mais {count}",
+    "typeToConfirm": "Digite <b>{text}</b> para confirmar"
   }
   }
 }
 }

+ 2 - 0
messages/pt-BR/settings.json

@@ -2511,6 +2511,7 @@
     "leaveTitle": "Sair sem salvar?",
     "leaveTitle": "Sair sem salvar?",
     "leaveBody": "Suas alterações neste design não foram salvas e serão perdidas.",
     "leaveBody": "Suas alterações neste design não foram salvas e serão perdidas.",
     "leaveConfirm": "Sair",
     "leaveConfirm": "Sair",
+    "leaveCancel": "Continuar editando",
     "boldField": "Negrito",
     "boldField": "Negrito",
     "deleteDesignDrafts": "{count, plural, one {# rascunho de fatura} other {# rascunhos de fatura}} que o usam voltarão ao design padrão.",
     "deleteDesignDrafts": "{count, plural, one {# rascunho de fatura} other {# rascunhos de fatura}} que o usam voltarão ao design padrão.",
     "deleteDesignCustomers": "{count, plural, one {# cliente} other {# clientes}} definidos com ele voltarão ao design padrão.",
     "deleteDesignCustomers": "{count, plural, one {# cliente} other {# clientes}} definidos com ele voltarão ao design padrão.",
@@ -2767,6 +2768,7 @@
     "leaveTitle": "Sair sem salvar?",
     "leaveTitle": "Sair sem salvar?",
     "leaveBody": "Suas alterações neste modelo não foram salvas. Elas serão perdidas.",
     "leaveBody": "Suas alterações neste modelo não foram salvas. Elas serão perdidas.",
     "leaveConfirm": "Sair",
     "leaveConfirm": "Sair",
+    "leaveCancel": "Continuar editando",
     "subjectAndTheme": "Assunto e tema",
     "subjectAndTheme": "Assunto e tema",
     "settingsSubtitle": "Vale para o e-mail inteiro",
     "settingsSubtitle": "Vale para o e-mail inteiro",
     "blocksTitle": "Blocos",
     "blocksTitle": "Blocos",

+ 6 - 0
messages/pt-PT/common.json

@@ -289,5 +289,11 @@
     "dismiss": "Fechar",
     "dismiss": "Fechar",
     "selectAll": "Selecionar tudo",
     "selectAll": "Selecionar tudo",
     "selectRow": "Selecionar {name}"
     "selectRow": "Selecionar {name}"
+  },
+  "confirmDialog": {
+    "title": "Tem a certeza?",
+    "irreversible": "Esta ação não pode ser anulada.",
+    "andMore": "e mais {count}",
+    "typeToConfirm": "Escreva <b>{text}</b> para confirmar"
   }
   }
 }
 }

+ 2 - 0
messages/pt-PT/settings.json

@@ -2511,6 +2511,7 @@
     "leaveTitle": "Sair sem guardar?",
     "leaveTitle": "Sair sem guardar?",
     "leaveBody": "As alterações a este design não foram guardadas e serão perdidas.",
     "leaveBody": "As alterações a este design não foram guardadas e serão perdidas.",
     "leaveConfirm": "Sair",
     "leaveConfirm": "Sair",
+    "leaveCancel": "Continuar a editar",
     "boldField": "Negrito",
     "boldField": "Negrito",
     "deleteDesignDrafts": "{count, plural, one {# rascunho de fatura} other {# rascunhos de fatura}} que o usam voltarão ao design predefinido.",
     "deleteDesignDrafts": "{count, plural, one {# rascunho de fatura} other {# rascunhos de fatura}} que o usam voltarão ao design predefinido.",
     "deleteDesignCustomers": "{count, plural, one {# cliente associado} other {# clientes associados}} a este design voltarão ao design predefinido.",
     "deleteDesignCustomers": "{count, plural, one {# cliente associado} other {# clientes associados}} a este design voltarão ao design predefinido.",
@@ -2767,6 +2768,7 @@
     "leaveTitle": "Sair sem guardar?",
     "leaveTitle": "Sair sem guardar?",
     "leaveBody": "As alterações a este modelo não foram guardadas e serão perdidas.",
     "leaveBody": "As alterações a este modelo não foram guardadas e serão perdidas.",
     "leaveConfirm": "Sair",
     "leaveConfirm": "Sair",
+    "leaveCancel": "Continuar a editar",
     "subjectAndTheme": "Assunto e tema",
     "subjectAndTheme": "Assunto e tema",
     "settingsSubtitle": "Aplica-se ao e-mail inteiro",
     "settingsSubtitle": "Aplica-se ao e-mail inteiro",
     "blocksTitle": "Blocos",
     "blocksTitle": "Blocos",

+ 6 - 0
messages/ru/common.json

@@ -289,5 +289,11 @@
     "dismiss": "Закрыть",
     "dismiss": "Закрыть",
     "selectAll": "Выбрать все",
     "selectAll": "Выбрать все",
     "selectRow": "Выбрать: {name}"
     "selectRow": "Выбрать: {name}"
+  },
+  "confirmDialog": {
+    "title": "Вы уверены?",
+    "irreversible": "Это действие необратимо.",
+    "andMore": "и ещё {count}",
+    "typeToConfirm": "Введите <b>{text}</b> для подтверждения"
   }
   }
 }
 }

+ 2 - 0
messages/ru/settings.json

@@ -2511,6 +2511,7 @@
     "leaveTitle": "Выйти без сохранения?",
     "leaveTitle": "Выйти без сохранения?",
     "leaveBody": "Изменения в этом оформлении не сохранены и будут потеряны.",
     "leaveBody": "Изменения в этом оформлении не сохранены и будут потеряны.",
     "leaveConfirm": "Выйти",
     "leaveConfirm": "Выйти",
+    "leaveCancel": "Продолжить редактирование",
     "boldField": "Жирный",
     "boldField": "Жирный",
     "deleteDesignDrafts": "{count, plural, one {# черновик счёта} few {# черновика счетов} many {# черновиков счетов} other {# черновика счетов}} с этим дизайном вернутся к дизайну по умолчанию.",
     "deleteDesignDrafts": "{count, plural, one {# черновик счёта} few {# черновика счетов} many {# черновиков счетов} other {# черновика счетов}} с этим дизайном вернутся к дизайну по умолчанию.",
     "deleteDesignCustomers": "{count, plural, one {# клиент} few {# клиента} many {# клиентов} other {# клиента}} с этим дизайном вернутся к дизайну по умолчанию.",
     "deleteDesignCustomers": "{count, plural, one {# клиент} few {# клиента} many {# клиентов} other {# клиента}} с этим дизайном вернутся к дизайну по умолчанию.",
@@ -2767,6 +2768,7 @@
     "leaveTitle": "Выйти без сохранения?",
     "leaveTitle": "Выйти без сохранения?",
     "leaveBody": "Ваши изменения в этом шаблоне не сохранены. Они будут потеряны.",
     "leaveBody": "Ваши изменения в этом шаблоне не сохранены. Они будут потеряны.",
     "leaveConfirm": "Выйти",
     "leaveConfirm": "Выйти",
+    "leaveCancel": "Продолжить редактирование",
     "subjectAndTheme": "Тема и оформление",
     "subjectAndTheme": "Тема и оформление",
     "settingsSubtitle": "Применяется ко всему письму",
     "settingsSubtitle": "Применяется ко всему письму",
     "blocksTitle": "Блоки",
     "blocksTitle": "Блоки",

+ 6 - 0
messages/tr/common.json

@@ -289,5 +289,11 @@
     "dismiss": "Kapat",
     "dismiss": "Kapat",
     "selectAll": "Tümünü seç",
     "selectAll": "Tümünü seç",
     "selectRow": "{name} seç"
     "selectRow": "{name} seç"
+  },
+  "confirmDialog": {
+    "title": "Emin misiniz?",
+    "irreversible": "Bu işlem geri alınamaz.",
+    "andMore": "ve {count} tane daha",
+    "typeToConfirm": "Onaylamak için <b>{text}</b> yazın"
   }
   }
 }
 }

+ 2 - 0
messages/tr/settings.json

@@ -2511,6 +2511,7 @@
     "leaveTitle": "Kaydetmeden çıkılsın mı?",
     "leaveTitle": "Kaydetmeden çıkılsın mı?",
     "leaveBody": "Bu tasarımdaki değişiklikler kaydedilmedi ve kaybolacak.",
     "leaveBody": "Bu tasarımdaki değişiklikler kaydedilmedi ve kaybolacak.",
     "leaveConfirm": "Çık",
     "leaveConfirm": "Çık",
+    "leaveCancel": "Düzenlemeye devam et",
     "boldField": "Kalın",
     "boldField": "Kalın",
     "deleteDesignDrafts": "Bunu kullanan {count, plural, one {# taslak fatura} other {# taslak fatura}} varsayılan tasarıma döner.",
     "deleteDesignDrafts": "Bunu kullanan {count, plural, one {# taslak fatura} other {# taslak fatura}} varsayılan tasarıma döner.",
     "deleteDesignCustomers": "Buna ayarlı {count, plural, one {# müşteri} other {# müşteri}} varsayılan tasarıma döner.",
     "deleteDesignCustomers": "Buna ayarlı {count, plural, one {# müşteri} other {# müşteri}} varsayılan tasarıma döner.",
@@ -2767,6 +2768,7 @@
     "leaveTitle": "Kaydetmeden çıkılsın mı?",
     "leaveTitle": "Kaydetmeden çıkılsın mı?",
     "leaveBody": "Bu şablondaki değişiklikleriniz kaydedilmedi. Kaybolacaklar.",
     "leaveBody": "Bu şablondaki değişiklikleriniz kaydedilmedi. Kaybolacaklar.",
     "leaveConfirm": "Çık",
     "leaveConfirm": "Çık",
+    "leaveCancel": "Düzenlemeye devam et",
     "subjectAndTheme": "Konu ve tema",
     "subjectAndTheme": "Konu ve tema",
     "settingsSubtitle": "Tüm e-posta için geçerlidir",
     "settingsSubtitle": "Tüm e-posta için geçerlidir",
     "blocksTitle": "Bloklar",
     "blocksTitle": "Bloklar",

+ 23 - 0
src/__tests__/app/customers/customers-client-delete.test.tsx

@@ -102,4 +102,27 @@ describe('customer list deletes', () => {
     // there to try again once the message is closed.
     // there to try again once the message is closed.
     expect(screen.getByRole('button', { name: 'Delete (1)', hidden: true })).toBeEnabled()
     expect(screen.getByRole('button', { name: 'Delete (1)', hidden: true })).toBeEnabled()
   })
   })
+
+  it('still names a selected customer in the question after moving to another page', async () => {
+    const page = (customers: (typeof CUSTOMER)[], n: number) => (
+      <ConfirmProvider>
+        <CustomersClient
+          data={{ customers, total: 21, page: n, pageSize: 20, totalPages: 2 }}
+          search=""
+          sortBy="name"
+          sortOrder="asc"
+        />
+      </ConfirmProvider>
+    )
+    const { rerender } = render(page([CUSTOMER], 1))
+    fireEvent.click(screen.getAllByRole('checkbox')[0])
+
+    // Page two: Ada is no longer among the rows, but is still selected.
+    rerender(page([{ ...CUSTOMER, id: 'c2', customerNumber: '1002', name: 'Bo Lind' }], 2))
+    fireEvent.click(screen.getByRole('button', { name: 'Delete (1)' }))
+
+    const question = await screen.findByRole('alertdialog')
+    expect(within(question).getByText('Ada Berg')).toBeInTheDocument()
+    expect(within(question).queryByText('Bo Lind')).not.toBeInTheDocument()
+  })
 })
 })

+ 259 - 0
src/__tests__/components/confirm-dialog.test.tsx

@@ -0,0 +1,259 @@
+import { createEvent, fireEvent, render, screen, waitFor, within } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+import { Building2 } from 'lucide-react'
+import { describe, expect, it, vi } from 'vitest'
+import { type ConfirmOptions, ConfirmProvider, useConfirm } from '@/components/confirm-dialog'
+
+/**
+ * The shared confirmation dialog, as someone at a keyboard or on a phone
+ * meets it: which button has focus, what Escape and Enter do, and that the
+ * key drawn on a button is the key that presses it.
+ */
+
+function Asker({ options, onAnswer }: { options: ConfirmOptions; onAnswer: (v: boolean) => void }) {
+  const confirm = useConfirm()
+  return (
+    <button type="button" onClick={async () => onAnswer(await confirm(options))}>
+      Ask
+    </button>
+  )
+}
+
+async function ask(options: ConfirmOptions) {
+  const onAnswer = vi.fn()
+  const user = userEvent.setup({ pointerEventsCheck: 0 })
+  render(
+    <ConfirmProvider>
+      <Asker options={options} onAnswer={onAnswer} />
+    </ConfirmProvider>
+  )
+  await user.click(screen.getByRole('button', { name: 'Ask' }))
+  const dialog = await screen.findByRole('alertdialog')
+  return { user, onAnswer, dialog }
+}
+
+const removeLinks: ConfirmOptions = {
+  title: 'Remove 5 links?',
+  description: 'Customers who open these links will see that they are no longer available.',
+  confirmLabel: 'Remove 5 links',
+  destructive: true,
+}
+
+const sendInvoice: ConfirmOptions = {
+  title: 'Send invoice to customer?',
+  description: 'Invoice 2026-0412 goes to Maria Jensen.',
+  confirmLabel: 'Send invoice',
+}
+
+describe('confirm dialog: destructive', () => {
+  it('opens with focus on Cancel, so Enter does not delete by accident', async () => {
+    const { user, onAnswer, dialog } = await ask(removeLinks)
+
+    expect(within(dialog).getByRole('button', { name: 'Cancel' })).toHaveFocus()
+
+    await user.keyboard('{Enter}')
+    await waitFor(() => expect(onAnswer).toHaveBeenCalledWith(false))
+    expect(onAnswer).toHaveBeenCalledTimes(1)
+  })
+
+  it('shows Esc on Cancel and no Enter hint on the red button', async () => {
+    const { dialog } = await ask(removeLinks)
+
+    const cancel = within(dialog).getByRole('button', { name: 'Cancel' })
+    const remove = within(dialog).getByRole('button', { name: 'Remove 5 links' })
+    expect(cancel).toHaveTextContent('Esc')
+    expect(remove).not.toHaveTextContent('↵')
+  })
+
+  it('removes once the red button is reached and pressed', async () => {
+    const { user, onAnswer, dialog } = await ask(removeLinks)
+
+    await user.tab()
+    expect(within(dialog).getByRole('button', { name: 'Remove 5 links' })).toHaveFocus()
+    await user.keyboard('{Enter}')
+    await waitFor(() => expect(onAnswer).toHaveBeenCalledWith(true))
+  })
+})
+
+describe('confirm dialog: neutral', () => {
+  it('opens with focus on the action, shows the Enter hint there, and Enter confirms', async () => {
+    const { user, onAnswer, dialog } = await ask(sendInvoice)
+
+    const send = within(dialog).getByRole('button', { name: 'Send invoice' })
+    expect(send).toHaveFocus()
+    expect(send).toHaveTextContent('↵')
+
+    await user.keyboard('{Enter}')
+    await waitFor(() => expect(onAnswer).toHaveBeenCalledWith(true))
+  })
+
+  it('keeps focus on the safe choice when the caller asks for it, with no Enter hint on the action', async () => {
+    const { user, onAnswer, dialog } = await ask({
+      title: 'Leave without saving?',
+      description: 'Your changes have not been saved.',
+      confirmLabel: 'Leave',
+      cancelLabel: 'Keep editing',
+      defaultFocus: 'cancel',
+    })
+
+    expect(within(dialog).getByRole('button', { name: 'Keep editing' })).toHaveFocus()
+    expect(within(dialog).getByRole('button', { name: 'Leave' })).not.toHaveTextContent('↵')
+
+    await user.keyboard('{Enter}')
+    await waitFor(() => expect(onAnswer).toHaveBeenCalledWith(false))
+  })
+})
+
+describe('confirm dialog: closing without deciding', () => {
+  it('cancels on Escape', async () => {
+    const { user, onAnswer } = await ask(sendInvoice)
+
+    await user.keyboard('{Escape}')
+    await waitFor(() => expect(onAnswer).toHaveBeenCalledWith(false))
+    await waitFor(() => expect(screen.queryByRole('alertdialog')).not.toBeInTheDocument())
+  })
+
+  it('cancels on a tap outside', async () => {
+    const { user, onAnswer } = await ask(removeLinks)
+
+    const backdrop = document.querySelector('[data-slot="alert-dialog-overlay"]')
+    expect(backdrop).not.toBeNull()
+    await user.click(backdrop as Element)
+    await waitFor(() => expect(onAnswer).toHaveBeenCalledWith(false))
+  })
+})
+
+describe('confirm dialog: what is announced', () => {
+  it('falls back to translated labels when the caller passes none', async () => {
+    const { dialog } = await ask({ description: 'Delete the reminder "Oil change"?' })
+
+    expect(dialog).toHaveAccessibleName('Are you sure?')
+    expect(within(dialog).getByRole('button', { name: 'Cancel' })).toBeInTheDocument()
+    expect(within(dialog).getByRole('button', { name: 'Confirm' })).toBeInTheDocument()
+  })
+
+  it('names the buttons by their labels alone, without the key hints', async () => {
+    const { dialog } = await ask(sendInvoice)
+
+    // getByRole matches the whole accessible name: "Cancel Esc" would not be found.
+    expect(within(dialog).getByRole('button', { name: /^Cancel$/ })).toBeInTheDocument()
+    expect(within(dialog).getByRole('button', { name: /^Send invoice$/ })).toBeInTheDocument()
+  })
+
+  it('reads the affected things and the consequences as the description', async () => {
+    const { dialog } = await ask({
+      ...removeLinks,
+      description: undefined,
+      subject: [
+        { label: 'Invoice 2026-0412', detail: 'Maria Jensen' },
+        { label: 'Quote 2026-0098', detail: 'Nordby Transport AS' },
+      ],
+      subjectMore: 3,
+      consequences: ['Customers who open them see that the link is no longer available.'],
+      irreversible: true,
+    })
+
+    expect(dialog).toHaveAccessibleName('Remove 5 links?')
+    const description = dialog.getAttribute('aria-describedby')
+    const described = document.getElementById(description as string)
+    expect(described).toHaveTextContent('Invoice 2026-0412')
+    expect(described).toHaveTextContent('Maria Jensen')
+    expect(described).toHaveTextContent('and 3 more')
+    expect(described).toHaveTextContent('no longer available')
+    expect(described).toHaveTextContent('This cannot be undone.')
+  })
+})
+
+describe('confirm dialog: type to confirm', () => {
+  const deleteWorkshop: ConfirmOptions = {
+    title: 'Delete Organization',
+    description: 'Permanently delete "Nordby Auto" and all its data?',
+    confirmLabel: 'Delete',
+    destructive: true,
+    subject: [{ label: 'Nordby Auto', icon: Building2 }],
+    requireText: 'Nordby Auto',
+  }
+
+  it('keeps the red button off until the name is typed', async () => {
+    const { user, onAnswer, dialog } = await ask(deleteWorkshop)
+
+    const field = within(dialog).getByRole('textbox', { name: 'Type Nordby Auto to confirm' })
+    const del = within(dialog).getByRole('button', { name: 'Delete' })
+    expect(field).toHaveFocus()
+    expect(del).toBeDisabled()
+
+    // Enter on a half-typed name does nothing.
+    await user.type(field, 'Nordby A{Enter}')
+    expect(del).toBeDisabled()
+    expect(onAnswer).not.toHaveBeenCalled()
+    expect(del).not.toHaveTextContent('↵')
+  })
+
+  it('confirms on Enter once the name matches, and says so on the button', async () => {
+    const { user, onAnswer, dialog } = await ask(deleteWorkshop)
+
+    const field = within(dialog).getByRole('textbox')
+    await user.type(field, 'nordby auto')
+    const del = within(dialog).getByRole('button', { name: 'Delete' })
+    expect(del).toBeEnabled()
+    expect(del).toHaveTextContent('↵')
+
+    await user.keyboard('{Enter}')
+    await waitFor(() => expect(onAnswer).toHaveBeenCalledWith(true))
+  })
+
+  it('does not confirm on the Enter that accepts an input method composition', async () => {
+    const { user, onAnswer, dialog } = await ask(deleteWorkshop)
+
+    const field = within(dialog).getByRole('textbox')
+    await user.type(field, 'Nordby Auto')
+    // The name already matches while the input method is still composing.
+    fireEvent.keyDown(field, { key: 'Enter', isComposing: true })
+    fireEvent.keyDown(field, { key: 'Enter', keyCode: 229 })
+    expect(onAnswer).not.toHaveBeenCalled()
+    expect(screen.getByRole('alertdialog')).toBeInTheDocument()
+
+    await user.keyboard('{Enter}')
+    await waitFor(() => expect(onAnswer).toHaveBeenCalledWith(true))
+  })
+})
+
+describe('confirm dialog: phone sheet', () => {
+  function drag(handle: Element, from: number, to: number) {
+    const at = (type: 'pointerDown' | 'pointerMove' | 'pointerUp', y: number) => {
+      const event = createEvent[type](handle)
+      Object.defineProperty(event, 'clientY', { value: y })
+      fireEvent(handle, event)
+    }
+    at('pointerDown', from)
+    at('pointerMove', to)
+    at('pointerUp', to)
+  }
+
+  it('draws the sheet handle and stacks the action above Cancel for the thumb', async () => {
+    const { dialog } = await ask(removeLinks)
+
+    expect(dialog.querySelector('[data-slot="confirm-grab"]')).not.toBeNull()
+    // One column on a phone, reversed, so the action is on top and Cancel is
+    // the button nearest the bottom edge.
+    const footer = within(dialog).getByRole('button', { name: 'Cancel' }).parentElement
+    expect(footer).toHaveClass('flex-col-reverse')
+    const buttons = within(dialog).getAllByRole('button')
+    expect(buttons.map((b) => b.textContent)).toEqual(['CancelEsc', 'Remove 5 links'])
+  })
+
+  it('cancels when the sheet is dragged down and let go', async () => {
+    const { onAnswer, dialog } = await ask(removeLinks)
+
+    drag(dialog.querySelector('[data-slot="confirm-grab"]') as Element, 300, 460)
+    await waitFor(() => expect(onAnswer).toHaveBeenCalledWith(false))
+  })
+
+  it('stays open after a short nudge', async () => {
+    const { onAnswer, dialog } = await ask(removeLinks)
+
+    drag(dialog.querySelector('[data-slot="confirm-grab"]') as Element, 300, 320)
+    expect(onAnswer).not.toHaveBeenCalled()
+    expect(screen.getByRole('alertdialog')).toBeInTheDocument()
+  })
+})

+ 2 - 0
src/app/(authenticated)/(dashboard)/dashboard-client.tsx

@@ -59,6 +59,7 @@ import {
   Undo2,
   Undo2,
   Users,
   Users,
   X,
   X,
+  Trash2,
 } from 'lucide-react'
 } from 'lucide-react'
 import { useFormatCurrency } from '@/components/currency-settings-context'
 import { useFormatCurrency } from '@/components/currency-settings-context'
 import {
 import {
@@ -466,6 +467,7 @@ export function DashboardClient({
       title: t('customCards.deleteConfirmTitle'),
       title: t('customCards.deleteConfirmTitle'),
       description: t('customCards.deleteConfirmDescription', { name: w.name }),
       description: t('customCards.deleteConfirmDescription', { name: w.name }),
       confirmLabel: t('customCards.deleteCard'),
       confirmLabel: t('customCards.deleteCard'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 19 - 1
src/app/(authenticated)/customers/customers-client.tsx

@@ -5,7 +5,7 @@ import { interactiveRow } from '@/lib/interactive-row'
 import { useTableKeyboardNav } from '@/hooks/use-table-keyboard-nav'
 import { useTableKeyboardNav } from '@/hooks/use-table-keyboard-nav'
 import { useDebouncedSearch } from '@/hooks/use-debounced-search'
 import { useDebouncedSearch } from '@/hooks/use-debounced-search'
 
 
-import { useState, useCallback, useTransition, useEffect } from 'react'
+import { useState, useCallback, useTransition, useEffect, useRef } from 'react'
 import { useRouter, usePathname, useSearchParams } from 'next/navigation'
 import { useRouter, usePathname, useSearchParams } from 'next/navigation'
 import { useTranslations } from 'next-intl'
 import { useTranslations } from 'next-intl'
 import { Button } from '@/components/ui/button'
 import { Button } from '@/components/ui/button'
@@ -118,6 +118,12 @@ export function CustomersClient({
   const [showImport, setShowImport] = useState(false)
   const [showImport, setShowImport] = useState(false)
   const [editCustomer, setEditCustomer] = useState<Customer | null>(null)
   const [editCustomer, setEditCustomer] = useState<Customer | null>(null)
   const [selected, setSelected] = useState<Set<string>>(new Set())
   const [selected, setSelected] = useState<Set<string>>(new Set())
+  // Selection outlives the page of rows it was made on, so every row shown is
+  // remembered: the delete prompt can still name what is selected elsewhere.
+  const seenRows = useRef(new Map<string, (typeof data.customers)[number]>())
+  useEffect(() => {
+    for (const row of data.customers) seenRows.current.set(row.id, row)
+  }, [data.customers])
   const [isDeleting, setIsDeleting] = useState(false)
   const [isDeleting, setIsDeleting] = useState(false)
   const modal = useGlassModal()
   const modal = useGlassModal()
   const confirm = useConfirm()
   const confirm = useConfirm()
@@ -199,6 +205,7 @@ export function CustomersClient({
       title: t('deleteTitle'),
       title: t('deleteTitle'),
       description: t('deleteDescription', { name }),
       description: t('deleteDescription', { name }),
       confirmLabel: tc('buttons.delete'),
       confirmLabel: tc('buttons.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return
@@ -214,10 +221,21 @@ export function CustomersClient({
 
 
   const handleBatchDelete = async () => {
   const handleBatchDelete = async () => {
     if (selected.size === 0) return
     if (selected.size === 0) return
+    // Name the first few customers so the count is not taken on trust.
+    const named = Array.from(selected)
+      .map((id) => seenRows.current.get(id))
+      .filter((row) => row !== undefined)
+      .slice(0, 3)
     const ok = await confirm({
     const ok = await confirm({
       title: t('batchDeleteTitle'),
       title: t('batchDeleteTitle'),
       description: t('batchDeleteDescription', { count: selected.size }),
       description: t('batchDeleteDescription', { count: selected.size }),
+      subject: named.map((c) => ({
+        label: c.name,
+        detail: c.company && c.company !== c.name ? c.company : undefined,
+      })),
+      subjectMore: selected.size - named.length,
       confirmLabel: tc('buttons.delete'),
       confirmLabel: tc('buttons.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 16 - 1
src/app/(authenticated)/inventory/inventory-client.tsx

@@ -8,7 +8,7 @@ import { interactiveRow } from '@/lib/interactive-row'
 import { useDebouncedSearch } from '@/hooks/use-debounced-search'
 import { useDebouncedSearch } from '@/hooks/use-debounced-search'
 import { isLow as isLowStock } from '@/features/inventory/Lib/lowStockAlerts'
 import { isLow as isLowStock } from '@/features/inventory/Lib/lowStockAlerts'
 
 
-import { useState, useCallback, useTransition, useEffect } from 'react'
+import { useState, useCallback, useTransition, useEffect, useRef } from 'react'
 import { BarcodeScannerDialog } from '@/components/barcode-scanner-dialog'
 import { BarcodeScannerDialog } from '@/components/barcode-scanner-dialog'
 import { BarcodeScanActionDialog } from '@/features/inventory/Components/BarcodeScanActionDialog'
 import { BarcodeScanActionDialog } from '@/features/inventory/Components/BarcodeScanActionDialog'
 import { useHardwareScanner } from '@/hooks/use-hardware-scanner'
 import { useHardwareScanner } from '@/hooks/use-hardware-scanner'
@@ -195,6 +195,12 @@ export function InventoryClient({
   const [scannedBarcode, setScannedBarcode] = useState('')
   const [scannedBarcode, setScannedBarcode] = useState('')
   const [showScanActions, setShowScanActions] = useState(false)
   const [showScanActions, setShowScanActions] = useState(false)
   const [selected, setSelected] = useState<Set<string>>(new Set())
   const [selected, setSelected] = useState<Set<string>>(new Set())
+  // Selection outlives the page of rows it was made on, so every row shown is
+  // remembered: the delete prompt can still name what is selected elsewhere.
+  const seenRows = useRef(new Map<string, (typeof data.parts)[number]>())
+  useEffect(() => {
+    for (const row of data.parts) seenRows.current.set(row.id, row)
+  }, [data.parts])
   const [isBulkDeleting, setIsBulkDeleting] = useState(false)
   const [isBulkDeleting, setIsBulkDeleting] = useState(false)
 
 
   useEffect(() => {
   useEffect(() => {
@@ -275,6 +281,7 @@ export function InventoryClient({
       title: t('deletePart.title'),
       title: t('deletePart.title'),
       description: t('deletePart.description', { name }),
       description: t('deletePart.description', { name }),
       confirmLabel: t('deletePart.confirm'),
       confirmLabel: t('deletePart.confirm'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return
@@ -307,10 +314,18 @@ export function InventoryClient({
 
 
   const handleBulkDelete = async () => {
   const handleBulkDelete = async () => {
     if (selected.size === 0) return
     if (selected.size === 0) return
+    // Name the first few parts so the count is not taken on trust.
+    const named = Array.from(selected)
+      .map((id) => seenRows.current.get(id))
+      .filter((row) => row !== undefined)
+      .slice(0, 3)
     const ok = await confirm({
     const ok = await confirm({
       title: t('bulkDelete.title'),
       title: t('bulkDelete.title'),
       description: t('bulkDelete.description', { count: selected.size }),
       description: t('bulkDelete.description', { count: selected.size }),
+      subject: named.map((p) => ({ label: p.name, detail: p.partNumber ?? undefined })),
+      subjectMore: selected.size - named.length,
       confirmLabel: t('bulkDelete.confirm'),
       confirmLabel: t('bulkDelete.confirm'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 1 - 0
src/app/(authenticated)/labor-presets/labor-presets-client.tsx

@@ -180,6 +180,7 @@ export function LaborPresetsClient({
       title: t('deletePreset.title'),
       title: t('deletePreset.title'),
       description: t('deletePreset.description', { name }),
       description: t('deletePreset.description', { name }),
       confirmLabel: t('deletePreset.confirm'),
       confirmLabel: t('deletePreset.confirm'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 1 - 0
src/app/(authenticated)/settings/email-templates/email-template-gallery.tsx

@@ -143,6 +143,7 @@ function KindRow({
       title: t('deleteTitle'),
       title: t('deleteTitle'),
       description: t('deleteConfirm', { name: template.name }),
       description: t('deleteConfirm', { name: template.name }),
       confirmLabel: t('delete'),
       confirmLabel: t('delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 1 - 0
src/app/(authenticated)/settings/team/team-settings.tsx

@@ -274,6 +274,7 @@ export function TeamSettings({
       title: t('team.deleteRole'),
       title: t('team.deleteRole'),
       description: t('team.deleteRoleDescription', { name: role.name }),
       description: t('team.deleteRoleDescription', { name: role.name }),
       confirmLabel: t('team.deleteRole'),
       confirmLabel: t('team.deleteRole'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 1 - 0
src/app/(authenticated)/timesheets/timesheets-client.tsx

@@ -331,6 +331,7 @@ export default function TimesheetsClient({
         technician: entry.technicianName,
         technician: entry.technicianName,
       }),
       }),
       confirmLabel: t('deleteConfirm'),
       confirmLabel: t('deleteConfirm'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 1 - 0
src/app/(authenticated)/tire-hotel/[id]/tire-set-client.tsx

@@ -183,6 +183,7 @@ export function TireSetClient({
       title: t('detail.deleteTitle'),
       title: t('detail.deleteTitle'),
       description: t('detail.deleteBody'),
       description: t('detail.deleteBody'),
       confirmLabel: t('common.delete'),
       confirmLabel: t('common.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 2 - 0
src/app/(authenticated)/tire-hotel/storage/storage-client.tsx

@@ -124,6 +124,7 @@ export function StorageClient({
       title: t('storage.deleteLocationTitle', { code: location.code }),
       title: t('storage.deleteLocationTitle', { code: location.code }),
       description: t('storage.deleteLocationBody'),
       description: t('storage.deleteLocationBody'),
       confirmLabel: t('common.delete'),
       confirmLabel: t('common.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return
@@ -144,6 +145,7 @@ export function StorageClient({
           ? t('storage.deleteWarehouseBodyOccupied', { count: warehouse.summary.used })
           ? t('storage.deleteWarehouseBodyOccupied', { count: warehouse.summary.used })
           : t('storage.deleteWarehouseBody'),
           : t('storage.deleteWarehouseBody'),
       confirmLabel: t('common.delete'),
       confirmLabel: t('common.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 1 - 0
src/app/(authenticated)/vehicles/vehicles-client.tsx

@@ -258,6 +258,7 @@ export function VehiclesClient({
       title: t('deleteTitle'),
       title: t('deleteTitle'),
       description: t('deleteDescription', { name }),
       description: t('deleteDescription', { name }),
       confirmLabel: tc('delete'),
       confirmLabel: tc('delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 315 - 35
src/components/confirm-dialog.tsx

@@ -1,23 +1,66 @@
 'use client'
 'use client'
 
 
-import { useState, useCallback, createContext, useContext, useRef } from 'react'
+import {
+  type ComponentType,
+  type CSSProperties,
+  createContext,
+  type PointerEvent as ReactPointerEvent,
+  useCallback,
+  useContext,
+  useId,
+  useRef,
+  useState,
+} from 'react'
+import { Ban, CircleAlert, CircleHelp, TriangleAlert } from 'lucide-react'
+import { useTranslations } from 'next-intl'
+import { AlertDialog as AlertDialogPrimitive } from 'radix-ui'
 import {
 import {
   AlertDialog,
   AlertDialog,
   AlertDialogAction,
   AlertDialogAction,
   AlertDialogCancel,
   AlertDialogCancel,
-  AlertDialogContent,
-  AlertDialogDescription,
-  AlertDialogFooter,
-  AlertDialogHeader,
-  AlertDialogTitle,
+  AlertDialogOverlay,
+  AlertDialogPortal,
 } from '@/components/ui/alert-dialog'
 } from '@/components/ui/alert-dialog'
+import { Input } from '@/components/ui/input'
+import { cn } from '@/lib/utils'
+
+type ConfirmIcon = ComponentType<{ className?: string }>
+
+/** One thing the action touches: an invoice, a customer, a design. */
+export interface ConfirmSubject {
+  label: string
+  /** Quiet text on the right: who it belongs to, an amount, a count. */
+  detail?: string
+  icon?: ConfirmIcon
+}
+
+/** A short line saying what happens next. A plain string gets a neutral icon. */
+export type ConfirmConsequence = string | { text: string; icon?: ConfirmIcon; emphasis?: boolean }
 
 
-interface ConfirmOptions {
+export interface ConfirmOptions {
   title?: string
   title?: string
-  description: string
+  description?: string
   confirmLabel?: string
   confirmLabel?: string
   cancelLabel?: string
   cancelLabel?: string
   destructive?: boolean
   destructive?: boolean
+  /** The mark in the header. Defaults to a warning when destructive, a question otherwise. */
+  icon?: ConfirmIcon
+  /** Rows naming what is affected. Pass the first few and count the rest in `subjectMore`. */
+  subject?: ConfirmSubject[]
+  /** How many more things are affected than the rows in `subject` show. */
+  subjectMore?: number
+  consequences?: ConfirmConsequence[]
+  /** Adds the shared "This cannot be undone." line under the consequences. */
+  irreversible?: boolean
+  /** A name the user must type before the action wakes. For the most dangerous deletes. */
+  requireText?: string
+  /**
+   * Which button holds focus when the dialog opens, and so which one Enter
+   * presses. Defaults to cancel for a destructive confirm and to the action
+   * otherwise; a prompt that throws work away without being destructive
+   * (leaving with unsaved changes) passes 'cancel'.
+   */
+  defaultFocus?: 'cancel' | 'confirm'
 }
 }
 
 
 interface ConfirmContextValue {
 interface ConfirmContextValue {
@@ -32,54 +75,291 @@ export function useConfirm() {
   return ctx.confirm
   return ctx.confirm
 }
 }
 
 
+/** How far the phone sheet must be dragged down before letting go cancels. */
+const DRAG_TO_DISMISS_PX = 80
+
+/**
+ * The key that presses a button, drawn inside it. Only where there is a
+ * keyboard: never on the phone sheet or a touch screen. Hidden from screen
+ * readers, so the button is still announced by its label alone.
+ */
+function KeyHint({ children }: { children: string }) {
+  return (
+    <span
+      aria-hidden="true"
+      data-slot="confirm-key-hint"
+      className="hidden rounded px-1 py-0.5 font-mono text-[11px] leading-none font-medium opacity-75 ring-1 ring-current/30 ring-inset sm:[@media(hover:hover)_and_(pointer:fine)]:inline-block"
+    >
+      {children}
+    </span>
+  )
+}
+
 export function ConfirmProvider({ children }: { children: React.ReactNode }) {
 export function ConfirmProvider({ children }: { children: React.ReactNode }) {
+  const t = useTranslations('common')
   const [open, setOpen] = useState(false)
   const [open, setOpen] = useState(false)
-  const [options, setOptions] = useState<ConfirmOptions>({
-    description: '',
-  })
+  const [options, setOptions] = useState<ConfirmOptions>({})
+  const [typed, setTyped] = useState('')
+  const [dragY, setDragY] = useState(0)
   const resolveRef = useRef<((value: boolean) => void) | null>(null)
   const resolveRef = useRef<((value: boolean) => void) | null>(null)
+  const cancelRef = useRef<HTMLButtonElement>(null)
+  const actionRef = useRef<HTMLButtonElement>(null)
+  const inputRef = useRef<HTMLInputElement>(null)
+  const dragStart = useRef<number | null>(null)
+  const typeLabelId = useId()
 
 
   const confirm = useCallback((opts: ConfirmOptions) => {
   const confirm = useCallback((opts: ConfirmOptions) => {
     setOptions(opts)
     setOptions(opts)
+    setTyped('')
+    setDragY(0)
     setOpen(true)
     setOpen(true)
     return new Promise<boolean>((resolve) => {
     return new Promise<boolean>((resolve) => {
       resolveRef.current = resolve
       resolveRef.current = resolve
     })
     })
   }, [])
   }, [])
 
 
-  const handleConfirm = useCallback(() => {
+  const settle = useCallback((value: boolean) => {
     setOpen(false)
     setOpen(false)
-    resolveRef.current?.(true)
+    resolveRef.current?.(value)
     resolveRef.current = null
     resolveRef.current = null
   }, [])
   }, [])
 
 
-  const handleCancel = useCallback(() => {
-    setOpen(false)
-    resolveRef.current?.(false)
-    resolveRef.current = null
-  }, [])
+  const destructive = Boolean(options.destructive)
+  const focusTarget = options.defaultFocus ?? (destructive ? 'cancel' : 'confirm')
+  const mustType = options.requireText?.trim()
+  const typedMatches = !mustType || typed.trim().toLowerCase() === mustType.toLowerCase()
+  // Enter presses whichever button has focus, so the hint goes on the action
+  // only when focus opens there. In the type-to-confirm field Enter submits
+  // once the name matches.
+  const enterConfirms = mustType ? typedMatches : focusTarget === 'confirm'
+
+  const Icon = options.icon ?? (destructive ? TriangleAlert : CircleHelp)
+  const consequences: Exclude<ConfirmConsequence, string>[] = [
+    ...(options.consequences ?? []).map((c) => (typeof c === 'string' ? { text: c } : c)),
+    ...(options.irreversible
+      ? [{ text: t('confirmDialog.irreversible'), icon: Ban, emphasis: true }]
+      : []),
+  ]
+  const subject = options.subject ?? []
+  const subjectHasIcons = subject.some((row) => row.icon)
+  const more = options.subjectMore ?? 0
+
+  // One colour drives the chip, the glow and the hairline. `--confirm-ink` is
+  // that colour pulled toward the text colour, so a red icon still reads on a
+  // dark card.
+  const tone = {
+    '--confirm-tone': destructive ? 'var(--destructive)' : 'var(--primary)',
+    '--confirm-ink': 'color-mix(in oklab, var(--confirm-tone) 72%, var(--foreground))',
+    transform: dragY > 0 ? `translateY(${dragY}px)` : undefined,
+    transition: dragStart.current === null ? undefined : 'none',
+  } as CSSProperties
+
+  const onGrabDown = (e: ReactPointerEvent<HTMLDivElement>) => {
+    e.currentTarget.setPointerCapture?.(e.pointerId)
+    dragStart.current = e.clientY
+  }
+  const onGrabMove = (e: ReactPointerEvent<HTMLDivElement>) => {
+    if (dragStart.current === null) return
+    setDragY(Math.max(0, e.clientY - dragStart.current))
+  }
+  const onGrabUp = () => {
+    if (dragStart.current === null) return
+    dragStart.current = null
+    if (dragY > DRAG_TO_DISMISS_PX) settle(false)
+    else setDragY(0)
+  }
 
 
   return (
   return (
     <ConfirmContext value={{ confirm }}>
     <ConfirmContext value={{ confirm }}>
       {children}
       {children}
-      <AlertDialog open={open} onOpenChange={(v) => !v && handleCancel()}>
-        <AlertDialogContent>
-          <AlertDialogHeader>
-            <AlertDialogTitle>{options.title || 'Are you sure?'}</AlertDialogTitle>
-            <AlertDialogDescription>{options.description}</AlertDialogDescription>
-          </AlertDialogHeader>
-          <AlertDialogFooter>
-            <AlertDialogCancel>{options.cancelLabel || 'Cancel'}</AlertDialogCancel>
-            <AlertDialogAction
-              onClick={handleConfirm}
-              className={
-                options.destructive ? 'bg-destructive text-white hover:bg-destructive/90' : ''
-              }
+      <AlertDialog open={open} onOpenChange={(v) => !v && settle(false)}>
+        <AlertDialogPortal>
+          {/* Tapping outside is the safe answer, the same as Escape. */}
+          <AlertDialogOverlay onClick={() => settle(false)} />
+          <AlertDialogPrimitive.Content
+            data-slot="confirm-dialog"
+            data-tone={destructive ? 'destructive' : 'neutral'}
+            style={tone}
+            onOpenAutoFocus={(e) => {
+              e.preventDefault()
+              const target = mustType
+                ? inputRef.current
+                : focusTarget === 'confirm'
+                  ? actionRef.current
+                  : cancelRef.current
+              target?.focus()
+            }}
+            className={cn(
+              'bg-card text-card-foreground border-card-edge fixed z-50 flex flex-col overflow-hidden border outline-none duration-200',
+              'shadow-[0_1px_2px_rgb(0_0_0/0.06),0_24px_48px_-20px_rgb(0_0_0/0.45)]',
+              'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
+              // Phone: a sheet on the bottom edge, so the buttons sit under the thumb.
+              'max-sm:data-[state=open]:slide-in-from-bottom max-sm:data-[state=closed]:slide-out-to-bottom max-sm:inset-x-0 max-sm:bottom-0 max-sm:max-h-[90dvh] max-sm:rounded-t-[1.375rem] max-sm:border-b-0',
+              // Larger screens: the house card, centred.
+              'sm:data-[state=open]:zoom-in-95 sm:data-[state=closed]:zoom-out-95 sm:top-1/2 sm:left-1/2 sm:max-h-[85vh] sm:w-full sm:max-w-md sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-xl'
+            )}
+          >
+            {/* The sheen, centred on the chip like the house card's. */}
+            <div
+              aria-hidden="true"
+              className="pointer-events-none absolute inset-0 bg-[radial-gradient(9rem_5.5rem_at_2.4rem_2.2rem,color-mix(in_oklab,var(--confirm-tone)_9%,transparent),transparent_70%)]"
+            />
+            <div
+              aria-hidden="true"
+              data-slot="confirm-grab"
+              onPointerDown={onGrabDown}
+              onPointerMove={onGrabMove}
+              onPointerUp={onGrabUp}
+              onPointerCancel={onGrabUp}
+              className="relative shrink-0 touch-none px-5 pt-2.5 pb-1 sm:hidden"
             >
             >
-              {options.confirmLabel || 'Confirm'}
-            </AlertDialogAction>
-          </AlertDialogFooter>
-        </AlertDialogContent>
+              <div className="bg-muted-foreground/45 mx-auto h-1 w-10 rounded-full" />
+            </div>
+
+            <div className="relative flex shrink-0 items-center gap-3 px-5 pt-3 pb-3.5 sm:pt-4">
+              <div
+                data-slot="confirm-icon"
+                className="flex size-9 shrink-0 items-center justify-center rounded-lg bg-[linear-gradient(to_bottom,color-mix(in_oklab,var(--confirm-tone)_12%,transparent),color-mix(in_oklab,var(--confirm-tone)_4%,transparent))] text-(--confirm-ink) shadow-[inset_0_0_0_1px_color-mix(in_oklab,var(--confirm-tone)_22%,transparent),inset_0_1px_0_rgb(255_255_255/0.15)]"
+              >
+                <Icon className="size-[17px]" />
+              </div>
+              <AlertDialogPrimitive.Title className="font-display min-w-0 text-[15px] leading-snug font-semibold tracking-tight text-balance">
+                {options.title || t('confirmDialog.title')}
+              </AlertDialogPrimitive.Title>
+            </div>
+            {/* The house hairline: the tone under the chip, gone by the far edge. */}
+            <div
+              aria-hidden="true"
+              className="relative h-px shrink-0 bg-[linear-gradient(to_right,color-mix(in_oklab,var(--confirm-tone)_55%,transparent),var(--card-edge)_45%,transparent)]"
+            />
+
+            {/* Everything between the hairline and the buttons is the description
+                a screen reader announces, in reading order. */}
+            <AlertDialogPrimitive.Description asChild>
+              <div className="relative min-h-0 flex-1 overflow-y-auto text-sm">
+                {options.description && (
+                  <p className="text-muted-foreground px-5 pt-4 pb-5 leading-relaxed">
+                    {options.description}
+                  </p>
+                )}
+                {subject.length > 0 && (
+                  <ul
+                    data-slot="confirm-subject"
+                    className={cn(
+                      'text-[13px]',
+                      options.description && 'border-card-edge/45 border-t'
+                    )}
+                  >
+                    {subject.map((row) => {
+                      const RowIcon = row.icon
+                      return (
+                        <li
+                          key={`${row.label}:${row.detail ?? ''}`}
+                          className="border-card-edge/45 flex min-w-0 items-center gap-2.5 border-b px-5 py-2"
+                        >
+                          {RowIcon && (
+                            <RowIcon className="text-muted-foreground size-[15px] shrink-0" />
+                          )}
+                          <span className="min-w-0 truncate font-medium">{row.label}</span>
+                          {row.detail && (
+                            <span className="text-muted-foreground ml-auto max-w-[55%] shrink-0 truncate tabular-nums">
+                              {row.detail}
+                            </span>
+                          )}
+                        </li>
+                      )
+                    })}
+                    {more > 0 && (
+                      <li
+                        className={cn(
+                          'text-muted-foreground border-card-edge/45 border-b py-2 pr-5',
+                          subjectHasIcons ? 'pl-[2.8125rem]' : 'pl-5'
+                        )}
+                      >
+                        {t('confirmDialog.andMore', { count: more })}
+                      </li>
+                    )}
+                  </ul>
+                )}
+                {consequences.length > 0 && (
+                  <ul
+                    data-slot="confirm-consequences"
+                    className="grid gap-1.5 px-5 pt-3.5 pb-4 text-[13px]"
+                  >
+                    {consequences.map((line) => {
+                      const LineIcon = line.icon ?? CircleAlert
+                      return (
+                        <li
+                          key={line.text}
+                          className={cn(
+                            'flex gap-2.5 leading-snug',
+                            line.emphasis ? 'font-medium' : 'text-muted-foreground'
+                          )}
+                        >
+                          <LineIcon className="mt-0.5 size-[15px] shrink-0 text-(--confirm-ink)" />
+                          <span>{line.text}</span>
+                        </li>
+                      )
+                    })}
+                  </ul>
+                )}
+                {mustType && (
+                  <div
+                    className={cn(
+                      'grid gap-1.5 px-5 pb-4 text-[13px]',
+                      consequences.length > 0 ? 'pt-1' : 'pt-3.5'
+                    )}
+                  >
+                    <label htmlFor={`${typeLabelId}-input`} id={typeLabelId}>
+                      {t.rich('confirmDialog.typeToConfirm', {
+                        text: mustType,
+                        b: (chunks) => <b className="font-semibold">{chunks}</b>,
+                      })}
+                    </label>
+                    <Input
+                      ref={inputRef}
+                      id={`${typeLabelId}-input`}
+                      value={typed}
+                      autoComplete="off"
+                      autoCapitalize="off"
+                      spellCheck={false}
+                      onChange={(e) => setTyped(e.target.value)}
+                      onKeyDown={(e) => {
+                        // An Enter that accepts an input method's composition
+                        // finishes the text; it is not an answer.
+                        if (e.nativeEvent.isComposing || e.keyCode === 229) return
+                        if (e.key === 'Enter' && typedMatches) {
+                          e.preventDefault()
+                          settle(true)
+                        }
+                      }}
+                    />
+                  </div>
+                )}
+              </div>
+            </AlertDialogPrimitive.Description>
+
+            <div className="border-card-edge/60 bg-muted/45 relative flex shrink-0 flex-col-reverse gap-2 border-t px-5 py-3 max-sm:pt-3.5 max-sm:pb-[max(1.25rem,env(safe-area-inset-bottom))] sm:flex-row sm:flex-wrap sm:justify-end">
+              <AlertDialogCancel ref={cancelRef} className="max-sm:h-11 max-sm:text-[15px]">
+                <span>{options.cancelLabel || t('buttons.cancel')}</span>
+                <KeyHint>Esc</KeyHint>
+              </AlertDialogCancel>
+              <AlertDialogAction
+                ref={actionRef}
+                disabled={!typedMatches}
+                onClick={() => settle(true)}
+                // The button's own destructive variant, not a class override: two
+                // background utilities on one element are settled by stylesheet
+                // order, which is how a red button ends up amber.
+                variant={destructive ? 'destructive' : 'default'}
+                className="max-sm:h-11 max-sm:text-[15px]"
+              >
+                <span>{options.confirmLabel || t('buttons.confirm')}</span>
+                {enterConfirms && <KeyHint>↵</KeyHint>}
+              </AlertDialogAction>
+            </div>
+          </AlertDialogPrimitive.Content>
+        </AlertDialogPortal>
       </AlertDialog>
       </AlertDialog>
     </ConfirmContext>
     </ConfirmContext>
   )
   )

+ 4 - 1
src/features/admin/Components/admin-organizations.tsx

@@ -25,7 +25,7 @@ import {
   DropdownMenuTrigger,
   DropdownMenuTrigger,
 } from '@/components/ui/dropdown-menu'
 } from '@/components/ui/dropdown-menu'
 import { DataTablePagination } from '@/components/data-table-pagination'
 import { DataTablePagination } from '@/components/data-table-pagination'
-import { Loader2, MoreHorizontal, Search, Trash2 } from 'lucide-react'
+import { Building2, Loader2, MoreHorizontal, Search, Trash2 } from 'lucide-react'
 import { deleteOrganization } from '../Actions/deleteOrganization'
 import { deleteOrganization } from '../Actions/deleteOrganization'
 
 
 type OrgRow = {
 type OrgRow = {
@@ -88,6 +88,9 @@ export function AdminOrganizations({ data, search }: { data: PaginatedData; sear
       title: t('organizations.deleteTitle'),
       title: t('organizations.deleteTitle'),
       description: t('organizations.deleteConfirm', { name: org.name }),
       description: t('organizations.deleteConfirm', { name: org.name }),
       confirmLabel: t('organizations.delete'),
       confirmLabel: t('organizations.delete'),
+      icon: Trash2,
+      subject: [{ label: org.name, detail: org.ownerEmail, icon: Building2 }],
+      requireText: org.name,
       destructive: true,
       destructive: true,
     })
     })
 
 

+ 1 - 0
src/features/admin/Components/admin-users.tsx

@@ -175,6 +175,7 @@ export function AdminUsers({
       title: t('users.deleteTitle'),
       title: t('users.deleteTitle'),
       description: t('users.deleteConfirm', { name: user.name, email: user.email }),
       description: t('users.deleteConfirm', { name: user.name, email: user.email }),
       confirmLabel: t('users.delete'),
       confirmLabel: t('users.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
 
 

+ 7 - 0
src/features/calendar/Components/EventContextMenu.tsx

@@ -35,6 +35,7 @@ export function EventContextMenu({
   children: ReactNode
   children: ReactNode
 }) {
 }) {
   const t = useTranslations('calendar.eventMenu')
   const t = useTranslations('calendar.eventMenu')
+  const tc = useTranslations('common')
   const router = useRouter()
   const router = useRouter()
   const confirm = useConfirm()
   const confirm = useConfirm()
   const { refresh, editBooking } = useEventPeek()
   const { refresh, editBooking } = useEventPeek()
@@ -63,6 +64,8 @@ export function EventContextMenu({
   const removeReminder = async () => {
   const removeReminder = async () => {
     const ok = await confirm({
     const ok = await confirm({
       description: t('deleteReminderConfirm', { title: event.title }),
       description: t('deleteReminderConfirm', { title: event.title }),
+      confirmLabel: tc('buttons.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (ok) await run(() => deleteReminder(event.id), t('deleted'))
     if (ok) await run(() => deleteReminder(event.id), t('deleted'))
@@ -71,6 +74,8 @@ export function EventContextMenu({
   const removeMessage = async () => {
   const removeMessage = async () => {
     const ok = await confirm({
     const ok = await confirm({
       description: t('deleteMessageConfirm', { title: event.title }),
       description: t('deleteMessageConfirm', { title: event.title }),
+      confirmLabel: tc('buttons.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (ok) await run(() => deleteScheduledMessage(event.id), t('deleted'))
     if (ok) await run(() => deleteScheduledMessage(event.id), t('deleted'))
@@ -79,6 +84,8 @@ export function EventContextMenu({
   const removeAppointment = async () => {
   const removeAppointment = async () => {
     const ok = await confirm({
     const ok = await confirm({
       description: t('deleteAppointmentConfirm', { title: event.title }),
       description: t('deleteAppointmentConfirm', { title: event.title }),
+      confirmLabel: tc('buttons.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (ok) await run(() => deleteAppointment(event.id), t('deleted'))
     if (ok) await run(() => deleteAppointment(event.id), t('deleted'))

+ 3 - 1
src/features/custom-fields/Components/CustomFieldsManager.tsx

@@ -100,6 +100,7 @@ export function CustomFieldsManager({
 }) {
 }) {
   const router = useRouter()
   const router = useRouter()
   const t = useTranslations('settings')
   const t = useTranslations('settings')
+  const tc = useTranslations('common')
   const modal = useGlassModal()
   const modal = useGlassModal()
   const confirm = useConfirm()
   const confirm = useConfirm()
   const fields = initialFields
   const fields = initialFields
@@ -225,7 +226,8 @@ export function CustomFieldsManager({
     const ok = await confirm({
     const ok = await confirm({
       title: t('customFields.deleteTitle'),
       title: t('customFields.deleteTitle'),
       description: t('customFields.deleteDescription', { label: field.label }),
       description: t('customFields.deleteDescription', { label: field.label }),
-      confirmLabel: 'Delete',
+      confirmLabel: tc('buttons.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 5 - 0
src/features/email/Components/EmailDesigner.tsx

@@ -12,6 +12,7 @@ import {
   Save,
   Save,
   Send,
   Send,
   Smartphone,
   Smartphone,
+  PenLine,
   Trash2,
   Trash2,
 } from 'lucide-react'
 } from 'lucide-react'
 import { useRouter } from 'next/navigation'
 import { useRouter } from 'next/navigation'
@@ -390,6 +391,9 @@ export function EmailDesigner({
         title: t('leaveTitle'),
         title: t('leaveTitle'),
         description: t('leaveBody'),
         description: t('leaveBody'),
         confirmLabel: t('leaveConfirm'),
         confirmLabel: t('leaveConfirm'),
+        cancelLabel: t('leaveCancel'),
+        icon: PenLine,
+        defaultFocus: 'cancel',
       })
       })
       if (!go) return
       if (!go) return
     }
     }
@@ -402,6 +406,7 @@ export function EmailDesigner({
       title: t('deleteTitle'),
       title: t('deleteTitle'),
       description: t('deleteConfirm', { name: saved.name }),
       description: t('deleteConfirm', { name: saved.name }),
       confirmLabel: t('delete'),
       confirmLabel: t('delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 5 - 1
src/features/invoice-designer/Components/InvoiceDesigner.tsx

@@ -1,7 +1,7 @@
 'use client'
 'use client'
 
 
 import { useCallback, useEffect, useMemo, useState } from 'react'
 import { useCallback, useEffect, useMemo, useState } from 'react'
-import { Eye, EyeOff, Trash2 } from 'lucide-react'
+import { Eye, EyeOff, PenLine, Trash2 } from 'lucide-react'
 import { useMessages, useTranslations } from 'next-intl'
 import { useMessages, useTranslations } from 'next-intl'
 import { withOrgNumberLabel } from '../Lib/labelOverrides'
 import { withOrgNumberLabel } from '../Lib/labelOverrides'
 import { RAIL_FOCUS, railArrow } from './railKeys'
 import { RAIL_FOCUS, railArrow } from './railKeys'
@@ -455,6 +455,7 @@ export function InvoiceDesigner({
           .filter(Boolean)
           .filter(Boolean)
           .join(' '),
           .join(' '),
         confirmLabel: t('delete'),
         confirmLabel: t('delete'),
+        icon: Trash2,
         destructive: true,
         destructive: true,
       })
       })
       if (!ok) return false
       if (!ok) return false
@@ -663,6 +664,9 @@ export function InvoiceDesigner({
         title: t('leaveTitle'),
         title: t('leaveTitle'),
         description: t('leaveBody'),
         description: t('leaveBody'),
         confirmLabel: t('leaveConfirm'),
         confirmLabel: t('leaveConfirm'),
+        cancelLabel: t('leaveCancel'),
+        icon: PenLine,
+        defaultFocus: 'cancel',
       })
       })
       if (!go) return
       if (!go) return
     }
     }

+ 2 - 0
src/features/quotes/Components/useQuoteFormState.ts

@@ -1,5 +1,6 @@
 'use client'
 'use client'
 
 
+import { Trash2 } from 'lucide-react'
 import { useState, useCallback, useEffect, useRef, useMemo } from 'react'
 import { useState, useCallback, useEffect, useRef, useMemo } from 'react'
 import { useRouter } from 'next/navigation'
 import { useRouter } from 'next/navigation'
 import { toast } from 'sonner'
 import { toast } from 'sonner'
@@ -538,6 +539,7 @@ export function useQuoteFormState({
       title: t('page.deleteTitle'),
       title: t('page.deleteTitle'),
       description: t('page.deleteDescription'),
       description: t('page.deleteDescription'),
       confirmLabel: t('page.delete'),
       confirmLabel: t('page.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 1 - 0
src/features/time-tracking/Components/JobClockSection.tsx

@@ -156,6 +156,7 @@ export function JobClockSection({
         technician: entry.technicianName,
         technician: entry.technicianName,
       }),
       }),
       confirmLabel: tPage('deleteConfirm'),
       confirmLabel: tPage('deleteConfirm'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 1 - 0
src/features/tire-hotel/Components/TireAttachmentsCard.tsx

@@ -140,6 +140,7 @@ export function TireAttachmentsCard({
       title: t('files.deleteTitle'),
       title: t('files.deleteTitle'),
       description: t('files.deleteBody', { name: file.fileName }),
       description: t('files.deleteBody', { name: file.fileName }),
       confirmLabel: t('common.delete'),
       confirmLabel: t('common.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 4 - 0
src/features/vehicles/Components/service-page/useServiceActions.ts

@@ -1,3 +1,4 @@
+import { Trash2 } from 'lucide-react'
 import { useState } from 'react'
 import { useState } from 'react'
 import { useRouter } from 'next/navigation'
 import { useRouter } from 'next/navigation'
 import { toast } from 'sonner'
 import { toast } from 'sonner'
@@ -261,6 +262,7 @@ export function useServiceActions({
       title: t('page.deleteTitle'),
       title: t('page.deleteTitle'),
       description: t('page.deleteDescription'),
       description: t('page.deleteDescription'),
       confirmLabel: tc('buttons.delete'),
       confirmLabel: tc('buttons.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return
@@ -307,6 +309,7 @@ export function useServiceActions({
       title: t('attachments.deleteTitle'),
       title: t('attachments.deleteTitle'),
       description: t('attachments.deleteDescription'),
       description: t('attachments.deleteDescription'),
       confirmLabel: tc('buttons.delete'),
       confirmLabel: tc('buttons.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return
@@ -390,6 +393,7 @@ export function useServiceActions({
       title: t('payments.deleteTitle'),
       title: t('payments.deleteTitle'),
       description: t('payments.deleteDescription'),
       description: t('payments.deleteDescription'),
       confirmLabel: tc('buttons.delete'),
       confirmLabel: tc('buttons.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 2 - 1
src/features/workboard/Components/TechnicianDialog.tsx

@@ -6,7 +6,7 @@ import { DocsLink } from '@/components/docs-link'
 import { Button } from '@/components/ui/button'
 import { Button } from '@/components/ui/button'
 import { Input } from '@/components/ui/input'
 import { Input } from '@/components/ui/input'
 import { Label } from '@/components/ui/label'
 import { Label } from '@/components/ui/label'
-import { Loader2, UserX } from 'lucide-react'
+import { Loader2, UserX, Trash2 } from 'lucide-react'
 import { toast } from 'sonner'
 import { toast } from 'sonner'
 import {
 import {
   createTechnician,
   createTechnician,
@@ -230,6 +230,7 @@ export function TechnicianDialog({
                     title: t('deleteTitle'),
                     title: t('deleteTitle'),
                     description: t('deleteDescription', { name: technician.name }),
                     description: t('deleteDescription', { name: technician.name }),
                     confirmLabel: tc('delete'),
                     confirmLabel: tc('delete'),
+                    icon: Trash2,
                     destructive: true,
                     destructive: true,
                   })
                   })
                   if (!ok) return
                   if (!ok) return

+ 2 - 1
src/features/workboard/Components/WorkBayDialog.tsx

@@ -1,7 +1,7 @@
 'use client'
 'use client'
 
 
 import { useEffect, useState } from 'react'
 import { useEffect, useState } from 'react'
-import { Loader2 } from 'lucide-react'
+import { Loader2, Trash2 } from 'lucide-react'
 import { useTranslations } from 'next-intl'
 import { useTranslations } from 'next-intl'
 import {
 import {
   Dialog,
   Dialog,
@@ -160,6 +160,7 @@ export function WorkBayDialog({
                     title: t('deleteTitle'),
                     title: t('deleteTitle'),
                     description: t('deleteDescription', { name: workBay.name }),
                     description: t('deleteDescription', { name: workBay.name }),
                     confirmLabel: tc('delete'),
                     confirmLabel: tc('delete'),
+                    icon: Trash2,
                     destructive: true,
                     destructive: true,
                   })
                   })
                   if (!ok) return
                   if (!ok) return

+ 1 - 0
src/features/workshop-calendar/Components/ClosedDaysCard.tsx

@@ -42,6 +42,7 @@ export function ClosedDaysCard({
       title: t('deleteTitle', { name: closure.name }),
       title: t('deleteTitle', { name: closure.name }),
       description: t('deleteDescription'),
       description: t('deleteDescription'),
       confirmLabel: tc('buttons.delete'),
       confirmLabel: tc('buttons.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 1 - 0
src/features/workshop-calendar/Components/TimeOffDialog.tsx

@@ -119,6 +119,7 @@ export function TimeOffDialog({
       title: t('deleteTitle'),
       title: t('deleteTitle'),
       description: t('deleteDescription', { name: absence.technicianName }),
       description: t('deleteDescription', { name: absence.technicianName }),
       confirmLabel: tc('buttons.delete'),
       confirmLabel: tc('buttons.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return

+ 1 - 0
src/features/workshop-calendar/Components/TimeOffList.tsx

@@ -42,6 +42,7 @@ export function TimeOffList({
       title: t('deleteTitle'),
       title: t('deleteTitle'),
       description: t('deleteDescription', { name: absence.technicianName }),
       description: t('deleteDescription', { name: absence.technicianName }),
       confirmLabel: tc('buttons.delete'),
       confirmLabel: tc('buttons.delete'),
+      icon: Trash2,
       destructive: true,
       destructive: true,
     })
     })
     if (!ok) return
     if (!ok) return