WIP: refactor client to use native Notifications API #219
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/notifications"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Taking this as a starting point from @Michcio 's work. I think there are still some things to be fixed:
5d9bc2553b
)If a notifications widget is also present that may mark notifications as read, but if not notifications will be shown and not marked as read.
notification-toast.vue
component, use i18n)Also I'm not sure what happens if you were to return to Foundkey and have a bunch of unread notifications. Would your phone explode with notifications? In that case we might want to e.g. not send notifications through the native API that are older than some threshold, and instead only show them in the notifications widget.
I use this on my instance, and, there's a small problem, you are getting notifications on only one device, and so that device is a phone in my case, you are also getting misskey sounds on pc, but notifications are going to phone for some reason unknown to me
Some notes from me:
I believe the requestPermission call is broken right now because at least Safari demands that it must only be called in direct result of user action.
Idk where's Jeder's problem coming from, sorry.
Idk what notification type "app" is which is why this rapidly thrown together code ignores it.
I specifically didn't want to mark notifications as read because it annoys me af when UI decides that oh you've seen it because you were on the page and then I only actually see it hours later by accident.
re: coming back and exploding. I don't think it would happen because this ties into a notification stream which only processes notifs as they come in?
Also I remember my assignment of images to Notification attributes freaked Jeder out initially. I didn't notice it could sometimes produce a huge anime girl on your screen because Safari ignores images completely.
I've been seeing this error in the Firefox dev console for a while:
Apps can create custom notifications via the API endpoint
notifications/create
.Okay understandable with the way Firefox shows a notification (fades out after some time). But might be a different story on mobile, if it displayed like normal notifications that you have to swipe away? (No idea if that is actually how it works.)
I think there may be a separate event on a Notification object on it being dismissed, I didn't get to figuring it out though
On Windows, Android, and probably any other os with a notification drawer, those notifications show up for few seconds, and then go to that drawer, waiting for you to dismiss them
Should have thought of this earlier, but the service worker basically already has all this implemented in the push notification handler.
So instead of reimplementing this, the thing to fix is: If the instance does not have push notifications enabled, get the notification data into the service worker.
I think it makes more sense to start over since the modifications here are unnecessary then.
Pull request closed