Possibility to selectively (or completely) mark notifications as read

(FichteFoll) #1

When you are joining a new discourse install you get a bunch of “badges” for a variety of things, e.g. “First Like” or “First Quote”. Sometimes it’s also reply notifications that I have already read via mail.

I couldn’t care less about these notifications, but for some reason they will always remain as “unread” in the bar until I finally decide to click them because they annoy me so much.

So, the most general approach would be to allow clearing a single or all notifications’ unread status. I think it’s also debatable whether I have to read badge notifications in the first place.

Edit: Here’s a screenshot for better imagination:

Unread and notification menu posts
(Sol) #2

Even marking all as read as last point in the last would be great :slight_smile:

(Jeff Atwood) #3

I have discussed this with @sam before, all badge notifies should show up as read. It is irritating the way it is now.

Accepted Invitations still Unread
Mark a badge notification as read instead of unread
(FichteFoll) #4

That sounds okay to me.

What about like notifications? Iirc I will also have to click them in order to mark them as read. I rarely care about which post was liked in particular so just reading the thread name is enough in most cases.

The same applies to replies I might have read via email (which happens a lot).

(Remon Vd Kamp) #5

Any news on this?

I’ve recently stepped down from moderator to regular user on SitePoint, and now I’m stuck with 126 notifications I can’t get rid of because I can’t view the PMs the notifications are for anymore (no access).

A button to zap away all these notifications I’m unable to do anything with would be great!

(Jeff Atwood) #6

Hmm that is kind of a special case. Any ideas @sam?

(Sam Saffron) #7

I see, yeah I do not think we handle this right, only way around is probably to up you back to moderator clean up and bump down again.

We need to add a mechanism to fix this.

(Sol) #8

Isn’t there the possibility to add an entry under view older notifications… That is saying mark all as read?

(Sol) #9

I am afraid I can’t make a PR on my own for my suggestion :frowning: I hope someone may find some time to help out here :slight_smile:

(cpradio) #10

Before I waste any time looking into it, would Core accept the following PR?

Or would you prefer it on the /my/notifications page as a button?

Add "Dismiss all" link on Notifications Menu, like facebook
(Sam Saffron) #11

yeah that, I prefer to keep that on the users page.

(cpradio) #12

Okay, so obviously the space where I have arrows would be the ideal location, though I may experiment with floating it right and letting it exist within the same row as the first notification (play with, no guarantee it will remain that way)

Once I figure out where this section is (which template), I’ll get the button located, take some screenshots, and then work on the actual code behind it. :smile:

So if you object with it being in that “area”, speak now or forever hold your peace :wink:

(cpradio) #13

Updated screenshot to show button placement at both the top and bottom of the notifications area

@sam, would it be okay to utilize the bulkOperationByFilter and pass “unread”, “notifications”? Or should new routing be given for this (so it doesn’t go through /topics/bulk? Strike that, I don’t like the idea of reusing the topics one to do this… it doesn’t feel right.

(Mittineague) #14

With 2174 Notifications so far, I don’t really have a “bottom”

(Sol) #15

I really think that marking all as read as last point in the list would be great and also put it as an option in the profile but only in the profile… I do not really use the profile at the moment and do not want to be forced to use it :wink:

(cpradio) #16

Yeah, it was to make it “similar” to Dismiss New and Dismiss Topics/Posts, I highly doubt most of us have a “bottom” that we’d scroll to.

I was more so thinking, marking anything currently still shown as “unread” as “read”. As I’m not sure there is a “last point” and in real life scenarios, I find myself having more than 10 notifications (that the drop down is limited to) so several slip by over the days of use.

(cpradio) #17

I’m only stuck in two spots one spot now.

  1. how to reload the Notifications data after the Mark All as Read button is pressed.
  2. find a way to only show the Mark All as Read button when there are unread notifications

Can anyone help me figure out where I would write such code for notifications page and what it might look like?

I’ve attached a patch of the changes in my local branch so you can see what I’ve done up to this point. I feel I’m really close to this being implemented, I just need a little help to get it 100% there.
clear_notifications.patch.txt (11.4 KB)

Edit: I’ve got the button hiding/showing properly, now I just need a way to refresh the UI when the button is pressed.

(Sol) #18

Great effort. I hope someone can help you with that :slight_smile:

(cpradio) #19

Okay, so I discovered how the notification gets read when the URL is clicked, it is from notification-item.js.es6

  _markRead: function(){
    var self = this;
      self.set('notification.read', true);
      return true;

How might I go about this process for the button I’m adding to handle an event similar to this?

(Kane York) #20

Yeah, but that doesn’t tell the server anything. I think it’s updating the post timings that actually sets the read flag on the server.