Drop notification action buttons now that the Pinyin prompt is suppressed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier HanssonandClaude Opus 5.5 committed 2026-10-11 07:51:59 +09:00
1 parent d579157881
commit 8b5ebc57bf
4 files changed
+2 -58

No files matched your search

+1 -21
View File
@@ -239,7 +239,7 @@ Item {
// about after the popup exists.
readonly property var updateSignals: [
"summaryChanged", "bodyChanged", "appNameChanged", "appIconChanged",
"imageChanged", "urgencyChanged", "expireTimeoutChanged", "hintsChanged", "actionsChanged"
"imageChanged", "urgencyChanged", "expireTimeoutChanged", "hintsChanged"
]
// A client that updates a notification through replaces_id does not produce
@@ -431,26 +431,10 @@ Item {
// libnotify action — they just expect clicking the notification to
// focus their window. Fall back to focusing the sending app by class so
// that click-to-jump actually works.
if (!invoked && entry.actionsJson && entry.actionsJson !== "[]") return
if (!invoked) focusApp(entry)
dismissPopup(index)
}
function invokePopupAction(index, identifier) {
if (index < 0 || index >= popupModel.count) return
var entry = popupModel.get(index)
var ref = entry && !isRestoredRow(entry) ? liveRefs[entry.originalId] : null
if (!ref || !ref.actions) return
for (var i = 0; i < ref.actions.length; i++) {
var action = ref.actions[i]
if (action && action.identifier === identifier) {
action.invoke()
dismissPopup(index)
return
}
}
}
// Try to focus an existing Hyprland window matching the notification's
// sender. The helper handles case-insensitive class matching.
function focusApp(entry) {
@@ -746,7 +730,6 @@ Item {
image: "",
glyph: "󰂚",
execArgv: "",
actionsJson: "[]",
urgency: NotificationUrgency.Low,
expireTimeout: 0,
timestamp: Date.now()
@@ -1065,7 +1048,6 @@ Item {
required property string body
required property string image
required property string glyph
required property string actionsJson
required property int urgency
required property double expireTimeout
required property double timestamp
@@ -1117,11 +1099,9 @@ Item {
cornerRadius: service.cornerRadius
fontFamily: service.shell && service.shell.bar ? service.shell.bar.fontFamily : ""
glyph: cardSlot.glyph
actions: JSON.parse(cardSlot.actionsJson || "[]")
onCloseRequested: service.dismissPopup(cardSlot.index)
onCardClicked: service.invokePopupDefault(cardSlot.index)
onActionClicked: identifier => service.invokePopupAction(cardSlot.index, identifier)
}
}
}