Skip to content

Commit 9534695

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 9296fb3 commit 9534695

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
@@ -932,6 +932,24 @@
932932
"@errorMarkAsUnreadFailedTitle": {
933933
"description": "Error title when mark as unread action failed."
934934
},
935+
"markAllAsReadConfirmationDialogTitle": "Mark messages as read?",
936+
"@markAllAsReadConfirmationDialogTitle": {
937+
"description": "Title of the confirmation dialog for marking all messages as read."
938+
},
939+
"markAllAsReadConfirmationDialogMessage": "{count, plural, one{{count} message will be marked as read.} other{{count} messages will be marked as read.}}",
940+
"@markAllAsReadConfirmationDialogMessage": {
941+
"description": "Message in the confirmation dialog for marking all messages as read.",
942+
"placeholders": {
943+
"count": {
944+
"type": "int",
945+
"description": "Number of messages that will be marked as read"
946+
}
947+
}
948+
},
949+
"markAllAsReadConfirmationDialogConfirmButton": "Mark as read",
950+
"@markAllAsReadConfirmationDialogConfirmButton": {
951+
"description": "Label for the 'Mark as read' button on a confirmation dialog for marking all messages as read."
952+
},
935953
"today": "Today",
936954
"@today": {
937955
"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
@@ -1387,6 +1387,24 @@ abstract class ZulipLocalizations {
13871387
/// **'Mark as unread failed'**
13881388
String get errorMarkAsUnreadFailedTitle;
13891389

1390+
/// Title of the confirmation dialog for marking all messages as read.
1391+
///
1392+
/// In en, this message translates to:
1393+
/// **'Mark messages as read?'**
1394+
String get markAllAsReadConfirmationDialogTitle;
1395+
1396+
/// Message in the confirmation dialog for marking all messages as read.
1397+
///
1398+
/// In en, this message translates to:
1399+
/// **'{count, plural, one{{count} message will be marked as read.} other{{count} messages will be marked as read.}}'**
1400+
String markAllAsReadConfirmationDialogMessage(int count);
1401+
1402+
/// Label for the 'Mark as read' button on a confirmation dialog for marking all messages as read.
1403+
///
1404+
/// In en, this message translates to:
1405+
/// **'Mark as read'**
1406+
String get markAllAsReadConfirmationDialogConfirmButton;
1407+
13901408
/// Term to use to reference the current day.
13911409
///
13921410
/// 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
@@ -774,6 +774,23 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
774774
@override
775775
String get errorMarkAsUnreadFailedTitle => 'Mark as unread failed';
776776

777+
@override
778+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
779+
780+
@override
781+
String markAllAsReadConfirmationDialogMessage(int count) {
782+
String _temp0 = intl.Intl.pluralLogic(
783+
count,
784+
locale: localeName,
785+
other: '$count messages will be marked as read.',
786+
one: '$count message will be marked as read.',
787+
);
788+
return '$_temp0';
789+
}
790+
791+
@override
792+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
793+
777794
@override
778795
String get today => 'Today';
779796

lib/generated/l10n/zulip_localizations_de.dart

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

796+
@override
797+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
798+
799+
@override
800+
String markAllAsReadConfirmationDialogMessage(int count) {
801+
String _temp0 = intl.Intl.pluralLogic(
802+
count,
803+
locale: localeName,
804+
other: '$count messages will be marked as read.',
805+
one: '$count message will be marked as read.',
806+
);
807+
return '$_temp0';
808+
}
809+
810+
@override
811+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
812+
796813
@override
797814
String get today => 'Heute';
798815

lib/generated/l10n/zulip_localizations_el.dart

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

777+
@override
778+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
779+
780+
@override
781+
String markAllAsReadConfirmationDialogMessage(int count) {
782+
String _temp0 = intl.Intl.pluralLogic(
783+
count,
784+
locale: localeName,
785+
other: '$count messages will be marked as read.',
786+
one: '$count message will be marked as read.',
787+
);
788+
return '$_temp0';
789+
}
790+
791+
@override
792+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
793+
777794
@override
778795
String get today => 'Today';
779796

lib/generated/l10n/zulip_localizations_en.dart

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

777+
@override
778+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
779+
780+
@override
781+
String markAllAsReadConfirmationDialogMessage(int count) {
782+
String _temp0 = intl.Intl.pluralLogic(
783+
count,
784+
locale: localeName,
785+
other: '$count messages will be marked as read.',
786+
one: '$count message will be marked as read.',
787+
);
788+
return '$_temp0';
789+
}
790+
791+
@override
792+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
793+
777794
@override
778795
String get today => 'Today';
779796

lib/generated/l10n/zulip_localizations_es.dart

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

777+
@override
778+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
779+
780+
@override
781+
String markAllAsReadConfirmationDialogMessage(int count) {
782+
String _temp0 = intl.Intl.pluralLogic(
783+
count,
784+
locale: localeName,
785+
other: '$count messages will be marked as read.',
786+
one: '$count message will be marked as read.',
787+
);
788+
return '$_temp0';
789+
}
790+
791+
@override
792+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
793+
777794
@override
778795
String get today => 'Today';
779796

lib/generated/l10n/zulip_localizations_fr.dart

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

793+
@override
794+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
795+
796+
@override
797+
String markAllAsReadConfirmationDialogMessage(int count) {
798+
String _temp0 = intl.Intl.pluralLogic(
799+
count,
800+
locale: localeName,
801+
other: '$count messages will be marked as read.',
802+
one: '$count message will be marked as read.',
803+
);
804+
return '$_temp0';
805+
}
806+
807+
@override
808+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
809+
793810
@override
794811
String get today => 'Today';
795812

lib/generated/l10n/zulip_localizations_he.dart

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

777+
@override
778+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
779+
780+
@override
781+
String markAllAsReadConfirmationDialogMessage(int count) {
782+
String _temp0 = intl.Intl.pluralLogic(
783+
count,
784+
locale: localeName,
785+
other: '$count messages will be marked as read.',
786+
one: '$count message will be marked as read.',
787+
);
788+
return '$_temp0';
789+
}
790+
791+
@override
792+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
793+
777794
@override
778795
String get today => 'Today';
779796

lib/generated/l10n/zulip_localizations_hu.dart

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

777+
@override
778+
String get markAllAsReadConfirmationDialogTitle => 'Mark messages as read?';
779+
780+
@override
781+
String markAllAsReadConfirmationDialogMessage(int count) {
782+
String _temp0 = intl.Intl.pluralLogic(
783+
count,
784+
locale: localeName,
785+
other: '$count messages will be marked as read.',
786+
one: '$count message will be marked as read.',
787+
);
788+
return '$_temp0';
789+
}
790+
791+
@override
792+
String get markAllAsReadConfirmationDialogConfirmButton => 'Mark as read';
793+
777794
@override
778795
String get today => 'Today';
779796

0 commit comments

Comments
 (0)