Skip to content

Commit 19b96de

Browse files
committed
compose: Support editing an already-sent message
Fixes: zulip#126
1 parent 8bf7576 commit 19b96de

20 files changed

+1246
-15
lines changed

assets/l10n/app_en.arb

Lines changed: 48 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,38 @@
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+
"savingMessageEditLabel": "SAVING EDIT…",
357+
"@savingMessageEditLabel": {
358+
"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.)"
359+
},
360+
"savingMessageEditFailedLabel": "EDIT NOT SAVED",
361+
"@savingMessageEditFailedLabel": {
362+
"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.)"
363+
},
364+
"discardDraftConfirmationDialogTitle": "Discard the message you’re writing?",
365+
"@discardDraftConfirmationDialogTitle": {
366+
"description": "Title for a confirmation dialog for discarding message text that was typed into the compose box."
367+
},
368+
"discardDraftConfirmationDialogMessage": "When you edit a message, the content that was previously in the compose box is discarded.",
369+
"@discardDraftConfirmationDialogMessage": {
370+
"description": "Message for a confirmation dialog for discarding message text that was typed into the compose box."
371+
},
372+
"discardDraftConfirmationDialogConfirmButton": "Discard",
373+
"@discardDraftConfirmationDialogConfirmButton": {
374+
"description": "Label for the 'Discard' button on a confirmation dialog for discarding message text that was typed into the compose box."
375+
},
332376
"composeBoxAttachFilesTooltip": "Attach files",
333377
"@composeBoxAttachFilesTooltip": {
334378
"description": "Tooltip for compose box icon to attach a file to the message."
@@ -367,6 +411,10 @@
367411
"destination": {"type": "String", "example": "#channel name > topic name"}
368412
}
369413
},
414+
"composeBoxEditMessageHint": "Message content",
415+
"@composeBoxEditMessageHint": {
416+
"description": "Hint text for content input when editing a message."
417+
},
370418
"composeBoxSendTooltip": "Send",
371419
"@composeBoxSendTooltip": {
372420
"description": "Tooltip for send button in compose box."

lib/generated/l10n/zulip_localizations.dart

Lines changed: 72 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,54 @@ 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+
/// 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.)
596+
///
597+
/// In en, this message translates to:
598+
/// **'SAVING EDIT…'**
599+
String get savingMessageEditLabel;
600+
601+
/// 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.)
602+
///
603+
/// In en, this message translates to:
604+
/// **'EDIT NOT SAVED'**
605+
String get savingMessageEditFailedLabel;
606+
607+
/// Title for a confirmation dialog for discarding message text that was typed into the compose box.
608+
///
609+
/// In en, this message translates to:
610+
/// **'Discard the message you’re writing?'**
611+
String get discardDraftConfirmationDialogTitle;
612+
613+
/// Message for a confirmation dialog for discarding message text that was typed into the compose box.
614+
///
615+
/// In en, this message translates to:
616+
/// **'When you edit a message, the content that was previously in the compose box is discarded.'**
617+
String get discardDraftConfirmationDialogMessage;
618+
619+
/// Label for the 'Discard' button on a confirmation dialog for discarding message text that was typed into the compose box.
620+
///
621+
/// In en, this message translates to:
622+
/// **'Discard'**
623+
String get discardDraftConfirmationDialogConfirmButton;
624+
559625
/// Tooltip for compose box icon to attach a file to the message.
560626
///
561627
/// In en, this message translates to:
@@ -604,6 +670,12 @@ abstract class ZulipLocalizations {
604670
/// **'Message {destination}'**
605671
String composeBoxChannelContentHint(String destination);
606672

673+
/// Hint text for content input when editing a message.
674+
///
675+
/// In en, this message translates to:
676+
/// **'Message content'**
677+
String get composeBoxEditMessageHint;
678+
607679
/// Tooltip for send button in compose box.
608680
///
609681
/// 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
@@ -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,32 @@ 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 savingMessageEditLabel => 'SAVING EDIT…';
302+
303+
@override
304+
String get savingMessageEditFailedLabel => 'EDIT NOT SAVED';
305+
306+
@override
307+
String get discardDraftConfirmationDialogTitle =>
308+
'Discard the message you’re writing?';
309+
310+
@override
311+
String get discardDraftConfirmationDialogMessage =>
312+
'When you edit a message, the content that was previously in the compose box is discarded.';
313+
314+
@override
315+
String get discardDraftConfirmationDialogConfirmButton => 'Discard';
316+
282317
@override
283318
String get composeBoxAttachFilesTooltip => 'Attach files';
284319

@@ -307,6 +342,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
307342
return 'Message $destination';
308343
}
309344

345+
@override
346+
String get composeBoxEditMessageHint => 'Message content';
347+
310348
@override
311349
String get composeBoxSendTooltip => 'Send';
312350

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 38 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,32 @@ 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 savingMessageEditLabel => 'SAVING EDIT…';
302+
303+
@override
304+
String get savingMessageEditFailedLabel => 'EDIT NOT SAVED';
305+
306+
@override
307+
String get discardDraftConfirmationDialogTitle =>
308+
'Discard the message you’re writing?';
309+
310+
@override
311+
String get discardDraftConfirmationDialogMessage =>
312+
'When you edit a message, the content that was previously in the compose box is discarded.';
313+
314+
@override
315+
String get discardDraftConfirmationDialogConfirmButton => 'Discard';
316+
282317
@override
283318
String get composeBoxAttachFilesTooltip => 'Attach files';
284319

@@ -307,6 +342,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
307342
return 'Message $destination';
308343
}
309344

345+
@override
346+
String get composeBoxEditMessageHint => 'Message content';
347+
310348
@override
311349
String get composeBoxSendTooltip => 'Send';
312350

0 commit comments

Comments
 (0)