Skip to content

Commit 6b57df8

Browse files
YousefEDclaude
andcommitted
feat(comments): confirm before discarding an unsaved comment
When the new-comment composer is dismissed (e.g. by clicking outside or pressing Escape) while it contains unsaved text, show a confirmation prompt before discarding it. Previously the comment was lost silently. The composer editor is now created and owned by FloatingComposerController so the dismiss handler can check whether the user has typed anything, and a translatable `comments.discard_pending_comment` string is added to all locales. Addresses #2742 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9cbf2ad commit 6b57df8

25 files changed

Lines changed: 74 additions & 16 deletions

File tree

packages/core/src/i18n/locales/ar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ export const ar: Dictionary = {
370370
save_button_text: "حفظ",
371371
cancel_button_text: "إلغاء",
372372
deleted_reference_text: "تم حذف المحتوى الأصلي",
373+
discard_pending_comment: "هل أنت متأكد أنك تريد تجاهل هذا التعليق؟",
373374
actions: {
374375
add_reaction: "أضف تفاعلًا",
375376
resolve: "حل",

packages/core/src/i18n/locales/de.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ export const de: Dictionary = {
404404
save_button_text: "Speichern",
405405
cancel_button_text: "Abbrechen",
406406
deleted_reference_text: "Originalinhalt gelöscht",
407+
discard_pending_comment: "Möchten Sie diesen Kommentar wirklich verwerfen?",
407408
actions: {
408409
add_reaction: "Reaktion hinzufügen",
409410
resolve: "Lösen",

packages/core/src/i18n/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ export const en = {
385385
save_button_text: "Save",
386386
cancel_button_text: "Cancel",
387387
deleted_reference_text: "Original content deleted",
388+
discard_pending_comment: "Are you sure you want to discard this comment?",
388389
actions: {
389390
add_reaction: "Add reaction",
390391
resolve: "Resolve",

packages/core/src/i18n/locales/es.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ export const es: Dictionary = {
383383
save_button_text: "Guardar",
384384
cancel_button_text: "Cancelar",
385385
deleted_reference_text: "Contenido original eliminado",
386+
discard_pending_comment: "¿Seguro que quieres descartar este comentario?",
386387
actions: {
387388
add_reaction: "Agregar reacción",
388389
resolve: "Resolver",

packages/core/src/i18n/locales/fa.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ export const fa = {
353353
save_button_text: "ذخیره",
354354
cancel_button_text: "لغو",
355355
deleted_reference_text: "محتوای اصلی حذف شد",
356+
discard_pending_comment: "آیا مطمئن هستید که می‌خواهید این دیدگاه را نادیده بگیرید؟",
356357
actions: {
357358
add_reaction: "افزودن واکنش",
358359
resolve: "حل کردن",

packages/core/src/i18n/locales/fr.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ export const fr: Dictionary = {
431431
save_button_text: "Enregistrer",
432432
cancel_button_text: "Annuler",
433433
deleted_reference_text: "Contenu d'origine supprimé",
434+
discard_pending_comment: "Voulez-vous vraiment abandonner ce commentaire ?",
434435
actions: {
435436
add_reaction: "Ajouter une réaction",
436437
resolve: "Résoudre",

packages/core/src/i18n/locales/he.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ export const he: Dictionary = {
385385
save_button_text: "שמור",
386386
cancel_button_text: "בטל",
387387
deleted_reference_text: "התוכן המקורי נמחק",
388+
discard_pending_comment: "האם אתה בטוח שברצונך לבטל את התגובה הזו?",
388389
actions: {
389390
add_reaction: "הוסף תגובה",
390391
resolve: "סמן כפתור",

packages/core/src/i18n/locales/hr.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ export const hr: Dictionary = {
398398
save_button_text: "Spremi",
399399
cancel_button_text: "Odustani",
400400
deleted_reference_text: "Originalni sadržaj je obrisan",
401+
discard_pending_comment: "Jeste li sigurni da želite odbaciti ovaj komentar?",
401402
actions: {
402403
add_reaction: "Dodaj reakciju",
403404
resolve: "Riješi",

packages/core/src/i18n/locales/is.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ export const is: Dictionary = {
398398
save_button_text: "Vista",
399399
cancel_button_text: "Hætta",
400400
deleted_reference_text: "Upprunalegu efni eytt",
401+
discard_pending_comment: "Ertu viss um að þú viljir henda þessari athugasemd?",
401402
actions: {
402403
add_reaction: "Bæta við viðbrögðum",
403404
resolve: "Leysa",

packages/core/src/i18n/locales/it.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ export const it: Dictionary = {
407407
save_button_text: "Salva",
408408
cancel_button_text: "Annulla",
409409
deleted_reference_text: "Contenuto originale eliminato",
410+
discard_pending_comment: "Vuoi davvero eliminare questo commento?",
410411
actions: {
411412
add_reaction: "Aggiungi reazione",
412413
resolve: "Risolvi",

0 commit comments

Comments
 (0)