Skip to content

Commit 723a458

Browse files
action sheet: Add Report message button.
Add a Report message button to the message action sheet that allows users to report messages to moderators. The button is only visible when the realm has a moderation request channel configured (channel ID > 0). When tapped, a bottom sheet appears allowing the user to: - Select a report reason (spam, harassment, inappropriate content, violates community norms, or other) - Optionally provide additional details The UI follows the existing bottom sheet pattern used in the app (similar to NewDmPicker). Fixes: #1972
1 parent 154d4c8 commit 723a458

21 files changed

+1060
-0
lines changed

assets/l10n/app_en.arb

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,54 @@
297297
"@errorDeleteMessageFailedTitle": {
298298
"description": "Error title when deleting a message failed."
299299
},
300+
"actionSheetOptionReportMessage": "Report message",
301+
"@actionSheetOptionReportMessage": {
302+
"description": "Label for the 'Report message' button in the message action sheet."
303+
},
304+
"errorReportMessageFailedTitle": "Failed to report message",
305+
"@errorReportMessageFailedTitle": {
306+
"description": "Error title when reporting a message failed."
307+
},
308+
"reportMessageDialogTitle": "Report a message",
309+
"@reportMessageDialogTitle": {
310+
"description": "Title for the report message dialog."
311+
},
312+
"reportMessageDialogDescription": "Your report will be sent to the private moderation requests channel for this organization.",
313+
"@reportMessageDialogDescription": {
314+
"description": "Description text in the report message dialog."
315+
},
316+
"reportMessageReasonLabel": "What's the problem with this message?",
317+
"@reportMessageReasonLabel": {
318+
"description": "Label for the reason dropdown in the report message dialog."
319+
},
320+
"reportMessageReasonSpam": "Spam",
321+
"@reportMessageReasonSpam": {
322+
"description": "Report reason option: Spam"
323+
},
324+
"reportMessageReasonHarassment": "Harassment",
325+
"@reportMessageReasonHarassment": {
326+
"description": "Report reason option: Harassment"
327+
},
328+
"reportMessageReasonInappropriate": "Inappropriate content",
329+
"@reportMessageReasonInappropriate": {
330+
"description": "Report reason option: Inappropriate content"
331+
},
332+
"reportMessageReasonNorms": "Violates community norms",
333+
"@reportMessageReasonNorms": {
334+
"description": "Report reason option: Violates community norms"
335+
},
336+
"reportMessageReasonOther": "Other reason",
337+
"@reportMessageReasonOther": {
338+
"description": "Report reason option: Other reason"
339+
},
340+
"reportMessageDetailsLabel": "Can you provide more details?",
341+
"@reportMessageDetailsLabel": {
342+
"description": "Label for the optional details text field in the report message dialog."
343+
},
344+
"reportMessageSubmitButton": "Submit",
345+
"@reportMessageSubmitButton": {
346+
"description": "Label for the submit button in the report message dialog."
347+
},
300348
"actionSheetOptionMarkTopicAsRead": "Mark topic as read",
301349
"@actionSheetOptionMarkTopicAsRead": {
302350
"description": "Option to mark a specific topic as read in the action sheet."

lib/generated/l10n/zulip_localizations.dart

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,78 @@ abstract class ZulipLocalizations {
561561
/// **'Failed to delete message'**
562562
String get errorDeleteMessageFailedTitle;
563563

564+
/// Label for the 'Report message' button in the message action sheet.
565+
///
566+
/// In en, this message translates to:
567+
/// **'Report message'**
568+
String get actionSheetOptionReportMessage;
569+
570+
/// Error title when reporting a message failed.
571+
///
572+
/// In en, this message translates to:
573+
/// **'Failed to report message'**
574+
String get errorReportMessageFailedTitle;
575+
576+
/// Title for the report message dialog.
577+
///
578+
/// In en, this message translates to:
579+
/// **'Report a message'**
580+
String get reportMessageDialogTitle;
581+
582+
/// Description text in the report message dialog.
583+
///
584+
/// In en, this message translates to:
585+
/// **'Your report will be sent to the private moderation requests channel for this organization.'**
586+
String get reportMessageDialogDescription;
587+
588+
/// Label for the reason dropdown in the report message dialog.
589+
///
590+
/// In en, this message translates to:
591+
/// **'What\'s the problem with this message?'**
592+
String get reportMessageReasonLabel;
593+
594+
/// Report reason option: Spam
595+
///
596+
/// In en, this message translates to:
597+
/// **'Spam'**
598+
String get reportMessageReasonSpam;
599+
600+
/// Report reason option: Harassment
601+
///
602+
/// In en, this message translates to:
603+
/// **'Harassment'**
604+
String get reportMessageReasonHarassment;
605+
606+
/// Report reason option: Inappropriate content
607+
///
608+
/// In en, this message translates to:
609+
/// **'Inappropriate content'**
610+
String get reportMessageReasonInappropriate;
611+
612+
/// Report reason option: Violates community norms
613+
///
614+
/// In en, this message translates to:
615+
/// **'Violates community norms'**
616+
String get reportMessageReasonNorms;
617+
618+
/// Report reason option: Other reason
619+
///
620+
/// In en, this message translates to:
621+
/// **'Other reason'**
622+
String get reportMessageReasonOther;
623+
624+
/// Label for the optional details text field in the report message dialog.
625+
///
626+
/// In en, this message translates to:
627+
/// **'Can you provide more details?'**
628+
String get reportMessageDetailsLabel;
629+
630+
/// Label for the submit button in the report message dialog.
631+
///
632+
/// In en, this message translates to:
633+
/// **'Submit'**
634+
String get reportMessageSubmitButton;
635+
564636
/// Option to mark a specific topic as read in the action sheet.
565637
///
566638
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,44 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
253253
@override
254254
String get errorDeleteMessageFailedTitle => 'Failed to delete message';
255255

256+
@override
257+
String get actionSheetOptionReportMessage => 'Report message';
258+
259+
@override
260+
String get errorReportMessageFailedTitle => 'Failed to report message';
261+
262+
@override
263+
String get reportMessageDialogTitle => 'Report a message';
264+
265+
@override
266+
String get reportMessageDialogDescription =>
267+
'Your report will be sent to the private moderation requests channel for this organization.';
268+
269+
@override
270+
String get reportMessageReasonLabel =>
271+
'What\'s the problem with this message?';
272+
273+
@override
274+
String get reportMessageReasonSpam => 'Spam';
275+
276+
@override
277+
String get reportMessageReasonHarassment => 'Harassment';
278+
279+
@override
280+
String get reportMessageReasonInappropriate => 'Inappropriate content';
281+
282+
@override
283+
String get reportMessageReasonNorms => 'Violates community norms';
284+
285+
@override
286+
String get reportMessageReasonOther => 'Other reason';
287+
288+
@override
289+
String get reportMessageDetailsLabel => 'Can you provide more details?';
290+
291+
@override
292+
String get reportMessageSubmitButton => 'Submit';
293+
256294
@override
257295
String get actionSheetOptionMarkTopicAsRead => 'Mark topic as read';
258296

lib/generated/l10n/zulip_localizations_de.dart

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,44 @@ class ZulipLocalizationsDe extends ZulipLocalizations {
261261
String get errorDeleteMessageFailedTitle =>
262262
'Löschen der Nachricht fehlgeschlagen';
263263

264+
@override
265+
String get actionSheetOptionReportMessage => 'Report message';
266+
267+
@override
268+
String get errorReportMessageFailedTitle => 'Failed to report message';
269+
270+
@override
271+
String get reportMessageDialogTitle => 'Report a message';
272+
273+
@override
274+
String get reportMessageDialogDescription =>
275+
'Your report will be sent to the private moderation requests channel for this organization.';
276+
277+
@override
278+
String get reportMessageReasonLabel =>
279+
'What\'s the problem with this message?';
280+
281+
@override
282+
String get reportMessageReasonSpam => 'Spam';
283+
284+
@override
285+
String get reportMessageReasonHarassment => 'Harassment';
286+
287+
@override
288+
String get reportMessageReasonInappropriate => 'Inappropriate content';
289+
290+
@override
291+
String get reportMessageReasonNorms => 'Violates community norms';
292+
293+
@override
294+
String get reportMessageReasonOther => 'Other reason';
295+
296+
@override
297+
String get reportMessageDetailsLabel => 'Can you provide more details?';
298+
299+
@override
300+
String get reportMessageSubmitButton => 'Submit';
301+
264302
@override
265303
String get actionSheetOptionMarkTopicAsRead => 'Thema als gelesen markieren';
266304

lib/generated/l10n/zulip_localizations_el.dart

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,44 @@ class ZulipLocalizationsEl extends ZulipLocalizations {
253253
@override
254254
String get errorDeleteMessageFailedTitle => 'Failed to delete message';
255255

256+
@override
257+
String get actionSheetOptionReportMessage => 'Report message';
258+
259+
@override
260+
String get errorReportMessageFailedTitle => 'Failed to report message';
261+
262+
@override
263+
String get reportMessageDialogTitle => 'Report a message';
264+
265+
@override
266+
String get reportMessageDialogDescription =>
267+
'Your report will be sent to the private moderation requests channel for this organization.';
268+
269+
@override
270+
String get reportMessageReasonLabel =>
271+
'What\'s the problem with this message?';
272+
273+
@override
274+
String get reportMessageReasonSpam => 'Spam';
275+
276+
@override
277+
String get reportMessageReasonHarassment => 'Harassment';
278+
279+
@override
280+
String get reportMessageReasonInappropriate => 'Inappropriate content';
281+
282+
@override
283+
String get reportMessageReasonNorms => 'Violates community norms';
284+
285+
@override
286+
String get reportMessageReasonOther => 'Other reason';
287+
288+
@override
289+
String get reportMessageDetailsLabel => 'Can you provide more details?';
290+
291+
@override
292+
String get reportMessageSubmitButton => 'Submit';
293+
256294
@override
257295
String get actionSheetOptionMarkTopicAsRead => 'Mark topic as read';
258296

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,44 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
253253
@override
254254
String get errorDeleteMessageFailedTitle => 'Failed to delete message';
255255

256+
@override
257+
String get actionSheetOptionReportMessage => 'Report message';
258+
259+
@override
260+
String get errorReportMessageFailedTitle => 'Failed to report message';
261+
262+
@override
263+
String get reportMessageDialogTitle => 'Report a message';
264+
265+
@override
266+
String get reportMessageDialogDescription =>
267+
'Your report will be sent to the private moderation requests channel for this organization.';
268+
269+
@override
270+
String get reportMessageReasonLabel =>
271+
'What\'s the problem with this message?';
272+
273+
@override
274+
String get reportMessageReasonSpam => 'Spam';
275+
276+
@override
277+
String get reportMessageReasonHarassment => 'Harassment';
278+
279+
@override
280+
String get reportMessageReasonInappropriate => 'Inappropriate content';
281+
282+
@override
283+
String get reportMessageReasonNorms => 'Violates community norms';
284+
285+
@override
286+
String get reportMessageReasonOther => 'Other reason';
287+
288+
@override
289+
String get reportMessageDetailsLabel => 'Can you provide more details?';
290+
291+
@override
292+
String get reportMessageSubmitButton => 'Submit';
293+
256294
@override
257295
String get actionSheetOptionMarkTopicAsRead => 'Mark topic as read';
258296

lib/generated/l10n/zulip_localizations_es.dart

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,44 @@ class ZulipLocalizationsEs extends ZulipLocalizations {
253253
@override
254254
String get errorDeleteMessageFailedTitle => 'Failed to delete message';
255255

256+
@override
257+
String get actionSheetOptionReportMessage => 'Report message';
258+
259+
@override
260+
String get errorReportMessageFailedTitle => 'Failed to report message';
261+
262+
@override
263+
String get reportMessageDialogTitle => 'Report a message';
264+
265+
@override
266+
String get reportMessageDialogDescription =>
267+
'Your report will be sent to the private moderation requests channel for this organization.';
268+
269+
@override
270+
String get reportMessageReasonLabel =>
271+
'What\'s the problem with this message?';
272+
273+
@override
274+
String get reportMessageReasonSpam => 'Spam';
275+
276+
@override
277+
String get reportMessageReasonHarassment => 'Harassment';
278+
279+
@override
280+
String get reportMessageReasonInappropriate => 'Inappropriate content';
281+
282+
@override
283+
String get reportMessageReasonNorms => 'Violates community norms';
284+
285+
@override
286+
String get reportMessageReasonOther => 'Other reason';
287+
288+
@override
289+
String get reportMessageDetailsLabel => 'Can you provide more details?';
290+
291+
@override
292+
String get reportMessageSubmitButton => 'Submit';
293+
256294
@override
257295
String get actionSheetOptionMarkTopicAsRead => 'Mark topic as read';
258296

0 commit comments

Comments
 (0)