Repository navigation
Conversation
Chromium stamps urgency=critical on every web notification it relays, so Teams/YouTube PWA toasts sat on screen until dismissed by hand. Reserve the permanent popup for the same trusted senders the DND bypass recognizes (omarchy-action, notify-send); brand-named apps fall through to the normal lifetime. Fixes omacom#13153 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Automated AI review
Verified: the change gives the payload reported in #13153 (
Verified: both Chromium marks a notification critical only when the page sets
|
|
Overlapping work to weigh against this:
Also, as the earlier review noted, Chromium doesn't stamp critical on every web notification, so the comment in |
|
Thanks @johnturek! I know the Chromium-stamps-everything-critical part is annoying. In the new notification engine (#15932) that's deliberate: critical means "stays until you dismiss it" ( |
Fixes #13153
Problem
Notifications relayed by Chromium-based browsers (Teams PWA, YouTube, etc.) stay on screen until dismissed by hand. Chromium stamps
urgency=criticalon every web notification it forwards, anddurationFor()inService.qmlmapped critical urgency to a lifetime of0(forever) regardless of who sent it. The persisted popup state confirms it:{ "app": "Google Chrome", "urgency": 2, "expireTimeout": 0 }The DND code already notes that chat apps abuse critical urgency, but the popup lifetime didn't apply the same skepticism.
Fix
Reserve the permanent popup for critical toasts from the same two senders the DND bypass already trusts:
omarchy-action(Omarchy's own toasts — first-run hooks, battery-low, migrations) andnotify-send(bare-CLI alerts). Critical toasts from any brand-named app fall through to the normal lifetime (8s, stretched up to 30s if the sender asked for a longerexpire_timeout).NotificationLogic.js: addkeepsCriticalOnScreen(appName)so the rule is Node-testableService.qml:durationFor()takes the app name; both call sites (live card slot andrestorePopups) pass itdocs/notifications.md: document the sender-aware rule in the toast lifecycle sectionBehavior
omarchy-action/notify-sendRestored popups after a shell restart follow the same rule, so a stuck Chrome toast persisted before this change is archived on the next restart instead of coming back.
Testing
test/shell.d/notifications-test.sh: five new assertions covering trusted senders, Chromium, chat apps, and an empty app name — all pass./test/shell: no new failures (remaining failures inconfig,kernel-headers-migration,omarchy-kernel-migration,snapper,unowned-system-pathsreproduce identically on an untouched checkout in this environment)omarchy dev link, received a YouTube/Teams notification, confirmed it expired after 8s whileomarchy-notification-send -u criticaltoasts still stay pinned