-
Notifications
You must be signed in to change notification settings - Fork 701
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
Remove "badge" setting and rely on browser choice for desktop notifcations #28
Conversation
Can @xPaw, @JocelynDelalande, @YaManicKill or @wizardfrag self-assign this one please? :-) |
I shall take a look at this tonight or tomorrow. 1 question before I actually download it and try it: If notifications are disabled, and then the user wants notifications again, how do they get it? I don't think the app can ask for notifications again, can it? And if it can't, what happens when the user tells the browser not to disable notifications again? I'll have a play around and see how it works. |
Oh, also, I'm not sure about there not being a setting to disable notifications after they have been enabled. That seems a little awkward for users. |
The app can't ask again if the browser blocks notifications. If you re-enable them, notifications will pop again without the need to touch shout settings. But, if you set it as "always ask", shout will have to ask again. There's is no settings because in the end it's the browser who have the last word on wether notifications are displayed or not. Having a checkbox on the settings page for notifications doesn't really mean anything as long as browser settings are set differently. |
Alright, good. I'll double check that works with different browsers as well, but I believe you.
Well, that's not really true. If we have a "disable notifications" we (in the code) will not send a notification, even when they are enabled in the browser. I don't think it's right for the user to have to change browser settings to stop us notifying them again. |
@@ -243,8 +243,8 @@ <h1 class="title">Settings</h1> | |||
</div> | |||
<div class="col-sm-12"> | |||
<label class="opt"> | |||
<input id="badge" type="checkbox" name="badge"> | |||
Enable badge | |||
Desktop notification status : <span id="desktopNotificationsStatus">Unknown</span> |
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's extra indentation here.
Right, so in general I quite like it. I'm just not a fan of the user having to go to the browser settings to disable notifications. I'm not sure I want another setting for that though. I'll give a 👍 and see what others think. I'm happy for this to go in. |
I don't like that you completely removed disabling notifications in settings. When we will add per-channel settings, we will need to have an ability to disable notifications. Having a badge to say that notifications are not enabled by the browser is a good idea though. |
So, after reading the initial proposition and @YaManicKill's and @xPaw's concerns, here is my proposal. First of all, some definitions to be sure we are all on the same page: On the browser side of things, notification states are:
On The Lounge, you should be able to enable or disable notifications, as long as they are allowed (state (2)). As @YaManicKill and @xPaw have mentioned, first because in the future we will want to be able to override this setting per channel, but also because disabling notifications within the browser is quite a reach in the browser settings. The opposite is also true: when the user has blocked the notifications, it's a quite a dig to re-enable... but that's their choice and there is nothing we can do about it :-) My proposal is to keep the current checkbox but to enhance it:
This allows for what was discussed earlier:
When I look at how things are done at the moment (before your PR), I see two crucial differences:
Sorry, this was a very long comment for something very simple, but I wanted to give all details. How does everyone feel about that? |
@lpoujol, ping? |
Didn't know that. |
@astorije Yes, I fully agree with you. Your solution above has a state where we don't try to send notifications, this is the only thing that's needed. I just didn't want to rely on the browser to block our notifications. |
I agree with @astorije and @maxpoulin64. @lpoujol would you be able to make these changes and rebase the PR? It would be good to get these changes in :-) |
I am removing the |
I brought back the setting (also renaming it from badge to desktopNotifications in the code) I check the browser state on display of the settings page. But there is an edge case that I can't really cover. It's when the browser choice for desktop notifications (Block, Ask, Allow) change while the settings page is displayed :/. There will be a Permission API on browsers, but it's still experimental :/ |
<input id="badge" type="checkbox" name="badge"> | ||
Enable badge | ||
<input id="desktopNotifications" type="checkbox" name="desktopNotifications"> | ||
Enable desktop notifications<br /> |
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.
<br>
instead of <br />
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.
Fixed
@lpoujol, looking good! :-) I noticed an issue though, with the permission pop-up which never stops asking once clicked on the checkbox once, even after changing tab: Also, when decision to allow or block is not taken, the checkbox should never be checked, which can be the case at the moment.
I am not too bothered by this edge case. We could also check if
Meh, it would be weird to be able to be able to check a checkbox that automatically goes back to unchecked because blocked by the browser I think. |
Last commit fixes the issue with the permission popup (Didn't had on Firefox because it won't execute the callback if no decision is taken) . |
@lpoujol, works great, awesome, I really like it!! 👍 |
Taking ownership of this one, to let @YaManicKill breathe a bit :-) |
By the way, yes, please do squash @lpoujol :-) |
All good to me, 👍, ok to merge after squash. |
Squashed ! |
Enable badge | ||
<input id="desktopNotifications" type="checkbox" name="desktopNotifications"> | ||
Enable desktop notifications<br> | ||
<div class="error" id="warnDisabledDesktopNotifications">Warning : Desktop notifications are blocked by your web browser</div> |
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.
Nit: can you remove space after warning here, maybe even bold the warining?
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.
👍 on the space, that's a difference with French :P
For the warning, I don't think so at the moment, because none of the similar-looking error do that. I'd keep this for a later time.
Also checks the browser status and display a warning message if it blocks desktop notifications
👍 and merging, thanks all for the multiple reviews and thanks a lot @lpoujol for this and for sticking with us for 22 days!! :-) |
Remove "badge" setting and rely on browser choice for desktop notifcations
Remove the badge setting and rely on browser choice for desktop notifications.
But the user still have to activate the desktop notifications via the lounge settings page. Making lounge ask the permission to the browser.
The status on whether or not it's activated is also displayed on the settings page.
Some screens to show how it looks :