Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notifs: Add snoozable banner for notifs-soon-to-expire #5814

Merged
merged 10 commits into from
Jan 27, 2024

Conversation

chrisbobbe
Copy link
Contributor

@chrisbobbe chrisbobbe commented Jan 18, 2024

This is stacked on #5812. I'll post a screenshot soon.

@chrisbobbe
Copy link
Contributor Author

The snooze period is a week, and the "Learn more" button opens https://zulip.com/help/self-hosted-billing#upgrades-for-legacy-customers , like the warnings in #5812.

image

Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for building this! The code all LGTM, modulo a couple of small comments below.

@alya, any feedback on the UX?

Comment on lines 110 to 123
accounts: (base52.accounts.map(a => ({
...a,
silenceServerPushSetupWarnings: false,
})): $ReadOnlyArray<{|
+email: string,
+apiKey: string,
+realm: URL,
+ackedPushToken: string | null,
+zulipFeatureLevel: number | null,
+zulipVersion: ZulipVersion | null,
+lastDismissedServerPushSetupNotice: Date | null,
+userId: UserId | null,
+silenceServerPushSetupWarnings: boolean,
|}>),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
accounts: (base52.accounts.map(a => ({
...a,
silenceServerPushSetupWarnings: false,
})): $ReadOnlyArray<{|
+email: string,
+apiKey: string,
+realm: URL,
+ackedPushToken: string | null,
+zulipFeatureLevel: number | null,
+zulipVersion: ZulipVersion | null,
+lastDismissedServerPushSetupNotice: Date | null,
+userId: UserId | null,
+silenceServerPushSetupWarnings: boolean,
|}>),
// $FlowIgnore[prop-missing] same type-lie as in the test, below at end
accounts: base52.accounts.map(a => ({
...a,
silenceServerPushSetupWarnings: false,
})),

Weird that for this one piece of data, Flow puts the error up here; for the rest, the error is down at the bottom where we pretend that these old states meet the current type, and so we have $FlowIgnore comments there accordingly:

      // $FlowIgnore[incompatible-exact]
      // $FlowIgnore[incompatible-type]
      /* $FlowIgnore[prop-missing]
         this really is a lie -- and kind of central to migration */
      const incomingState: $Rest<GlobalState, { ... }> = before;

But the same discrepancy applies to basically all of these except the one or two at the end. So best to keep succinct how we tell Flow to avert its eyes.

Comment on lines +74 to +75
<ServerNotifsDisabledBanner navigation={navigation} />
<ServerNotifsExpiringBanner />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can both banners show at once? That seems like it'd be annoying.

Looking at the implementation, I think the answer is that they could only if pushNotificationsEnabledEndTimestamp is non-null while pushNotificationsEnabled is false. That shouldn't happen — the server shouldn't do that — but rather than rely on the server in that respect, I think it'd be good to add a little conditional in pushNotificationsEnabledEndTimestampWarning so that we ignore the end timestamp if things aren't enabled in the first place. Can be a small prep commit.

@chrisbobbe
Copy link
Contributor Author

Thanks for the review! Revision pushed.

@gnprice
Copy link
Member

gnprice commented Jan 23, 2024

Thanks! The code all now looks good; ready to merge pending any feedback from @alya on the UI.

@alya
Copy link
Collaborator

alya commented Jan 24, 2024

Works for me! Thinking about this experience, I'm going to add a bit of an intro to https://zulip.com/help/self-hosted-billing#upgrades-for-legacy-customers so that it explains more clearly that we made a change.

@timabbott any additional thoughts here?

@alya
Copy link
Collaborator

alya commented Jan 24, 2024

Help center PR: zulip/zulip#28688

@timabbott
Copy link
Sponsor Member

Let's use something like this for the language:

{realm_name} is scheduled to switch to a plan that does not include mobile push notifications on {date}.

(I'm not sure whether a link words in this context). I think that makes more clear what the exact situation is -- one could imagine reading the "will be disabled" and at first assuming some other weird possibility about the cause (E.g. your organization got a spam complaint or something). Obviously the link will clarify, but I think the initial reaction is important,

} else if (
lastDismissedServerNotifsExpiringBanner !== null
&& lastDismissedServerNotifsExpiringBanner >= subWeeks(dateNow, 1)
) {
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I wonder if we should make the time window that a dismissal lasts substantially longer for non-administrators than it is for administrators? Like maybe 2 months for normal users? We probably do want it to be finite, since in theory there could be separate situations 6 months apart that cause notifications to be potentially expiring. But I think it's mostly administrators and owners who would benefit from an additional reminder of the impending change before it actually happens, and I can see it being frustrating for people who might be in the middle of their procurement process for all their employees to get the notice a second time.

@chrisbobbe
Copy link
Contributor Author

Thanks for the reviews! Revision pushed, with:

(These last two were discussed on CZO.)

@alya
Copy link
Collaborator

alya commented Jan 26, 2024

Could you post an updated screenshot, please?

@gnprice
Copy link
Member

gnprice commented Jan 26, 2024

Thanks! The code changes look good. Ready to merge pending an updated screenshot and any remaining UX/product feedback on that.

@chrisbobbe
Copy link
Contributor Author

chrisbobbe commented Jan 26, 2024

cc @alya @gnprice

imageimageimageimage

The link on "plan", where present, is a small touch target, and in the case of the "Settings" and "Notifications" screens, it appears on a surface that has a different behavior on touch. But I checked manually and it is possible to get the touch response on "plan" if you're precise about where your finger goes.

When you tap the link on "plan", it opens https://zulip.com/plans/#self-hosted .

As a reminder, when you tap any of these, it opens https://zulip.com/help/self-hosted-billing#upgrades-for-legacy-customers :

  • "Details" on the dialog on the "Pick account" screen
  • "Learn more" on the banner on the home screen
  • The relevant row on the "Notifications" screen

@chrisbobbe
Copy link
Contributor Author

Revision pushed.

Unfortunately the most straightforward implementation will force
translators to translate basically the same string four times:
combining

- 12- vs. 24-hour format
- with vs. without a link (on the word "plan")
We've recently shifted to talking about push notifications being
"enabled" on a server rather than being "set up".
So we don't have to be as repetitive at the callsites.
@chrisbobbe
Copy link
Contributor Author

Revision pushed.

@gnprice
Copy link
Member

gnprice commented Jan 27, 2024

Thanks! Looks good; merging.

@gnprice gnprice merged commit 8e5b3ea into zulip:main Jan 27, 2024
1 check passed
@chrisbobbe chrisbobbe deleted the pr-notif-expiry-banner branch January 27, 2024 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants