mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-06 04:29:34 +02:00
Improve actionable notification wrapper
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user