Skip to content

Commit 44a1df7

Browse files
committed
compose: Support editing an already-sent message
Fixes: #126
1 parent af36660 commit 44a1df7

19 files changed

+1735
-21
lines changed

assets/l10n/app_en.arb

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@
144144
"@actionSheetOptionUnstarMessage": {
145145
"description": "Label for unstar button on action sheet."
146146
},
147+
"actionSheetOptionEditMessage": "Edit message",
148+
"@actionSheetOptionEditMessage": {
149+
"description": "Label for the 'Edit message' button in the message action sheet."
150+
},
147151
"actionSheetOptionMarkTopicAsRead": "Mark topic as read",
148152
"@actionSheetOptionMarkTopicAsRead": {
149153
"description": "Option to mark a specific topic as read in the action sheet."
@@ -219,6 +223,10 @@
219223
"@errorMessageNotSent": {
220224
"description": "Error message for compose box when a message could not be sent."
221225
},
226+
"errorMessageEditNotSaved": "Message not saved",
227+
"@errorMessageEditNotSaved": {
228+
"description": "Error message for compose box when a message edit could not be saved."
229+
},
222230
"errorLoginCouldNotConnect": "Failed to connect to server:\n{url}",
223231
"@errorLoginCouldNotConnect": {
224232
"description": "Error message when the app could not connect to the server.",
@@ -309,6 +317,10 @@
309317
"@errorUnstarMessageFailedTitle": {
310318
"description": "Error title when unstarring a message failed."
311319
},
320+
"errorCouldNotEditMessageTitle": "Could not edit message",
321+
"@errorCouldNotEditMessageTitle": {
322+
"description": "Error title when an exception prevented us from opening the compose box for editing a message."
323+
},
312324
"successLinkCopied": "Link copied",
313325
"@successLinkCopied": {
314326
"description": "Success message after copy link action completed."
@@ -329,6 +341,46 @@
329341
"@errorBannerCannotPostInChannelLabel": {
330342
"description": "Error-banner text replacing the compose box when you do not have permission to send a message to the channel."
331343
},
344+
"composeBoxBannerLabelEditMessage": "Edit message",
345+
"@composeBoxBannerLabelEditMessage": {
346+
"description": "Label text for the compose-box banner when you are editing a message."
347+
},
348+
"composeBoxBannerButtonCancel": "Cancel",
349+
"@composeBoxBannerButtonCancel": {
350+
"description": "Label text for the 'Cancel' button in the compose-box banner when you are editing a message."
351+
},
352+
"composeBoxBannerButtonSave": "Save",
353+
"@composeBoxBannerButtonSave": {
354+
"description": "Label text for the 'Save' button in the compose-box banner when you are editing a message."
355+
},
356+
"editAlreadyInProgressTitle": "Cannot edit message",
357+
"@editAlreadyInProgressTitle": {
358+
"description": "Error title when a message edit cannot be saved because there is another edit already in progress."
359+
},
360+
"editAlreadyInProgressMessage": "An edit is already in progress. Please wait for it to complete.",
361+
"@editAlreadyInProgressMessage": {
362+
"description": "Error message when a message edit cannot be saved because there is another edit already in progress."
363+
},
364+
"savingMessageEditLabel": "SAVING EDIT…",
365+
"@savingMessageEditLabel": {
366+
"description": "Text on a message in the message list saying that a message edit request is processing. (Use ALL CAPS for cased alphabets: Latin, Greek, Cyrillic, etc.)"
367+
},
368+
"savingMessageEditFailedLabel": "EDIT NOT SAVED",
369+
"@savingMessageEditFailedLabel": {
370+
"description": "Text on a message in the message list saying that a message edit request failed. (Use ALL CAPS for cased alphabets: Latin, Greek, Cyrillic, etc.)"
371+
},
372+
"discardDraftConfirmationDialogTitle": "Discard the message you’re writing?",
373+
"@discardDraftConfirmationDialogTitle": {
374+
"description": "Title for a confirmation dialog for discarding message text that was typed into the compose box."
375+
},
376+
"discardDraftConfirmationDialogMessage": "When you edit a message, the content that was previously in the compose box is discarded.",
377+
"@discardDraftConfirmationDialogMessage": {
378+
"description": "Message for a confirmation dialog for discarding message text that was typed into the compose box."
379+
},
380+
"discardDraftConfirmationDialogConfirmButton": "Discard",
381+
"@discardDraftConfirmationDialogConfirmButton": {
382+
"description": "Label for the 'Discard' button on a confirmation dialog for discarding message text that was typed into the compose box."
383+
},
332384
"composeBoxAttachFilesTooltip": "Attach files",
333385
"@composeBoxAttachFilesTooltip": {
334386
"description": "Tooltip for compose box icon to attach a file to the message."
@@ -367,6 +419,10 @@
367419
"destination": {"type": "String", "example": "#channel name > topic name"}
368420
}
369421
},
422+
"preparingEditMessageContentInput": "Preparing…",
423+
"@preparingEditMessageContentInput": {
424+
"description": "Hint text for content input when the compose box is preparing to edit a message."
425+
},
370426
"composeBoxSendTooltip": "Send",
371427
"@composeBoxSendTooltip": {
372428
"description": "Tooltip for send button in compose box."

lib/generated/l10n/zulip_localizations.dart

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,12 @@ abstract class ZulipLocalizations {
326326
/// **'Unstar message'**
327327
String get actionSheetOptionUnstarMessage;
328328

329+
/// Label for the 'Edit message' button in the message action sheet.
330+
///
331+
/// In en, this message translates to:
332+
/// **'Edit message'**
333+
String get actionSheetOptionEditMessage;
334+
329335
/// Option to mark a specific topic as read in the action sheet.
330336
///
331337
/// In en, this message translates to:
@@ -414,6 +420,12 @@ abstract class ZulipLocalizations {
414420
/// **'Message not sent'**
415421
String get errorMessageNotSent;
416422

423+
/// Error message for compose box when a message edit could not be saved.
424+
///
425+
/// In en, this message translates to:
426+
/// **'Message not saved'**
427+
String get errorMessageEditNotSaved;
428+
417429
/// Error message when the app could not connect to the server.
418430
///
419431
/// In en, this message translates to:
@@ -526,6 +538,12 @@ abstract class ZulipLocalizations {
526538
/// **'Failed to unstar message'**
527539
String get errorUnstarMessageFailedTitle;
528540

541+
/// Error title when an exception prevented us from opening the compose box for editing a message.
542+
///
543+
/// In en, this message translates to:
544+
/// **'Could not edit message'**
545+
String get errorCouldNotEditMessageTitle;
546+
529547
/// Success message after copy link action completed.
530548
///
531549
/// In en, this message translates to:
@@ -556,6 +574,66 @@ abstract class ZulipLocalizations {
556574
/// **'You do not have permission to post in this channel.'**
557575
String get errorBannerCannotPostInChannelLabel;
558576

577+
/// Label text for the compose-box banner when you are editing a message.
578+
///
579+
/// In en, this message translates to:
580+
/// **'Edit message'**
581+
String get composeBoxBannerLabelEditMessage;
582+
583+
/// Label text for the 'Cancel' button in the compose-box banner when you are editing a message.
584+
///
585+
/// In en, this message translates to:
586+
/// **'Cancel'**
587+
String get composeBoxBannerButtonCancel;
588+
589+
/// Label text for the 'Save' button in the compose-box banner when you are editing a message.
590+
///
591+
/// In en, this message translates to:
592+
/// **'Save'**
593+
String get composeBoxBannerButtonSave;
594+
595+
/// Error title when a message edit cannot be saved because there is another edit already in progress.
596+
///
597+
/// In en, this message translates to:
598+
/// **'Cannot edit message'**
599+
String get editAlreadyInProgressTitle;
600+
601+
/// Error message when a message edit cannot be saved because there is another edit already in progress.
602+
///
603+
/// In en, this message translates to:
604+
/// **'An edit is already in progress. Please wait for it to complete.'**
605+
String get editAlreadyInProgressMessage;
606+
607+
/// Text on a message in the message list saying that a message edit request is processing. (Use ALL CAPS for cased alphabets: Latin, Greek, Cyrillic, etc.)
608+
///
609+
/// In en, this message translates to:
610+
/// **'SAVING EDIT…'**
611+
String get savingMessageEditLabel;
612+
613+
/// Text on a message in the message list saying that a message edit request failed. (Use ALL CAPS for cased alphabets: Latin, Greek, Cyrillic, etc.)
614+
///
615+
/// In en, this message translates to:
616+
/// **'EDIT NOT SAVED'**
617+
String get savingMessageEditFailedLabel;
618+
619+
/// Title for a confirmation dialog for discarding message text that was typed into the compose box.
620+
///
621+
/// In en, this message translates to:
622+
/// **'Discard the message you’re writing?'**
623+
String get discardDraftConfirmationDialogTitle;
624+
625+
/// Message for a confirmation dialog for discarding message text that was typed into the compose box.
626+
///
627+
/// In en, this message translates to:
628+
/// **'When you edit a message, the content that was previously in the compose box is discarded.'**
629+
String get discardDraftConfirmationDialogMessage;
630+
631+
/// Label for the 'Discard' button on a confirmation dialog for discarding message text that was typed into the compose box.
632+
///
633+
/// In en, this message translates to:
634+
/// **'Discard'**
635+
String get discardDraftConfirmationDialogConfirmButton;
636+
559637
/// Tooltip for compose box icon to attach a file to the message.
560638
///
561639
/// In en, this message translates to:
@@ -604,6 +682,12 @@ abstract class ZulipLocalizations {
604682
/// **'Message {destination}'**
605683
String composeBoxChannelContentHint(String destination);
606684

685+
/// Hint text for content input when the compose box is preparing to edit a message.
686+
///
687+
/// In en, this message translates to:
688+
/// **'Preparing…'**
689+
String get preparingEditMessageContentInput;
690+
607691
/// Tooltip for send button in compose box.
608692
///
609693
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
122122
@override
123123
String get actionSheetOptionUnstarMessage => 'Unstar message';
124124

125+
@override
126+
String get actionSheetOptionEditMessage => 'Edit message';
127+
125128
@override
126129
String get actionSheetOptionMarkTopicAsRead => 'Mark topic as read';
127130

@@ -191,6 +194,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
191194
@override
192195
String get errorMessageNotSent => 'Message not sent';
193196

197+
@override
198+
String get errorMessageEditNotSaved => 'Message not saved';
199+
194200
@override
195201
String errorLoginCouldNotConnect(String url) {
196202
return 'Failed to connect to server:\n$url';
@@ -262,6 +268,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
262268
@override
263269
String get errorUnstarMessageFailedTitle => 'Failed to unstar message';
264270

271+
@override
272+
String get errorCouldNotEditMessageTitle => 'Could not edit message';
273+
265274
@override
266275
String get successLinkCopied => 'Link copied';
267276

@@ -279,6 +288,39 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
279288
String get errorBannerCannotPostInChannelLabel =>
280289
'You do not have permission to post in this channel.';
281290

291+
@override
292+
String get composeBoxBannerLabelEditMessage => 'Edit message';
293+
294+
@override
295+
String get composeBoxBannerButtonCancel => 'Cancel';
296+
297+
@override
298+
String get composeBoxBannerButtonSave => 'Save';
299+
300+
@override
301+
String get editAlreadyInProgressTitle => 'Cannot edit message';
302+
303+
@override
304+
String get editAlreadyInProgressMessage =>
305+
'An edit is already in progress. Please wait for it to complete.';
306+
307+
@override
308+
String get savingMessageEditLabel => 'SAVING EDIT…';
309+
310+
@override
311+
String get savingMessageEditFailedLabel => 'EDIT NOT SAVED';
312+
313+
@override
314+
String get discardDraftConfirmationDialogTitle =>
315+
'Discard the message you’re writing?';
316+
317+
@override
318+
String get discardDraftConfirmationDialogMessage =>
319+
'When you edit a message, the content that was previously in the compose box is discarded.';
320+
321+
@override
322+
String get discardDraftConfirmationDialogConfirmButton => 'Discard';
323+
282324
@override
283325
String get composeBoxAttachFilesTooltip => 'Attach files';
284326

@@ -307,6 +349,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
307349
return 'Message $destination';
308350
}
309351

352+
@override
353+
String get preparingEditMessageContentInput => 'Preparing…';
354+
310355
@override
311356
String get composeBoxSendTooltip => 'Send';
312357

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
122122
@override
123123
String get actionSheetOptionUnstarMessage => 'Unstar message';
124124

125+
@override
126+
String get actionSheetOptionEditMessage => 'Edit message';
127+
125128
@override
126129
String get actionSheetOptionMarkTopicAsRead => 'Mark topic as read';
127130

@@ -191,6 +194,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
191194
@override
192195
String get errorMessageNotSent => 'Message not sent';
193196

197+
@override
198+
String get errorMessageEditNotSaved => 'Message not saved';
199+
194200
@override
195201
String errorLoginCouldNotConnect(String url) {
196202
return 'Failed to connect to server:\n$url';
@@ -262,6 +268,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
262268
@override
263269
String get errorUnstarMessageFailedTitle => 'Failed to unstar message';
264270

271+
@override
272+
String get errorCouldNotEditMessageTitle => 'Could not edit message';
273+
265274
@override
266275
String get successLinkCopied => 'Link copied';
267276

@@ -279,6 +288,39 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
279288
String get errorBannerCannotPostInChannelLabel =>
280289
'You do not have permission to post in this channel.';
281290

291+
@override
292+
String get composeBoxBannerLabelEditMessage => 'Edit message';
293+
294+
@override
295+
String get composeBoxBannerButtonCancel => 'Cancel';
296+
297+
@override
298+
String get composeBoxBannerButtonSave => 'Save';
299+
300+
@override
301+
String get editAlreadyInProgressTitle => 'Cannot edit message';
302+
303+
@override
304+
String get editAlreadyInProgressMessage =>
305+
'An edit is already in progress. Please wait for it to complete.';
306+
307+
@override
308+
String get savingMessageEditLabel => 'SAVING EDIT…';
309+
310+
@override
311+
String get savingMessageEditFailedLabel => 'EDIT NOT SAVED';
312+
313+
@override
314+
String get discardDraftConfirmationDialogTitle =>
315+
'Discard the message you’re writing?';
316+
317+
@override
318+
String get discardDraftConfirmationDialogMessage =>
319+
'When you edit a message, the content that was previously in the compose box is discarded.';
320+
321+
@override
322+
String get discardDraftConfirmationDialogConfirmButton => 'Discard';
323+
282324
@override
283325
String get composeBoxAttachFilesTooltip => 'Attach files';
284326

@@ -307,6 +349,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
307349
return 'Message $destination';
308350
}
309351

352+
@override
353+
String get preparingEditMessageContentInput => 'Preparing…';
354+
310355
@override
311356
String get composeBoxSendTooltip => 'Send';
312357

0 commit comments

Comments
 (0)