feat(notifications): focus sender window on click in notification history

This commit is contained in:
Alexander Nabokikh
2026-02-24 13:34:13 +01:00
parent 90e44d6edd
commit 0fad4c5f1f
@@ -560,6 +560,7 @@ SmartPanel {
property int listIndex: index
property string notificationId: model.id
property string appName: model.appName || ""
property bool isExpanded: scrollView.expandedId === notificationId
property bool canExpand: summaryText.truncated || bodyText.truncated
property real swipeOffset: 0
@@ -775,6 +776,17 @@ SmartPanel {
notificationDelegate.pendingLink = "";
return;
}
// Focus sender window (and invoke default action if available)
var actions = notificationDelegate.actionsList;
var hasDefault = actions.some(function(a) { return a.identifier === "default"; });
if (hasDefault) {
NotificationService.focusSenderWindow(notificationDelegate.appName);
NotificationService.invokeAction(notificationDelegate.notificationId, "default");
} else {
NotificationService.focusSenderWindow(notificationDelegate.appName);
}
root.close();
}
onCanceled: {
notificationDelegate.isSwiping = false;
@@ -932,7 +944,9 @@ SmartPanel {
// Capture modelData in a property to avoid reference errors
property var actionData: modelData
onClicked: {
NotificationService.focusSenderWindow(notificationDelegate.appName);
NotificationService.invokeAction(notificationDelegate.notificationId, actionData.identifier);
root.close();
}
}
}