Improve actionable notification wrapper

This commit is contained in:
David Heinemeier Hansson
2026-05-25 23:51:48 +02:00
parent 322d1bc30d
commit af5e918dd5
10 changed files with 107 additions and 26 deletions
@@ -37,6 +37,11 @@ function shouldBypassDnd(notification, criticalUrgency) {
return appName === "notify-send" && notification && notification.urgency === criticalUrgency
}
function isEphemeralApp(appName) {
var name = String(appName || "")
return name === "notify-send" || name === "omarchy-action"
}
function glyphFromHints(hints) {
try {
if (hints) {
@@ -167,6 +172,7 @@ if (typeof module !== "undefined") {
sanitizeBody: sanitizeBody,
summaryStartsWithGlyph: summaryStartsWithGlyph,
shouldBypassDnd: shouldBypassDnd,
isEphemeralApp: isEphemeralApp,
glyphFromHints: glyphFromHints,
snapshotOf: snapshotOf,
historyEntry: historyEntry,
+3 -3
View File
@@ -133,15 +133,15 @@ Item {
// - app_name is "notify-send" (the CLI default — means the sender
// didn't bother declaring an identity, so it's almost certainly
// ephemeral test/feedback noise)
// - app_name is "omarchy-action" (omarchy's own user-action
// confirmation toasts — the user just triggered them, they don't
// - app_name is "omarchy-action" (Omarchy's own user-action
// toasts — the user just triggered them, they don't
// need to be archived)
var transient = false
try {
transient = !!(notification.hints && notification.hints["transient"])
} catch (e) { transient = false }
var appName = String(notification.appName || "")
var ephemeralApp = appName === "notify-send" || appName === "omarchy-action"
var ephemeralApp = NotificationLogic.isEphemeralApp(appName)
if (transient || ephemeralApp) {
if (service.doNotDisturb && !shouldBypassDnd(notification)) {
notification.tracked = false