-
-
Notifications
You must be signed in to change notification settings - Fork 828
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
Add a third state to header icons #500
Comments
I agree about this one. Will take it on. 👍 |
I've made some progress on this. The idea is the following:
return app.cache.notifications.filter(notification => !notification.isRead()).length;
Getting that last part ("new" notifications) right is the hardest part, I guess. Where should this state be kept, @tobscure? I've already taken care of the styling (only apply the accent color when a class "new" is applied to the button), but I'm hesitant about the data flow... |
@franzliedke How about this approach:
|
I implemented this, and it seems to work well. Even thought of edge cases. ;) Can you please review, @tobscure? Especially the following things:
That said, this still needs to be done for the flagged posts dropdown. |
Do we maintain notifications beyond being read? |
Previously, clicking the "mark all notifications as read" button would individually mark each of the visible notifications as read. Since we now always show a badge with the number of unread notifications, we need to make sure that all notifications (not just the visible ones) can be marked as read. Otherwise it would be possible to get stuck with an unread badge there. This commit adds a new API endpoint which marks *all* of a user's notifications as read. The JSON-API spec doesn't cover this kind of thing (updating all instances of a certain resource type), so I'm a bit unsure regarding what the endpoint should actually be. For now I've gone with POST /notifications/read, but I'm open to suggestions. ref #500
@kirkbushell Yep we keep them around in case people want to refer back to them. But we should indeed think about having some kind of cleanup process that deletes notifications older than X days. Somewhat related to #217. @franzliedke Great work! All looks good to me. See above commit for the only thing I added. |
Currently the bell and flag icons have two states: orange with a number, blue with no number. This means that clicking the icon to reveal notifications (or reports) cancels the orange state and makes it look as if there are no unread notifications, even when there are.
How about adding a third state, as follows:
This would remind the user of unread notifications, while at the same time alerting him to new ones.
The text was updated successfully, but these errors were encountered: