omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Critical notifications have no visible close button and never auto-expire (crash toasts get stuck forever)

Open mrocha-montes opened this issue 3 months ago • 6 comments

What happened

Critical-urgency notifications (--urgency critical / NotificationUrgency.Critical) have no visible way to dismiss them and never auto-expire, so they can get stuck on screen indefinitely.

This is most visible with the built-in crash-detection feature: omarchy-crash-watch sends its "Process crashed: X — Click to diagnose with AI" toast with --urgency critical. If the user doesn't already know that right-click dismisses a notification card (there is no visible close button, no X, nothing in the UI hints at it), that toast just sits there permanently, since Service.qml's durationFor() explicitly returns 0 (no timer) for NotificationUrgency.Critical.

Reproduce directly, no crash needed:

omarchy notification send -u critical "Test" "This will never go away and has no visible close button"

What was expected

Either:

  • a small, always-visible dismiss button on the notification card (in addition to right-click), and/or
  • critical notifications eventually auto-expiring after a generous timeout (e.g. 20-30s) instead of never, since "never expires" + "no visible way to close" compounds into a notification that's effectively stuck forever for anyone who hasn't read the source.

Suggested fix

In /usr/share/omarchy/shell/plugins/notifications/components/NotificationCard.qml, add a small × button (top-right corner of the card) wired to the existing closeRequested() signal — the plumbing already exists (right-click already calls it), it's just not exposed visually.

In /usr/share/omarchy/shell/plugins/notifications/Service.qml, durationFor() could give NotificationUrgency.Critical a bounded duration (e.g. Math.min(maxPopupDuration, Math.max(20000, requestedDuration(expireTimeout)))) instead of hardcoding 0. The per-card countdown plumbing (cardSlot.lifetime, remainingLifetime, the hover-pauses-countdown Timer) already exists and already handles lifetime <= 0 as "never expire" — enabling it for critical is a one-line change.

I patched a local clone of the notifications plugin with exactly this (visible close button + bounded critical timeout + a small depleting progress bar reusing the already-computed remainingLifetime value) and it works well; happy to open a PR with it if that's useful.

Environment

  • Omarchy version: 4.0.1-1
  • Kernel: 7.1.9-arch1-2 (Arch Linux)
  • GPU: Intel UHD Graphics 620 (i915)
  • Compositor: Hyprland (default Omarchy shell / Quickshell)

(omarchy debug --no-sudo --print is not available as a command on this installed version, so I couldn't attach the standard diagnostic log — omarchy commands --all doesn't list a debug command either.)

mrocha-montes avatar Aug 31 '26 12:08 mrocha-montes

Open PR #9010 addresses the visible-dismissal half of this report by adding a themed left-click close button that emits the existing closeRequested() signal. It does not add bounded expiry for critical notifications, so this is a partial link rather than a complete fix.

rookepoole avatar Sep 01 '26 08:09 rookepoole

A second partial implementation is PR #8980: it keeps the existing notification dismiss button permanently visible and uses the notification text color, specifically covering persistent critical/crash notifications. This differs from #9010, which adds a themed explicit close control. Like #9010, #8980 addresses discoverable dismissal but does not add a bounded critical-notification expiry.

rookepoole avatar Sep 01 '26 08:09 rookepoole

Opened #9660, which is adjacent to this but deliberately does not close it.

It takes the other half of the problem: senders that misdeclare urgency. A notifications.rules[] block in shell.json rewrites the urgency a sender declared, applied at ingest so popup lifetime, the do-not-disturb bypass and history all read the corrected value. That covers the chat apps this thread mentions — a browser PWA that sets requireInteraction arrives as critical, and a rule can put it back to normal so it expires on the usual timer.

What it does not address is the case in the original report: omarchy-crash-watch toasts are genuinely critical, and remapping Omarchy's own alerts to get them to expire would be the wrong fix. A bounded default for NotificationUrgency.Critical in durationFor(), as suggested above, is still the right change for that and is untouched by #9660 — the two compose cleanly if both land.

Also orthogonal to #9010 and #8980: #9660 touches neither the card nor durationFor(), so a visible dismiss control and this can go in independently.

wjax avatar Sep 01 '26 18:09 wjax

Opened https://github.com/omacom/omarchy/pull/11009 for the reminder-specific persistence request in Discussion #5784. It adds one more intentional use of a persistent critical toast, but deliberately does not alter the generic critical-notification lifetime or close affordance. Linking it here because #9361 remains the relevant work for making dismissal of such toasts discoverable.

Brams-s avatar Sep 09 '26 17:09 Brams-s

Checked this against the source on quattro (fcf9eeb5c) and the 4.0.1–4.0.4 release tags. Nothing was run on a worker: both halves are settled by the source and its history.

Visible close button: already fixed on quattro, not yet released. #6946 (9b72edcc9, merged 2026-08-15) added a ✕ to the top-right corner of every notification card, shown while the pointer is over the card (shell/plugins/notifications/components/NotificationCard.qml:199-225). It is not gated on urgency, so a critical crash toast gets it too, and clicking it dismisses without starting the AI diagnosis. No release contains it: v4.0.1 to v4.0.4 are built from the 4.0.x backport line, which forked from quattro the day before #6946 landed, so the cards there still only dismiss on right-click, exactly as you describe. It reaches users when quattro ships, or sooner if 9b72edcc9 is backported to 4.0.x. #7711 is the older report of this half.

Critical toasts never expiring: deliberate, not a defect. durationFor() in shell/plugins/notifications/Service.qml:102-105 returns 0 for NotificationUrgency.Critical on purpose, which matches the freedesktop notification spec ("critical notifications should not automatically expire"). Whether Omarchy should bound them anyway is a product decision, and several open pull requests propose different ways to do it (#13161, #13159, #13100, #13041, #12964); #8980 proposes keeping the ✕ visible without hovering. Which of those, if any, is the maintainer's call.

Reviewed by Claude Opus 5.5 and independently by Codex Medium, which reached the same conclusions from the source; that agreement is not a guarantee of independence. This now waits on the maintainer: whether to backport #6946 to 4.0.x, and whether critical toasts should get a bounded lifetime.

omarchybot avatar Oct 09 '26 10:10 omarchybot

Confirmed on Omarchy 4.5.0-3: the visible-dismissal half is fixed. Every toast now shows a ✕ in the corner while the pointer is over the card (shell/plugins/notifications/Toast.qml), and critical/crash toasts get it too.

durationFor() still returns 0 for NotificationUrgency.Critical (shell/plugins/notifications/Service.qml). As noted above, that is deliberate and matches the freedesktop spec. Whether critical toasts get a bounded lifetime is a product decision, and the open PRs listed above already cover it.

The part this issue was about is solved, so I'm closing it. Thanks!

mrocha-montes avatar Nov 07 '26 13:11 mrocha-montes