feat: better notification storage and image caching + blobs
C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 11s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 12s
JS/TS / lint (pull_request) Successful in 10s
Python / static (pull_request) Failing after 27s
Rust / build (pull_request) Successful in 54s
Python / verify (pull_request) Failing after 1m26s
Rust / fmt (pull_request) Successful in 46s
Rust / clippy (pull_request) Successful in 1m6s

This commit is contained in:
2026-11-02 19:00:43 +01:00
parent 789305286a
commit 11e7aac195
56 changed files with 5003 additions and 2168 deletions
+56 -7
View File
@@ -6,8 +6,10 @@ import QtQuick
import QtQuick.Layouts
import ZShell.Components
import ZShell.Config
import ZShell.Services
import qs.Modules
import qs.Components
import qs.Components.Notifs
import qs.Helpers
import qs.Daemons
import qs.Services
@@ -34,7 +36,7 @@ CustomRect {
color: Colors.palette.m3outline
elide: Text.ElideRight
font: Tokens.font.mono.builders.small.weight(Font.Medium).build()
text: NotifServer.list.length > 0 ? qsTr("%1 notification%2").arg(NotifServer.list.length).arg(NotifServer.list.length === 1 ? "" : "s") : qsTr("Notifications")
text: NotifServer.notClosed.length > 0 ? qsTr("%1 notification%2").arg(NotifServer.notClosed.length).arg(NotifServer.notClosed.length === 1 ? "" : "s") : qsTr("Notifications")
}
Item {
@@ -44,7 +46,7 @@ CustomRect {
Loader {
active: opacity > 0
anchors.centerIn: parent
opacity: NotifServer.list.length > 0 ? 0 : 1
opacity: NotifServer.notClosed.length > 0 ? 0 : 1
Behavior on opacity {
Anim {
@@ -59,8 +61,11 @@ CustomRect {
}
CustomListView {
id: list
anchors.fill: parent
clip: true
orientation: Qt.Vertical
spacing: Tokens.spacing.small
add: Transition {
@@ -78,7 +83,7 @@ CustomRect {
to: 1
}
}
delegate: NotifGroup {}
delegate: NotifRow {}
displaced: Transition {
Anim {
properties: "opacity,scale"
@@ -92,10 +97,7 @@ CustomRect {
}
}
model: ScriptModel {
values: {
const list = NotifServer.notClosed.map(n => [n.appName, null]);
return [...new Map(list).keys()];
}
values: [...NotifServer.groups].filter(g => g.count > 0)
}
move: Transition {
Anim {
@@ -123,4 +125,51 @@ CustomRect {
}
}
}
component NotifRow: Item {
id: row
required property NotificationGroup modelData
property bool expanded: false
function dismissAll(): void {
for (const n of [...modelData.activeNotifs])
n.dismiss();
}
implicitHeight: card.implicitHeight
implicitWidth: list.width
NotifSwipeArea {
id: area
implicitHeight: card.implicitHeight
implicitWidth: row.implicitWidth
expanded: row.expanded
onDismissed: row.dismissAll()
onRequestExpand: expand => row.expanded = expand
onSwiped: row.dismissAll()
Item {
anchors.top: parent.top
implicitHeight: card.implicitHeight
implicitWidth: row.implicitWidth
clip: true
NotifGroupCard {
id: card
baseLayer: 1
container: list
expanded: row.expanded
group: row.modelData
onRequestExpand: expand => row.expanded = expand
onSwiped: notif => notif.dismiss()
}
}
}
}
}