Skip to content

Commit 3201a7b

Browse files
committed
actions: Add markNarrowAsRead dialog outside conversation views
A confirm ActionDialog is added to prevent accidentally marking many messages as read outside conversation views. Also, adjust existing MarkAsReadWidget tests and MarkChannelAsReadButton tests to account for the added confirmation dialog. Fixes: #1858.
1 parent fa947a1 commit 3201a7b

23 files changed

+416
-6
lines changed

assets/l10n/app_en.arb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,24 @@
10011001
"@errorMarkAsUnreadFailedTitle": {
10021002
"description": "Error title when mark as unread action failed."
10031003
},
1004+
"markAllAsReadConfirmationDialogTitle": "Mark messages as read?",
1005+
"@markAllAsReadConfirmationDialogTitle": {
1006+
"description": "Title of the confirmation dialog for marking all messages as read."
1007+
},
1008+
"markAllAsReadConfirmationDialogMessage": "{count, plural, one{{count} message will be marked as read.} other{{count} messages will be marked as read.}}",
1009+
"@markAllAsReadConfirmationDialogMessage": {
1010+
"description": "Message in the confirmation dialog for marking all messages as read.",
1011+
"placeholders": {
1012+
"count": {
1013+
"type": "int",
1014+
"description": "Number of messages that will be marked as read"
1015+
}
1016+
}
1017+
},
1018+
"markAllAsReadConfirmationDialogConfirmButton": "Mark as read",
1019+
"@markAllAsReadConfirmationDialogConfirmButton": {
1020+
"description": "Label for the 'Mark as read' button on a confirmation dialog for marking all messages as read."
1021+
},
10041022
"today": "Today",
10051023
"@today": {
10061024
"description": "Term to use to reference the current day."

lib/generated/l10n/zulip_localizations.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,6 +1477,24 @@ abstract class ZulipLocalizations {
14771477
/// **'Mark as unread failed'**
14781478
String get errorMarkAsUnreadFailedTitle;
14791479

1480+
/// Title of the confirmation dialog for marking all messages as read.
1481+
///
1482+
/// In en, this message translates to:
1483+
/// **'Mark messages as read?'**
1484+
String get markAllAsReadConfirmationDialogTitle;
1485+
1486+
/// Message in the confirmation dialog for marking all messages as read.
1487+
///
1488+
/// In en, this message translates to:
1489+
/// **'{count, plural, one{{count} message will be marked as read.} other{{count} messages will be marked as read.}}'**
1490+
String markAllAsReadConfirmationDialogMessage(int count);
1491+
1492+
/// Label for the 'Mark as read' button on a confirmation dialog for marking all messages as read.
1493+
///
1494+
/// In en, this message translates to:
1495+
/// **'Mark as read'**
1496+
String get markAllAsReadConfirmationDialogConfirmButton;
1497+
14801498
/// Term to use to reference the current day.
14811499
///
14821500
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,23 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
836836
@override
837837
String get errorMarkAsUnreadFailedTitle => 'Mark as unread failed';
838838

839+
@override
840+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
841+
842+
@override
843+
String markAllAsReadConfirmationDialogMessage(int count) {
844+
String _temp0 = intl.Intl.pluralLogic(
845+
count,
846+
locale: localeName,
847+
other: '$count messages will be marked as read.',
848+
one: '$count message will be marked as read.',
849+
);
850+
return '$_temp0';
851+
}
852+
853+
@override
854+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
855+
839856
@override
840857
String get today => 'Today';
841858

lib/generated/l10n/zulip_localizations_de.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,23 @@ class ZulipLocalizationsDe extends ZulipLocalizations {
855855
String get errorMarkAsUnreadFailedTitle =>
856856
'Als ungelesen markieren fehlgeschlagen';
857857

858+
@override
859+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
860+
861+
@override
862+
String markAllAsReadConfirmationDialogMessage(int count) {
863+
String _temp0 = intl.Intl.pluralLogic(
864+
count,
865+
locale: localeName,
866+
other: '$count messages will be marked as read.',
867+
one: '$count message will be marked as read.',
868+
);
869+
return '$_temp0';
870+
}
871+
872+
@override
873+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
874+
858875
@override
859876
String get today => 'Heute';
860877

lib/generated/l10n/zulip_localizations_el.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,23 @@ class ZulipLocalizationsEl extends ZulipLocalizations {
836836
@override
837837
String get errorMarkAsUnreadFailedTitle => 'Mark as unread failed';
838838

839+
@override
840+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
841+
842+
@override
843+
String markAllAsReadConfirmationDialogMessage(int count) {
844+
String _temp0 = intl.Intl.pluralLogic(
845+
count,
846+
locale: localeName,
847+
other: '$count messages will be marked as read.',
848+
one: '$count message will be marked as read.',
849+
);
850+
return '$_temp0';
851+
}
852+
853+
@override
854+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
855+
839856
@override
840857
String get today => 'Today';
841858

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,23 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
836836
@override
837837
String get errorMarkAsUnreadFailedTitle => 'Mark as unread failed';
838838

839+
@override
840+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
841+
842+
@override
843+
String markAllAsReadConfirmationDialogMessage(int count) {
844+
String _temp0 = intl.Intl.pluralLogic(
845+
count,
846+
locale: localeName,
847+
other: '$count messages will be marked as read.',
848+
one: '$count message will be marked as read.',
849+
);
850+
return '$_temp0';
851+
}
852+
853+
@override
854+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
855+
839856
@override
840857
String get today => 'Today';
841858

lib/generated/l10n/zulip_localizations_es.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,23 @@ class ZulipLocalizationsEs extends ZulipLocalizations {
836836
@override
837837
String get errorMarkAsUnreadFailedTitle => 'Mark as unread failed';
838838

839+
@override
840+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
841+
842+
@override
843+
String markAllAsReadConfirmationDialogMessage(int count) {
844+
String _temp0 = intl.Intl.pluralLogic(
845+
count,
846+
locale: localeName,
847+
other: '$count messages will be marked as read.',
848+
one: '$count message will be marked as read.',
849+
);
850+
return '$_temp0';
851+
}
852+
853+
@override
854+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
855+
839856
@override
840857
String get today => 'Today';
841858

lib/generated/l10n/zulip_localizations_fr.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,23 @@ class ZulipLocalizationsFr extends ZulipLocalizations {
852852
@override
853853
String get errorMarkAsUnreadFailedTitle => 'Mark as unread failed';
854854

855+
@override
856+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
857+
858+
@override
859+
String markAllAsReadConfirmationDialogMessage(int count) {
860+
String _temp0 = intl.Intl.pluralLogic(
861+
count,
862+
locale: localeName,
863+
other: '$count messages will be marked as read.',
864+
one: '$count message will be marked as read.',
865+
);
866+
return '$_temp0';
867+
}
868+
869+
@override
870+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
871+
855872
@override
856873
String get today => 'Today';
857874

lib/generated/l10n/zulip_localizations_he.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,23 @@ class ZulipLocalizationsHe extends ZulipLocalizations {
836836
@override
837837
String get errorMarkAsUnreadFailedTitle => 'Mark as unread failed';
838838

839+
@override
840+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
841+
842+
@override
843+
String markAllAsReadConfirmationDialogMessage(int count) {
844+
String _temp0 = intl.Intl.pluralLogic(
845+
count,
846+
locale: localeName,
847+
other: '$count messages will be marked as read.',
848+
one: '$count message will be marked as read.',
849+
);
850+
return '$_temp0';
851+
}
852+
853+
@override
854+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
855+
839856
@override
840857
String get today => 'Today';
841858

lib/generated/l10n/zulip_localizations_hu.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,23 @@ class ZulipLocalizationsHu extends ZulipLocalizations {
836836
@override
837837
String get errorMarkAsUnreadFailedTitle => 'Mark as unread failed';
838838

839+
@override
840+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
841+
842+
@override
843+
String markAllAsReadConfirmationDialogMessage(int count) {
844+
String _temp0 = intl.Intl.pluralLogic(
845+
count,
846+
locale: localeName,
847+
other: '$count messages will be marked as read.',
848+
one: '$count message will be marked as read.',
849+
);
850+
return '$_temp0';
851+
}
852+
853+
@override
854+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
855+
839856
@override
840857
String get today => 'Today';
841858

0 commit comments

Comments
 (0)