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

Sync notifications badge between tabs #7219

Open
adufr opened this issue Jan 16, 2024 · 2 comments
Open

Sync notifications badge between tabs #7219

adufr opened this issue Jan 16, 2024 · 2 comments

Comments

@adufr
Copy link

adufr commented Jan 16, 2024

Description

I often use multiple github tabs on my browser, and I always find out really annoying that this bad boy is not synced between tabs:
image

I would like that; when I mark my notifications as "Read", it syncs across all tabs so I don't have to refresh them. Would it be possible? Maybe using the "Broadcast Channel API" ?

I'd be happy to work on this if you judge it feasible and useful, and if you could give me some directions as this would be my first contribution :)

Example URLs

https://github.com (all github pages)

@fregante
Copy link
Member

I agree this is quite annoying, but how can you know which state is correct? Just because you just marked all notifications as read, it doesn't mean that another notification didn't appear while you switch tabs. In short it might not be very straightforward in practice.

I think what this other extension does is safer: it just polls GitHub and improves the handling of the icon:

@adufr
Copy link
Author

adufr commented Jan 16, 2024

Thanks for your quick response!

What about if we also sync the badge when there's a new notification?

Given that I have 2 GitHub tabs already opened, A and B:

  • I have the "New notifications" badge displayed on both tabs
  • I'm on tab A, I go to my notifications and clear them all
  • I switch to tab B, the extension removed the badge for me
  • I continue browsing GitHub on tab B, each action natively refreshes to see if there are new notifications => if yes, use the same process to also add the badge to tab A

This way, when I switch back to tab A, the notification icon shows the "new notification badge" without having to refresh the page
The only prerequisite would be to figure out a way to catch the "there's a new notification" event, but I think that it's possible


I checked the "notifications-preview-github" extension you just linked, looks cool but sadly it's very glitchy and doesn't really fit my use-case.

Should we still look for a way to implement this in Refined Github or should I just roll my own extension?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants