Skip to content

Commit 0451ac9

Browse files
authored
feat: improve title and layout of the confirm dialog (#2307)
1 parent 54e5388 commit 0451ac9

32 files changed

+203
-188
lines changed

components/account/AccountMoreButton.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ function shareAccount() {
2626
2727
async function toggleReblogs() {
2828
if (!relationship!.showingReblogs && await openConfirmDialog({
29-
title: t('confirm.show_reblogs.title', [account.acct]),
29+
title: t('confirm.show_reblogs.title'),
30+
description: t('confirm.show_reblogs.description', [account.acct]),
3031
confirm: t('confirm.show_reblogs.confirm'),
3132
cancel: t('confirm.show_reblogs.cancel'),
3233
}) !== 'confirm')

components/list/ListEntry.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ async function removeList() {
5858
return
5959
6060
const confirmDelete = await openConfirmDialog({
61-
title: t('confirm.delete_list.title', [list.value.title]),
61+
title: t('confirm.delete_list.title'),
62+
description: t('confirm.delete_list.description', [list.value.title]),
6263
confirm: t('confirm.delete_list.confirm'),
6364
cancel: t('confirm.delete_list.cancel'),
6465
})

components/modal/ModalConfirm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const emit = defineEmits<{
1010

1111
<template>
1212
<div flex="~ col" gap-6>
13-
<div font-bold text-lg text-center>
13+
<div font-bold text-lg>
1414
{{ title }}
1515
</div>
1616
<div v-if="description">

components/status/StatusActionsMore.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ async function shareLink(status: mastodon.v1.Status) {
6666
async function deleteStatus() {
6767
if (await openConfirmDialog({
6868
title: t('confirm.delete_posts.title'),
69+
description: t('confirm.delete_posts.description'),
6970
confirm: t('confirm.delete_posts.confirm'),
7071
cancel: t('confirm.delete_posts.cancel'),
7172
}) !== 'confirm')
@@ -83,6 +84,7 @@ async function deleteStatus() {
8384
async function deleteAndRedraft() {
8485
if (await openConfirmDialog({
8586
title: t('confirm.delete_posts.title'),
87+
description: t('confirm.delete_posts.description'),
8688
confirm: t('confirm.delete_posts.confirm'),
8789
cancel: t('confirm.delete_posts.cancel'),
8890
}) !== 'confirm')

composables/masto/relationship.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export async function toggleFollowAccount(relationship: mastodon.v1.Relationship
4141
if (unfollow) {
4242
if (await openConfirmDialog({
4343
title: i18n.t('confirm.unfollow.title'),
44+
description: i18n.t('confirm.unfollow.description', [`@${account.acct}`]),
4445
confirm: i18n.t('confirm.unfollow.confirm'),
4546
cancel: i18n.t('confirm.unfollow.cancel'),
4647
}) !== 'confirm')
@@ -66,7 +67,8 @@ export async function toggleMuteAccount(relationship: mastodon.v1.Relationship,
6667
const i18n = useNuxtApp().$i18n
6768

6869
if (!relationship!.muting && await openConfirmDialog({
69-
title: i18n.t('confirm.mute_account.title', [account.acct]),
70+
title: i18n.t('confirm.mute_account.title'),
71+
description: i18n.t('confirm.mute_account.description', [account.acct]),
7072
confirm: i18n.t('confirm.mute_account.confirm'),
7173
cancel: i18n.t('confirm.mute_account.cancel'),
7274
}) !== 'confirm')
@@ -85,7 +87,8 @@ export async function toggleBlockAccount(relationship: mastodon.v1.Relationship,
8587
const i18n = useNuxtApp().$i18n
8688

8789
if (!relationship!.blocking && await openConfirmDialog({
88-
title: i18n.t('confirm.block_account.title', [account.acct]),
90+
title: i18n.t('confirm.block_account.title'),
91+
description: i18n.t('confirm.block_account.description', [account.acct]),
8992
confirm: i18n.t('confirm.block_account.confirm'),
9093
cancel: i18n.t('confirm.block_account.cancel'),
9194
}) !== 'confirm')
@@ -100,7 +103,8 @@ export async function toggleBlockDomain(relationship: mastodon.v1.Relationship,
100103
const i18n = useNuxtApp().$i18n
101104

102105
if (!relationship!.domainBlocking && await openConfirmDialog({
103-
title: i18n.t('confirm.block_domain.title', [getServerName(account)]),
106+
title: i18n.t('confirm.block_domain.title'),
107+
description: i18n.t('confirm.block_domain.description', [getServerName(account)]),
104108
confirm: i18n.t('confirm.block_domain.confirm'),
105109
cancel: i18n.t('confirm.block_domain.cancel'),
106110
}) !== 'confirm')

locales/ar.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@
120120
"block_account": {
121121
"cancel": "إلغاء",
122122
"confirm": "حظر",
123-
"title": "هل أنت متأكد أنك تريد حظر {0}؟"
123+
"description": "هل أنت متأكد أنك تريد حظر {0}؟"
124124
},
125125
"block_domain": {
126126
"cancel": "إلغاء",
127127
"confirm": "حظر",
128-
"title": "هل أنت متأكد أنك تريد حظر {0}؟"
128+
"description": "هل أنت متأكد أنك تريد حظر {0}؟"
129129
},
130130
"common": {
131131
"cancel": "لا",
@@ -134,27 +134,27 @@
134134
"delete_list": {
135135
"cancel": "إلغاء",
136136
"confirm": "حذف",
137-
"title": "هل أنت متأكد أنك تريد حذف القائمة \"{0}\"؟"
137+
"description": "هل أنت متأكد أنك تريد حذف القائمة \"{0}\"؟"
138138
},
139139
"delete_posts": {
140140
"cancel": "إلغاء",
141141
"confirm": "حذف",
142-
"title": "هل أنت متأكد أنك تريد حذف هذا المنشور؟"
142+
"description": "هل أنت متأكد أنك تريد حذف هذا المنشور؟"
143143
},
144144
"mute_account": {
145145
"cancel": "إلغاء",
146146
"confirm": "كتم",
147-
"title": "هل أنت متأكد أنك تريد كتم {0}؟"
147+
"description": "هل أنت متأكد أنك تريد كتم {0}؟"
148148
},
149149
"show_reblogs": {
150150
"cancel": "إلغاء",
151151
"confirm": "اعرض",
152-
"title": "هل أنت متأكد أنك تريد إظهار إعادة المدونات من {0}؟"
152+
"description": "هل أنت متأكد أنك تريد إظهار إعادة المدونات من {0}؟"
153153
},
154154
"unfollow": {
155155
"cancel": "إلغاء",
156156
"confirm": "إلغاء المتابعة",
157-
"title": "هل أنت متأكد أنك تريد إلغاء المتابعة؟"
157+
"description": "هل أنت متأكد أنك تريد إلغاء المتابعة؟"
158158
}
159159
},
160160
"conversation": {

locales/ca-valencia.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,36 +58,36 @@
5858
"block_account": {
5959
"cancel": "Cancel·la",
6060
"confirm": "Bloqueja",
61-
"title": "Segur que vols bloquejar {0}?"
61+
"description": "Segur que vols bloquejar {0}?"
6262
},
6363
"block_domain": {
6464
"cancel": "Cancel·la",
6565
"confirm": "Bloqueja",
66-
"title": "Segur que vols bloquejar {0}?"
66+
"description": "Segur que vols bloquejar {0}?"
6767
},
6868
"delete_list": {
6969
"cancel": "Cancel·la",
7070
"confirm": "Elimina",
71-
"title": "Segur que vols eliminar la llista «{0}»?"
71+
"description": "Segur que vols eliminar la llista «{0}»?"
7272
},
7373
"delete_posts": {
7474
"cancel": "Cancel·la",
7575
"confirm": "Elimina",
76-
"title": "Segur que vols eliminar la publicació?"
76+
"description": "Segur que vols eliminar la publicació?"
7777
},
7878
"mute_account": {
7979
"cancel": "Cancel·la",
8080
"confirm": "Silencia",
81-
"title": "Segur que vols silenciar {0}?"
81+
"description": "Segur que vols silenciar {0}?"
8282
},
8383
"show_reblogs": {
8484
"cancel": "Cancel·la",
8585
"confirm": "Mostra",
86-
"title": "Segur que vols mostrar els impulsos de: {0}?"
86+
"description": "Segur que vols mostrar els impulsos de: {0}?"
8787
},
8888
"unfollow": {
8989
"cancel": "Cancel·la",
90-
"title": "Segur que vols deixar de seguir-lo?"
90+
"description": "Segur que vols deixar de seguir-lo?"
9191
}
9292
},
9393
"custom_cards": {

locales/ca.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@
109109
"block_account": {
110110
"cancel": "Cancel·lar",
111111
"confirm": "Bloc",
112-
"title": "Confirmes que vols bloquejar {0}?"
112+
"description": "Confirmes que vols bloquejar {0}?"
113113
},
114114
"block_domain": {
115115
"cancel": "Cancel·lar",
116116
"confirm": "Bloc",
117-
"title": "Confirmes que vols bloquejar {0}?"
117+
"description": "Confirmes que vols bloquejar {0}?"
118118
},
119119
"common": {
120120
"cancel": "No",
@@ -123,27 +123,27 @@
123123
"delete_list": {
124124
"cancel": "Cancel·lar",
125125
"confirm": "Suprimeix",
126-
"title": "Esteu segur que voleu suprimir la llista \"{0}\"?"
126+
"description": "Esteu segur que voleu suprimir la llista \"{0}\"?"
127127
},
128128
"delete_posts": {
129129
"cancel": "Cancel·lar",
130130
"confirm": "Suprimeix",
131-
"title": "Esteu segur que voleu suprimir aquesta publicació?"
131+
"description": "Esteu segur que voleu suprimir aquesta publicació?"
132132
},
133133
"mute_account": {
134134
"cancel": "Cancel·lar",
135135
"confirm": "Silenciar",
136-
"title": "Confirmes que vols silenciar {0}?"
136+
"description": "Confirmes que vols silenciar {0}?"
137137
},
138138
"show_reblogs": {
139139
"cancel": "Cancel·lar",
140140
"confirm": "Espectacle",
141-
"title": "Confirmes que vols mostrar els augments de {0}?"
141+
"description": "Confirmes que vols mostrar els augments de {0}?"
142142
},
143143
"unfollow": {
144144
"cancel": "Cancel·lar",
145145
"confirm": "Deixa de seguir",
146-
"title": "Estàs segur que vols deixar de seguir?"
146+
"description": "Estàs segur que vols deixar de seguir?"
147147
}
148148
},
149149
"conversation": {

locales/de-DE.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@
113113
"block_account": {
114114
"cancel": "Abbrechen",
115115
"confirm": "Blockieren",
116-
"title": "Bist du sicher, dass du {0} blockieren möchtest?"
116+
"description": "Bist du sicher, dass du {0} blockieren möchtest?"
117117
},
118118
"block_domain": {
119119
"cancel": "Abbrechen",
120120
"confirm": "Blockieren",
121-
"title": "Bist du sicher, dass du {0} blockieren möchtest?"
121+
"description": "Bist du sicher, dass du {0} blockieren möchtest?"
122122
},
123123
"common": {
124124
"cancel": "Abbrechen",
@@ -127,27 +127,27 @@
127127
"delete_list": {
128128
"cancel": "Abbrechen",
129129
"confirm": "Löschen",
130-
"title": "Bist du sicher, dass du die Liste \"{0}\" löschen möchtest?"
130+
"description": "Bist du sicher, dass du die Liste \"{0}\" löschen möchtest?"
131131
},
132132
"delete_posts": {
133133
"cancel": "Abbrechen",
134134
"confirm": "Löschen",
135-
"title": "Möchtest du diesen Beitrag wirklich löschen?"
135+
"description": "Möchtest du diesen Beitrag wirklich löschen?"
136136
},
137137
"mute_account": {
138138
"cancel": "Abbrechen",
139139
"confirm": "Stummschalten",
140-
"title": "Bist du sicher, dass du {0} stummschalten möchtest?"
140+
"description": "Bist du sicher, dass du {0} stummschalten möchtest?"
141141
},
142142
"show_reblogs": {
143143
"cancel": "Abbrechen",
144144
"confirm": "Anzeigen",
145-
"title": "Bist du sicher, dass du Weiterleitungen von {0} anzeigen möchtest?"
145+
"description": "Bist du sicher, dass du Weiterleitungen von {0} anzeigen möchtest?"
146146
},
147147
"unfollow": {
148148
"cancel": "Abbrechen",
149149
"confirm": "Entfolgen",
150-
"title": "Bist du sicher, dass du entfolgen möchtest?"
150+
"description": "Bist du sicher, dass du entfolgen möchtest?"
151151
}
152152
},
153153
"conversation": {

locales/en.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,14 @@
120120
"block_account": {
121121
"cancel": "Cancel",
122122
"confirm": "Block",
123-
"title": "Are you sure you want to block {0}?"
123+
"description": "Are you sure you want to block {0}?",
124+
"title": "Block account"
124125
},
125126
"block_domain": {
126127
"cancel": "Cancel",
127128
"confirm": "Block",
128-
"title": "Are you sure you want to block {0}?"
129+
"description": "Are you sure you want to block {0}?",
130+
"title": "Block domain"
129131
},
130132
"common": {
131133
"cancel": "No",
@@ -134,27 +136,32 @@
134136
"delete_list": {
135137
"cancel": "Cancel",
136138
"confirm": "Delete",
137-
"title": "Are you sure you want to delete the \"{0}\" list?"
139+
"description": "Are you sure you want to delete the \"{0}\" list?",
140+
"title": "Delete list"
138141
},
139142
"delete_posts": {
140143
"cancel": "Cancel",
141144
"confirm": "Delete",
142-
"title": "Are you sure you want to delete this post?"
145+
"description": "Are you sure you want to delete this post?",
146+
"title": "Delete post"
143147
},
144148
"mute_account": {
145149
"cancel": "Cancel",
146150
"confirm": "Mute",
147-
"title": "Are you sure you want to mute {0}?"
151+
"description": "Are you sure you want to mute {0}?",
152+
"title": "Mute account"
148153
},
149154
"show_reblogs": {
150155
"cancel": "Cancel",
151156
"confirm": "Show",
152-
"title": "Are you sure you want to show boosts from {0}?"
157+
"description": "Are you sure you want to show boosts from {0}?",
158+
"title": "Show boosts"
153159
},
154160
"unfollow": {
155161
"cancel": "Cancel",
156162
"confirm": "Unfollow",
157-
"title": "Are you sure you want to unfollow?"
163+
"description": "Are you sure you want to unfollow {0}?",
164+
"title": "Unfollow"
158165
}
159166
},
160167
"conversation": {

locales/es-419.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,26 @@
4747
"block_account": {
4848
"cancel": "No",
4949
"confirm": "Sí, bloquear",
50-
"title": "¿De verdad quieres bloquear a {0}?"
50+
"description": "¿De verdad quieres bloquear a {0}?"
5151
},
5252
"block_domain": {
5353
"cancel": "No",
5454
"confirm": "Sí, ocultar",
55-
"title": "¿De verdad quieres ocultar a {0}?"
55+
"description": "¿De verdad quieres ocultar a {0}?"
5656
},
5757
"delete_posts": {
58-
"title": "¿De verdad quieres eliminar esta publicación?"
58+
"description": "¿De verdad quieres eliminar esta publicación?"
5959
},
6060
"mute_account": {
61-
"title": "¿De verdad quieres silenciar a {0}?"
61+
"description": "¿De verdad quieres silenciar a {0}?"
6262
},
6363
"show_reblogs": {
6464
"cancel": "No",
6565
"confirm": "Sí, ver",
66-
"title": "¿De verdad quieres ver los retoots de {0}"
66+
"description": "¿De verdad quieres ver los retoots de {0}"
6767
},
6868
"unfollow": {
69-
"title": "¿De verdad quieres dejar de seguir?"
69+
"description": "¿De verdad quieres dejar de seguir?"
7070
}
7171
},
7272
"error": {

0 commit comments

Comments
 (0)