-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Change notification permission handling #15176
Change notification permission handling #15176
Conversation
7734be4
to
05ceb2f
Compare
One possible issue with this is that there is no clear indication that notifications won't work when the permission isn't granted (nor explicitly denied) and the banner has been dismissed… |
dc54a40
to
99949f4
Compare
render () { | ||
return ( | ||
<button className='text-btn column-header__setting-btn' tabIndex='0' onClick={this.props.onClick}> | ||
<Icon id='sliders' /> <FormattedMessage id='notifications.grant_permission' defaultMessage='Grant permission' /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the icon sliders
? In the banner, I used the icon to point to the column settings area, but it is not the icon for permissions or desktop notifications.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be the most fitting “settings icon” to me, although it's already used for column settings, so I understand it may be confusing. I don't know which icon would be better.
{alertsEnabled && browserSupport && browserPermission === 'default' && ( | ||
<div className='column-settings__row column-settings__row--with-margin'> | ||
<span className='warning-hint'><FormattedMessage id='notifications.permission_required' defaultMessage='Desktop notifications are unavailable because the required permission has not been granted.' /></span> | ||
<GrantPermissionButton onClick={onRequestNotificationPermission} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There needs to be margin between the line above and the button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, with the differnet margin to the button below, it's not worse but not better either. If you want it to be visually grouped, why not make the "button" have the same text color and maybe even make it inline part of the text like a link, underlined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice!
- allow changing individual alert settings even if permission is not explicitly enabled (asks for permission on toggle) - persist permission request banner dismissal across sessions through settings
99949f4
to
adfd8c5
Compare
de78f3b
to
570c9b0
Compare
570c9b0
to
276c5c3
Compare
This enables the dismissal of the nagging notification permission banner to persist after a reload or across browsers without breaking the ability to enable notifications later.
Another approach could be to have the alert settings bound to localStorage or to the session, and disable all alerts when dismissing the banner, but that would be a change of behavior and provide an uneasy migration path.