Skip to content

Let a browser's critical notifications time out - #16689

Open
ThatRetiredDude wants to merge 3 commits into
omacom:quattrofrom
ThatRetiredDude:notification-browser-critical
Open

ThatRetiredDude wants to merge 3 commits into
omacom:quattrofrom
ThatRetiredDude:notification-browser-critical

Conversation

@ThatRetiredDude

@ThatRetiredDude ThatRetiredDude commented Oct 26, 2026 •

Copy link
Copy Markdown

Sites can have the browser send their pushes critical, and many do it for everyday ones, so they stacked up until dismissed by hand. Critical still waits for every other sender.

Fixes #13153 (also reported as #16641).

Problem

A site can have the browser send its web-push notifications with critical urgency, and many sites (YouTube, for example) do this for everyday pushes. durationFor in shell/plugins/notifications/Service.qml gives every critical notification a lifetime of 0, so these cards never expire and stack up until dismissed by hand.

Change

durationFor now takes the sender's app name and keeps the never-expire lifetime for critical notifications only when the sender is not a browser. It reuses the existing Markup.isBrowser list (Chrome, Chromium, Brave, Edge, Vivaldi, Opera, Helium, Firefox, Zen, LibreWolf), so a browser's critical card gets the normal 8s lifetime, stretched up to 30s if it asks for longer. The card keeps its critical urgency for everything else, and Do Not Disturb is unchanged.

This follows the same reasoning as Delivery.bypassesQuiet, where critical urgency alone isn't trusted because apps use it to force visibility. Critical alerts from Omarchy's own commands, notify-send, and other apps still wait for you.

Tests

Added a case to test/shell.d/notifications/logic.cjs: critical notifications from Chromium and Google Chrome get an 8s duration, while critical ones from notify-send and Slack keep 0. The case fails on quattro (Chromium gets 0), and test/shell.d/notifications-test.sh passes with the change.

The change was written with AI models under my direction. I reviewed it myself, and the testing above was run before opening this PR.

@greptile-apps

greptile-apps Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge.

Summary

Browser critical notifications now expire instead of waiting for dismissal.

  • Browser critical notifications time out like other browser notifications.

Reviews (5) · Last reviewed commit: "Document that a browser's critical notif..." · Reviewed by Greptile

Comment thread shell/plugins/notifications/Service.qml Resolved
@aholbreich

Copy link
Copy Markdown
Contributor

#16690 makes the same change for #16640, and #16641 is a double submission of that report. Both let a browser's critical cards time out like normal ones while other senders' criticals keep waiting. This one reuses Markup.isBrowser(), the shell's existing browser list. #16690 adds a second browser regex in Delivery.js, but it also updates docs/notifications.md. #16654 goes further and times out every critical, which changes the documented "critical waits for you". I read the diffs and didn't run them. Whether a browser's critical may time out at all is a maintainer call; if it may, these two should be merged into one, crediting both.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks @ThatRetiredDude. I read the diff, the linked report #16641 and the existing comments; nothing was run yet, because the classification is unsettled and it stops here until that is decided.

Why it is unsettled. Two models classified this separately and disagreed. I (Claude Opus 5.5) read it as a bug fix: a site's everyday web pushes arrive from the browser as critical, and durationFor in shell/plugins/notifications/Service.qml gives every critical a lifetime of 0, so they stack until dismissed by hand. Codex at medium effort read it as an enhancement: "critical waits for you" is the documented behaviour in docs/notifications.md, and this changes it on purpose for one class of sender. Both readings hold up, so it carries no class label and was not verified on a worker.

Related. #16690 makes the same change for the same report (#16640, which #16641 duplicates), opened ten minutes after this one, with its own browser regex in Delivery.js instead of Markup.isBrowser. #16654 times out every critical after 30s, which is the broader behaviour change.

Waiting on the maintainer: whether a browser's critical may time out at all, which also settles whether this is a fix or a change in behaviour. Once that is decided it goes on to review and a test run on a worker.

@ThatRetiredDude
ThatRetiredDude force-pushed the notification-browser-critical branch from da1e443 to b16fc61 Compare November 27, 2026 20:47
@omarchybot

Copy link
Copy Markdown
Collaborator

I read the revised diff and #13153. The revision now gives restored browser cards a timeout too and documents both paths. GPT-6.2 Sol in Codex (high effort) classified it as an enhancement because it changes the documented lifetime for all critical notifications from recognized browsers. DeepSeek (deepseek-v4p1-flash, default reasoning) classified it as a bug fix. The classification still needs a maintainer decision before worker verification.

Sites can have the browser send their pushes critical, and many do it for
everyday ones, so they stacked up until dismissed by hand. Critical still
waits for every other sender.
A card restored after a restart or replayed from history went back to
never expiring, because the restore path had its own critical rule.
@ThatRetiredDude
ThatRetiredDude force-pushed the notification-browser-critical branch from b16fc61 to 12ffbd7 Compare December 2, 2026 13:08
@omarchybot omarchybot added the enhancement New feature or request label Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chrome/Teams critical notifications never expire

3 participants