Standardize all notification sending

This commit is contained in:
David Heinemeier Hansson
2026-05-17 19:51:29 +02:00
parent 682c6406bd
commit 4e2da8480a
24 changed files with 62 additions and 90 deletions
@@ -606,6 +606,7 @@ Item {
navStack = []
filterText = ""
selectedIndex = 0
root.evaluateGuards()
opened = true
rebuildDisplay()
loadProviderForMenu(activeMenu)
@@ -134,8 +134,8 @@ Item {
// "Screenshot saved"). The user JUST did something — their feedback
// should show.
// - urgency=critical AND app_name=notify-send: bare-CLI emergency alerts
// (omarchy-battery-monitor uses this for low-battery; install-time
// scripts for wifi setup, etc.). Trusted because it's almost always
// (omarchy-battery-monitor uses this for low-battery; a few scripts
// use it for emergency failures). Trusted because it's almost always
// omarchy or system shell scripts — chat apps set app_name to
// their brand (Discord/Slack/Vesktop) which falls outside this rule.
function shouldBypassDnd(notification) {
@@ -366,7 +366,7 @@ Item {
// Invoke the libnotify "default" action on the popup's underlying
// notification, if it has one, then dismiss. Clients register the default
// action with the canonical identifier "default"; e.g. screenshot toasts
// use `notify-send -A default=Edit` so click-the-card opens the editor.
// use `notify-send -A default=Edit ...` so click-the-card opens the editor.
function invokePopupDefault(index) {
if (index < 0 || index >= popupModel.count) return
var entry = popupModel.get(index)
@@ -64,8 +64,7 @@ Rectangle {
// `appIcon` (-i flag) still get one.
readonly property string smallIconSource: image.length > 0 ? image : appIcon
readonly property bool hasGlyph: glyph.length > 0
readonly property bool inlineGlyph: summary.match(/^[^\s]+\s{2,}/) !== null
readonly property bool hasSmallIcon: !mediaMode && !inlineGlyph && (smallIconSource.length > 0 || hasGlyph)
readonly property bool hasSmallIcon: !mediaMode && (smallIconSource.length > 0 || hasGlyph)
readonly property bool chromiumDerived: {
var source = (app + "\n" + appIcon).toLowerCase()
return source.indexOf("chrom") >= 0 || source.indexOf("brave") >= 0 ||