Skip to content

Commit 34fd9e5

Browse files
committed
compose: Show a Refresh/Subscribe banner when unsubscribed and can't send
This fixes part of the "second buggy behavior" that I described in #1789: specifically, it fixes that behavior when the self-user doesn't have permission to send messages in the channel. Later, for the case where there *is* permission to send messages, we should use a different banner label, like "Replies to your messages will not appear automatically." I think it's smoothest not to touch that case until we've fixed the "first" and "third" parts of #1798, because those are bugs in the send-message experience. Fixes-partly: #1798
1 parent a9b4399 commit 34fd9e5

19 files changed

+375
-7
lines changed

assets/l10n/app_en.arb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,18 @@
502502
"@errorBannerCannotPostInChannelLabel": {
503503
"description": "Error-banner text replacing the compose box when you do not have permission to send a message to the channel."
504504
},
505+
"composeBoxBannerLabelUnsubscribedWhenCannotSend": "New messages will not appear automatically.",
506+
"@composeBoxBannerLabelUnsubscribedWhenCannotSend": {
507+
"description": "Label text for a compose-box banner when you are viewing an unsubscribed channel in which you do not have permission to send messages."
508+
},
509+
"composeBoxBannerButtonRefresh": "Refresh",
510+
"@composeBoxBannerButtonRefresh": {
511+
"description": "Label text for the 'Refresh' button in the compose-box banner when you are viewing an unsubscribed channel."
512+
},
513+
"composeBoxBannerButtonSubscribe": "Subscribe",
514+
"@composeBoxBannerButtonSubscribe": {
515+
"description": "Label text for the 'Subscribe' button in the compose-box banner when you are viewing an unsubscribed channel."
516+
},
505517
"composeBoxBannerLabelEditMessage": "Edit message",
506518
"@composeBoxBannerLabelEditMessage": {
507519
"description": "Label text for the compose-box banner when you are editing a message."

lib/generated/l10n/zulip_localizations.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,24 @@ abstract class ZulipLocalizations {
811811
/// **'You do not have permission to post in this channel.'**
812812
String get errorBannerCannotPostInChannelLabel;
813813

814+
/// Label text for a compose-box banner when you are viewing an unsubscribed channel in which you do not have permission to send messages.
815+
///
816+
/// In en, this message translates to:
817+
/// **'New messages will not appear automatically.'**
818+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend;
819+
820+
/// Label text for the 'Refresh' button in the compose-box banner when you are viewing an unsubscribed channel.
821+
///
822+
/// In en, this message translates to:
823+
/// **'Refresh'**
824+
String get composeBoxBannerButtonRefresh;
825+
826+
/// Label text for the 'Subscribe' button in the compose-box banner when you are viewing an unsubscribed channel.
827+
///
828+
/// In en, this message translates to:
829+
/// **'Subscribe'**
830+
String get composeBoxBannerButtonSubscribe;
831+
814832
/// Label text for the compose-box banner when you are editing a message.
815833
///
816834
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,16 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
425425
String get errorBannerCannotPostInChannelLabel =>
426426
'You do not have permission to post in this channel.';
427427

428+
@override
429+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend =>
430+
'New messages will not appear automatically.';
431+
432+
@override
433+
String get composeBoxBannerButtonRefresh => 'Refresh';
434+
435+
@override
436+
String get composeBoxBannerButtonSubscribe => 'Subscribe';
437+
428438
@override
429439
String get composeBoxBannerLabelEditMessage => 'Edit message';
430440

lib/generated/l10n/zulip_localizations_de.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,16 @@ class ZulipLocalizationsDe extends ZulipLocalizations {
441441
String get errorBannerCannotPostInChannelLabel =>
442442
'Du hast keine Berechtigung in diesen Kanal zu schreiben.';
443443

444+
@override
445+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend =>
446+
'New messages will not appear automatically.';
447+
448+
@override
449+
String get composeBoxBannerButtonRefresh => 'Refresh';
450+
451+
@override
452+
String get composeBoxBannerButtonSubscribe => 'Subscribe';
453+
444454
@override
445455
String get composeBoxBannerLabelEditMessage => 'Nachricht bearbeiten';
446456

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,16 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
425425
String get errorBannerCannotPostInChannelLabel =>
426426
'You do not have permission to post in this channel.';
427427

428+
@override
429+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend =>
430+
'New messages will not appear automatically.';
431+
432+
@override
433+
String get composeBoxBannerButtonRefresh => 'Refresh';
434+
435+
@override
436+
String get composeBoxBannerButtonSubscribe => 'Subscribe';
437+
428438
@override
429439
String get composeBoxBannerLabelEditMessage => 'Edit message';
430440

lib/generated/l10n/zulip_localizations_fr.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,16 @@ class ZulipLocalizationsFr extends ZulipLocalizations {
439439
String get errorBannerCannotPostInChannelLabel =>
440440
'Vous n\'avez pas l\'autorisation de poster sur ce canal.';
441441

442+
@override
443+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend =>
444+
'New messages will not appear automatically.';
445+
446+
@override
447+
String get composeBoxBannerButtonRefresh => 'Refresh';
448+
449+
@override
450+
String get composeBoxBannerButtonSubscribe => 'Subscribe';
451+
442452
@override
443453
String get composeBoxBannerLabelEditMessage => 'Editer le message';
444454

lib/generated/l10n/zulip_localizations_it.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,16 @@ class ZulipLocalizationsIt extends ZulipLocalizations {
435435
String get errorBannerCannotPostInChannelLabel =>
436436
'Non hai l\'autorizzazione per postare su questo canale.';
437437

438+
@override
439+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend =>
440+
'New messages will not appear automatically.';
441+
442+
@override
443+
String get composeBoxBannerButtonRefresh => 'Refresh';
444+
445+
@override
446+
String get composeBoxBannerButtonSubscribe => 'Subscribe';
447+
438448
@override
439449
String get composeBoxBannerLabelEditMessage => 'Modifica messaggio';
440450

lib/generated/l10n/zulip_localizations_ja.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,16 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
415415
@override
416416
String get errorBannerCannotPostInChannelLabel => 'このチャンネルに投稿する権限がありません。';
417417

418+
@override
419+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend =>
420+
'New messages will not appear automatically.';
421+
422+
@override
423+
String get composeBoxBannerButtonRefresh => 'Refresh';
424+
425+
@override
426+
String get composeBoxBannerButtonSubscribe => 'Subscribe';
427+
418428
@override
419429
String get composeBoxBannerLabelEditMessage => 'メッセージを編集';
420430

lib/generated/l10n/zulip_localizations_nb.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,16 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
425425
String get errorBannerCannotPostInChannelLabel =>
426426
'You do not have permission to post in this channel.';
427427

428+
@override
429+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend =>
430+
'New messages will not appear automatically.';
431+
432+
@override
433+
String get composeBoxBannerButtonRefresh => 'Refresh';
434+
435+
@override
436+
String get composeBoxBannerButtonSubscribe => 'Subscribe';
437+
428438
@override
429439
String get composeBoxBannerLabelEditMessage => 'Edit message';
430440

lib/generated/l10n/zulip_localizations_pl.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,16 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
437437
String get errorBannerCannotPostInChannelLabel =>
438438
'Nie masz uprawnień do dodawania wpisów w tym kanale.';
439439

440+
@override
441+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend =>
442+
'New messages will not appear automatically.';
443+
444+
@override
445+
String get composeBoxBannerButtonRefresh => 'Refresh';
446+
447+
@override
448+
String get composeBoxBannerButtonSubscribe => 'Subscribe';
449+
440450
@override
441451
String get composeBoxBannerLabelEditMessage => 'Zmień wiadomość';
442452

0 commit comments

Comments
 (0)