Skip to content

Commit ec9196d

Browse files
author
chimnayajith
committed
reactions: Add sheet to view who reacted to a message
Fixes #740
1 parent 27a000c commit ec9196d

13 files changed

+467
-14
lines changed

assets/l10n/app_en.arb

+8
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@
104104
"@actionSheetOptionShare": {
105105
"description": "Label for share button on action sheet."
106106
},
107+
"actionSheetOptionViewReactions": "See who reacted",
108+
"@actionSheetOptionViewReactions": {
109+
"description": "Label for View Reactions button on action sheet."
110+
},
107111
"actionSheetOptionQuoteAndReply": "Quote and reply",
108112
"@actionSheetOptionQuoteAndReply": {
109113
"description": "Label for Quote and reply button on action sheet."
@@ -116,6 +120,10 @@
116120
"@actionSheetOptionUnstarMessage": {
117121
"description": "Label for unstar button on action sheet."
118122
},
123+
"reactionSheetEmptyReactions": "No reactions yet",
124+
"@reactionSheetEmptyReactions": {
125+
"description": "Text to display when the reactions sheet is open, but there are no reactions to show."
126+
},
119127
"errorWebAuthOperationalErrorTitle": "Something went wrong",
120128
"@errorWebAuthOperationalErrorTitle": {
121129
"description": "Error title when third-party authentication has an operational error (not necessarily caused by invalid credentials)."

lib/generated/l10n/zulip_localizations.dart

+12
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,12 @@ abstract class ZulipLocalizations {
261261
/// **'Share'**
262262
String get actionSheetOptionShare;
263263

264+
/// Label for View Reactions button on action sheet.
265+
///
266+
/// In en, this message translates to:
267+
/// **'See who reacted'**
268+
String get actionSheetOptionViewReactions;
269+
264270
/// Label for Quote and reply button on action sheet.
265271
///
266272
/// In en, this message translates to:
@@ -279,6 +285,12 @@ abstract class ZulipLocalizations {
279285
/// **'Unstar message'**
280286
String get actionSheetOptionUnstarMessage;
281287

288+
/// Text to display when the reactions sheet is open, but there are no reactions to show.
289+
///
290+
/// In en, this message translates to:
291+
/// **'No reactions yet'**
292+
String get reactionSheetEmptyReactions;
293+
282294
/// Error title when third-party authentication has an operational error (not necessarily caused by invalid credentials).
283295
///
284296
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

+6
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
8888
@override
8989
String get actionSheetOptionShare => 'Share';
9090

91+
@override
92+
String get actionSheetOptionViewReactions => 'See who reacted';
93+
9194
@override
9295
String get actionSheetOptionQuoteAndReply => 'Quote and reply';
9396

@@ -97,6 +100,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
97100
@override
98101
String get actionSheetOptionUnstarMessage => 'Unstar message';
99102

103+
@override
104+
String get reactionSheetEmptyReactions => 'No reactions yet';
105+
100106
@override
101107
String get errorWebAuthOperationalErrorTitle => 'Something went wrong';
102108

lib/generated/l10n/zulip_localizations_en.dart

+6
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
8888
@override
8989
String get actionSheetOptionShare => 'Share';
9090

91+
@override
92+
String get actionSheetOptionViewReactions => 'See who reacted';
93+
9194
@override
9295
String get actionSheetOptionQuoteAndReply => 'Quote and reply';
9396

@@ -97,6 +100,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
97100
@override
98101
String get actionSheetOptionUnstarMessage => 'Unstar message';
99102

103+
@override
104+
String get reactionSheetEmptyReactions => 'No reactions yet';
105+
100106
@override
101107
String get errorWebAuthOperationalErrorTitle => 'Something went wrong';
102108

lib/generated/l10n/zulip_localizations_ja.dart

+6
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
8888
@override
8989
String get actionSheetOptionShare => 'Share';
9090

91+
@override
92+
String get actionSheetOptionViewReactions => 'See who reacted';
93+
9194
@override
9295
String get actionSheetOptionQuoteAndReply => 'Quote and reply';
9396

@@ -97,6 +100,9 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
97100
@override
98101
String get actionSheetOptionUnstarMessage => 'Unstar message';
99102

103+
@override
104+
String get reactionSheetEmptyReactions => 'No reactions yet';
105+
100106
@override
101107
String get errorWebAuthOperationalErrorTitle => 'Something went wrong';
102108

lib/generated/l10n/zulip_localizations_nb.dart

+6
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
8888
@override
8989
String get actionSheetOptionShare => 'Share';
9090

91+
@override
92+
String get actionSheetOptionViewReactions => 'See who reacted';
93+
9194
@override
9295
String get actionSheetOptionQuoteAndReply => 'Quote and reply';
9396

@@ -97,6 +100,9 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
97100
@override
98101
String get actionSheetOptionUnstarMessage => 'Unstar message';
99102

103+
@override
104+
String get reactionSheetEmptyReactions => 'No reactions yet';
105+
100106
@override
101107
String get errorWebAuthOperationalErrorTitle => 'Something went wrong';
102108

lib/generated/l10n/zulip_localizations_pl.dart

+6
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
8888
@override
8989
String get actionSheetOptionShare => 'Udostępnij';
9090

91+
@override
92+
String get actionSheetOptionViewReactions => 'See who reacted';
93+
9194
@override
9295
String get actionSheetOptionQuoteAndReply => 'Odpowiedz cytując';
9396

@@ -97,6 +100,9 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
97100
@override
98101
String get actionSheetOptionUnstarMessage => 'Odbierz gwiazdkę';
99102

103+
@override
104+
String get reactionSheetEmptyReactions => 'No reactions yet';
105+
100106
@override
101107
String get errorWebAuthOperationalErrorTitle => 'Coś poszło nie tak';
102108

lib/generated/l10n/zulip_localizations_ru.dart

+6
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
8888
@override
8989
String get actionSheetOptionShare => 'Поделиться';
9090

91+
@override
92+
String get actionSheetOptionViewReactions => 'See who reacted';
93+
9194
@override
9295
String get actionSheetOptionQuoteAndReply => 'Ответить с цитированием';
9396

@@ -97,6 +100,9 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
97100
@override
98101
String get actionSheetOptionUnstarMessage => 'Снять отметку с сообщения';
99102

103+
@override
104+
String get reactionSheetEmptyReactions => 'No reactions yet';
105+
100106
@override
101107
String get errorWebAuthOperationalErrorTitle => 'Что-то пошло не так';
102108

lib/generated/l10n/zulip_localizations_sk.dart

+6
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
8888
@override
8989
String get actionSheetOptionShare => 'Zdielať';
9090

91+
@override
92+
String get actionSheetOptionViewReactions => 'See who reacted';
93+
9194
@override
9295
String get actionSheetOptionQuoteAndReply => 'Citovať a odpovedať';
9396

@@ -97,6 +100,9 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
97100
@override
98101
String get actionSheetOptionUnstarMessage => 'Odhviezdičkovať správu';
99102

103+
@override
104+
String get reactionSheetEmptyReactions => 'No reactions yet';
105+
100106
@override
101107
String get errorWebAuthOperationalErrorTitle => 'Niečo sa pokazilo';
102108

lib/widgets/action_sheet.dart

+21
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,8 @@ void showMessageActionSheet({required BuildContext context, required Message mes
392392

393393
final optionButtons = [
394394
ReactionButtons(message: message, pageContext: context),
395+
if((message.reactions?.total ?? 0) > 0)
396+
ViewReactionsButton(message: message, pageContext: context),
395397
StarButton(message: message, pageContext: context),
396398
if (isComposeBoxOffered)
397399
QuoteAndReplyButton(message: message, pageContext: context),
@@ -692,6 +694,25 @@ class QuoteAndReplyButton extends MessageActionSheetMenuItemButton {
692694
}
693695
}
694696

697+
class ViewReactionsButton extends MessageActionSheetMenuItemButton {
698+
ViewReactionsButton({super.key, required super.message, required super.pageContext});
699+
700+
@override IconData get icon => ZulipIcons.reactions;
701+
702+
@override
703+
String label(ZulipLocalizations zulipLocalizations) {
704+
return zulipLocalizations.actionSheetOptionViewReactions;
705+
}
706+
707+
@override void onPressed() async {
708+
showReactionListSheet(
709+
pageContext,
710+
messageId: message.id,
711+
messageListView: MessageListPage.ancestorOf(pageContext).model,
712+
);
713+
}
714+
}
715+
695716
class MarkAsUnreadButton extends MessageActionSheetMenuItemButton {
696717
MarkAsUnreadButton({super.key, required super.message, required super.pageContext});
697718

0 commit comments

Comments
 (0)