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: Warn about notifications soon to be disabled (not yet with banner) #5812

Merged
merged 5 commits into from
Jan 23, 2024

Conversation

chrisbobbe
Copy link
Contributor

Soon, we'll add a snoozable banner. But for now:

  • Warning icon / subtitle text on the "Notifications" row on the settings screen
  • Warning row in the notification-settings screen
  • Warning icon on the "Pick account" screen

(I reused some React Hooks testing infrastructure from an old draft branch I had lying around.)

@chrisbobbe chrisbobbe force-pushed the pr-warn-notifs-disabled-soon branch 2 times, most recently from 72f4659 to 0f421ee Compare January 16, 2024 21:15
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! Generally looks good; a few small comments.

return;
}

if (expiryWarning != null) {
Copy link
Member

Choose a reason for hiding this comment

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

Can there be both an expiry warning and a single-notif-problem? In that case we'd probably want to prioritize the active problem, right?

Comment on lines 49 to 51
...rawInitialData,

realm_push_notifications_enabled_end_timestamp: 1706037926,
Copy link
Member

Choose a reason for hiding this comment

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

This looks like it overrides the value from the server with this hard-coded value. Was this perhaps intended as temporary for local testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Eep! Thanks for catching this; it was for local testing, yes.

Comment on lines 297 to 298
// See https://chat.zulip.org/#narrow/stream/107-kandra/topic/notification.20plan.20expiration.20warnings/near/1719677
export const kPushNotificationsEnabledEndDoc: URL = new URL(
'https://zulip.com/help/self-hosted-billing#upgrades-for-legacy-customers',
Copy link
Member

Choose a reason for hiding this comment

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

This link is to a private stream. Generally we don't put such a reference into our codebase.

In this case, I think no reference is needed. The information I take from following the link is basically that this is the link Alya asks to put here. That's the kind of information that can be relevant at PR discussion time, or perhaps in a commit message, but isn't needed in the tree itself. (And we can say it directly, rather than via a link.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, indeed; thanks for the catch.

Comment on lines 114 to 119
let subtitle = undefined;
if (expiryWarning != null) {
subtitle = expiryWarning.reactText;
} else if (problem != null) {
subtitle = notifProblemShortReactText(problem, realmName);
}
Copy link
Member

Choose a reason for hiding this comment

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

Similar question about prioritizing the two kinds of warnings.

@chrisbobbe
Copy link
Contributor Author

Thanks for the review! Revision pushed.

And drop the reference to withGetText, which we shouldn't need in a
Hooks-based world. Indeed that HOC isn't even used anymore; we'll
remove it next.
It looks like our last use of this was removed in 8a0e486.
We'll also start using this in useNotificationReportsByIdentityKey,
to check for a new NotificationProblem that will apply when the
server is about to stop enabling push notifications.
…nner)

Soon, we'll add a snoozable banner on the home screen. But for now:

- Warning icon / subtitle text on the "Notifications" row on the
  settings screen
- Warning row in the notification-settings screen
- Warning icon on the "Pick account" screen
@gnprice
Copy link
Member

gnprice commented Jan 23, 2024

Thanks for the revision! Looks good; merging.

@gnprice gnprice force-pushed the pr-warn-notifs-disabled-soon branch from e6731b8 to b30969b Compare January 23, 2024 05:05
@gnprice gnprice merged commit b30969b into zulip:main Jan 23, 2024
1 check passed
@chrisbobbe chrisbobbe deleted the pr-warn-notifs-disabled-soon branch January 23, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants