Bug 503839

Summary: HTML "requireInteraction" flag makes notifications persistent, which can be a poor UX on desktop
Product: [Plasma] plasmashell Reporter: Oded Arbel <oded>
Component: NotificationsAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: kde, nate
Priority: NOR Keywords: usability
Version First Reported In: 6.3.5   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screenshot showing Firefox YouTube notifications and KDEConnect youtube notifications for the same event - where the Firefox one are incorrectly persistent
Screenshot of YouTube notification code

Description Oded Arbel 2025-05-06 12:30:30 UTC
Created attachment 180989 [details]
Screenshot showing Firefox YouTube notifications and KDEConnect youtube notifications for the same event - where the Firefox one are incorrectly persistent

SUMMARY
I'm not 100% sure this is a problem with Plasma, and I'm only seeing this issue with Firefox - and its a new one, so it might be that Firefox are doing something incorrectly, or there's a protocol misunderstanding somewhere. Or possibly this is just YouTube doing something weird - as all my repros are on YouTube.

When Firefox, with Plasma integration plugin installed, shows a notification for a YouTube notification, the notification is persistent - it does not automatically times out and has to be dismissed manually.

STEPS TO REPRODUCE
1. With Firefox 138, register to some YouTube channels
2. Wait until such channel issues a new video (maybe comment replies also pop this notifications)

OBSERVED RESULT
The notification pop up is persistent and does not have a timeout.

EXPECTED RESULT
The notification should be transient and go away after a while

SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.3
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.13.0
Qt Version: 6.8.3
Kernel Version: 6.11.0-25-generic (64-bit)
Graphics Platform: Wayland
Processors: 20 × 12th Gen Intel® Core™ i7-12700H
Memory: 31.0 GiB of RAM
Graphics Processor: Intel® Graphics

ADDITIONAL INFORMATION
The web notification test site https://www.bennish.net/web-notifications.html shows transient notifications as normal, so I'm not sure what is going on.
Comment 1 Oded Arbel 2025-05-06 13:33:05 UTC
Created attachment 180993 [details]
Screenshot of YouTube notification code

This looks to be "working as intended" - when the `Notification` HTML API has the `requireInteraction` flag set, which YouTube does set - the implementation of the notification "should remain active until the user clicks or dismisses it, rather than closing automatically" (https://developer.mozilla.org/en-US/docs/Web/API/Notification/requireInteraction) - which I guess translates to the Plasma notification being persistent.

I think this is a really poor choice of UI design from YouTube, and I guess this is a direct (and incorrect) translation from mobile notifications - where YouTube notifications stay in the notification area until you click on them, but as it isn't stuck in your face and prevents other notifications from showing, nobody cares.

This is the main problem - this `requireInteraction` use case doesn't translate well from mobile to desktop, as on the Plasma desktop, if I have a bunch of persistent notifications that I don't care a lot about but am too lazy to dismiss (I am registered to quite a few channels and I get > 20 notifications throughout my working day), this actually blocks other - more important - notifications from showing.

I wish there was a way to tell Plasma to disobey the `requireInteraction` flag, maybe for specific applications or even specific website. Maybe this can be implemented in the Firefox Plasma Integration plugin?