Skip to content

Commit b34b3a8

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 zulip#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 zulip#1798, because those are bugs in the send-message experience. Fixes-partly: zulip#1798
1 parent 732ea76 commit b34b3a8

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
@@ -482,6 +482,18 @@
482482
"@errorBannerCannotPostInChannelLabel": {
483483
"description": "Error-banner text replacing the compose box when you do not have permission to send a message to the channel."
484484
},
485+
"composeBoxBannerLabelUnsubscribedWhenCannotSend": "New messages will not appear automatically.",
486+
"@composeBoxBannerLabelUnsubscribedWhenCannotSend": {
487+
"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."
488+
},
489+
"composeBoxBannerButtonRefresh": "Refresh",
490+
"@composeBoxBannerButtonRefresh": {
491+
"description": "Label text for the 'Refresh' button in the compose-box banner when you are viewing an unsubscribed channel."
492+
},
493+
"composeBoxBannerButtonSubscribe": "Subscribe",
494+
"@composeBoxBannerButtonSubscribe": {
495+
"description": "Label text for the 'Subscribe' button in the compose-box banner when you are viewing an unsubscribed channel."
496+
},
485497
"composeBoxBannerLabelEditMessage": "Edit message",
486498
"@composeBoxBannerLabelEditMessage": {
487499
"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
@@ -781,6 +781,24 @@ abstract class ZulipLocalizations {
781781
/// **'You do not have permission to post in this channel.'**
782782
String get errorBannerCannotPostInChannelLabel;
783783

784+
/// Label text for a compose-box banner when you are viewing an unsubscribed channel in which you do not have permission to send messages.
785+
///
786+
/// In en, this message translates to:
787+
/// **'New messages will not appear automatically.'**
788+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend;
789+
790+
/// Label text for the 'Refresh' button in the compose-box banner when you are viewing an unsubscribed channel.
791+
///
792+
/// In en, this message translates to:
793+
/// **'Refresh'**
794+
String get composeBoxBannerButtonRefresh;
795+
796+
/// Label text for the 'Subscribe' button in the compose-box banner when you are viewing an unsubscribed channel.
797+
///
798+
/// In en, this message translates to:
799+
/// **'Subscribe'**
800+
String get composeBoxBannerButtonSubscribe;
801+
784802
/// Label text for the compose-box banner when you are editing a message.
785803
///
786804
/// 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
@@ -409,6 +409,16 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
409409
String get errorBannerCannotPostInChannelLabel =>
410410
'You do not have permission to post in this channel.';
411411

412+
@override
413+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend =>
414+
'New messages will not appear automatically.';
415+
416+
@override
417+
String get composeBoxBannerButtonRefresh => 'Refresh';
418+
419+
@override
420+
String get composeBoxBannerButtonSubscribe => 'Subscribe';
421+
412422
@override
413423
String get composeBoxBannerLabelEditMessage => 'Edit message';
414424

lib/generated/l10n/zulip_localizations_de.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,16 @@ class ZulipLocalizationsDe extends ZulipLocalizations {
425425
String get errorBannerCannotPostInChannelLabel =>
426426
'Du hast keine Berechtigung in diesen Kanal zu schreiben.';
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 => 'Nachricht bearbeiten';
430440

lib/generated/l10n/zulip_localizations_en.dart

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

412+
@override
413+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend =>
414+
'New messages will not appear automatically.';
415+
416+
@override
417+
String get composeBoxBannerButtonRefresh => 'Refresh';
418+
419+
@override
420+
String get composeBoxBannerButtonSubscribe => 'Subscribe';
421+
412422
@override
413423
String get composeBoxBannerLabelEditMessage => 'Edit message';
414424

lib/generated/l10n/zulip_localizations_fr.dart

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

426+
@override
427+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend =>
428+
'New messages will not appear automatically.';
429+
430+
@override
431+
String get composeBoxBannerButtonRefresh => 'Refresh';
432+
433+
@override
434+
String get composeBoxBannerButtonSubscribe => 'Subscribe';
435+
426436
@override
427437
String get composeBoxBannerLabelEditMessage => 'Editer le message';
428438

lib/generated/l10n/zulip_localizations_it.dart

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

422+
@override
423+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend =>
424+
'New messages will not appear automatically.';
425+
426+
@override
427+
String get composeBoxBannerButtonRefresh => 'Refresh';
428+
429+
@override
430+
String get composeBoxBannerButtonSubscribe => 'Subscribe';
431+
422432
@override
423433
String get composeBoxBannerLabelEditMessage => 'Modifica messaggio';
424434

lib/generated/l10n/zulip_localizations_ja.dart

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

402+
@override
403+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend =>
404+
'New messages will not appear automatically.';
405+
406+
@override
407+
String get composeBoxBannerButtonRefresh => 'Refresh';
408+
409+
@override
410+
String get composeBoxBannerButtonSubscribe => 'Subscribe';
411+
402412
@override
403413
String get composeBoxBannerLabelEditMessage => 'メッセージを編集';
404414

lib/generated/l10n/zulip_localizations_nb.dart

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

412+
@override
413+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend =>
414+
'New messages will not appear automatically.';
415+
416+
@override
417+
String get composeBoxBannerButtonRefresh => 'Refresh';
418+
419+
@override
420+
String get composeBoxBannerButtonSubscribe => 'Subscribe';
421+
412422
@override
413423
String get composeBoxBannerLabelEditMessage => 'Edit message';
414424

lib/generated/l10n/zulip_localizations_pl.dart

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

423+
@override
424+
String get composeBoxBannerLabelUnsubscribedWhenCannotSend =>
425+
'New messages will not appear automatically.';
426+
427+
@override
428+
String get composeBoxBannerButtonRefresh => 'Refresh';
429+
430+
@override
431+
String get composeBoxBannerButtonSubscribe => 'Subscribe';
432+
423433
@override
424434
String get composeBoxBannerLabelEditMessage => 'Zmień wiadomość';
425435

0 commit comments

Comments
 (0)