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

Add unread notification markers #14818

Merged

Conversation

ClearlyClaire
Copy link
Contributor

Fixes #14804

(This is a port of glitch-soc#1423)

Refactor and rework unread notifications handling. In particular, new notifications are not marked as read if any of the following doesn't hold:

  • the tab/window is focused
  • the notification column is mounted
  • the notification column is scrolled to the top
  • all notifications are known, or the oldest known notification is older than the last read notification

If a new notification arrives when those conditions are met, or the user scrolls to the top and those conditions are met, then all notifications are marked as read.

Unread notifications are displayed with a highlighted border, as shown in the following image:

image

The display is only updated when the window/tab loses and regain visibility, or the tab is unmounted/remounted.

There is also a button to mark all notifications as read regardless of conditions.

@ClearlyClaire ClearlyClaire force-pushed the features/notification-read-markers branch 2 times, most recently from efa83ca to 39461e6 Compare September 19, 2020 12:43
@ClearlyClaire ClearlyClaire force-pushed the features/notification-read-markers branch from 39461e6 to a6abf22 Compare September 19, 2020 12:48
@ClearlyClaire ClearlyClaire marked this pull request as ready for review September 19, 2020 13:01
@ClearlyClaire
Copy link
Contributor Author

ClearlyClaire commented Sep 19, 2020

Pushed a change to IntersectionObserverArticle, without which updating the props of a notification is simply ignored until the notification gets completely outside the render window and re-rendered again. I am unsure about the performance implications of this.

EDIT: (this change has been made in glitch-soc for a while because we ran into the issue for other stuff)

@Gargron Gargron merged commit ff89025 into mastodon:master Sep 26, 2020
thenameisnigel-old pushed a commit to ChatterlyOSE/Chatterly that referenced this pull request Sep 28, 2020
* Add unread notification markers

Fixes mastodon#14804

* Allow IntersectionObserverArticle's children to be updated
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.

Unread notification marker
2 participants