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
+68 -50
View File
@@ -7,88 +7,101 @@ import QtQuick.Layouts
import ZShell.Components
import ZShell.Config
import qs.Components
import qs.Modules
import qs.Daemons
import qs.Modules
import qs.Services
Item {
id: root
readonly property int notifCount: NotifServer.list.reduce((acc, n) => n.closed ? acc : acc + 1, 0)
required property ScreenState screenState
readonly property int notifCount: NotifServer.notClosed.length
anchors.fill: parent
anchors.margins: Tokens.padding.small
Component.onCompleted: NotifServer.list.forEach(n => n.popup = false)
Component.onCompleted: NotifServer.list.forEach(n => n.dismissPopup())
Item {
id: title
anchors.left: parent.left
anchors.margins: 4
anchors.right: parent.right
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: Tokens.padding.extraSmall
implicitHeight: Math.max(count.implicitHeight, titleText.implicitHeight)
CustomText {
id: count
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: root.notifCount > 0 ? 0 : -width - titleText.anchors.leftMargin
anchors.verticalCenter: parent.verticalCenter
opacity: root.notifCount > 0 ? 1 : 0
text: root.notifCount
color: Colors.palette.m3outline
font: Tokens.font.label.large
opacity: root.notifCount > 0 ? 1 : 0
text: root.notifCount
Behavior on anchors.leftMargin {
Anim {}
}
Behavior on opacity {
Anim {}
Anim {
type: Anim.DefaultEffects
}
}
}
CustomText {
id: titleText
anchors.left: count.right
anchors.leftMargin: 7
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
color: Colors.palette.m3outline
elide: Text.ElideRight
font: Tokens.font.label.large
anchors.left: count.right
anchors.right: parent.right
anchors.leftMargin: Tokens.spacing.extraSmall
text: root.notifCount > 0 ? qsTr("notification%1").arg(root.notifCount === 1 ? "" : "s") : qsTr("Notifications")
color: Colors.palette.m3outline
font: Tokens.font.label.large
elide: Text.ElideRight
}
}
Item {
id: clipRect
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.top: title.bottom
anchors.topMargin: 10
anchors.bottom: parent.bottom
anchors.topMargin: Tokens.spacing.medium
clip: true
Loader {
active: opacity > 0
asynchronous: true
anchors.centerIn: parent
active: opacity > 0
opacity: root.notifCount > 0 ? 0 : 1
Behavior on opacity {
Anim {}
}
sourceComponent: ColumnLayout {
spacing: 20
sourceComponent: SnapLayout {
orientation: Qt.Vertical
spacing: Tokens.spacing.extraLarge
CustomText {
Layout.alignment: Qt.AlignHCenter
text: qsTr("No notifications")
color: Colors.palette.m3outlineVariant
font: Tokens.font.headline.builders.small.width(90).build()
text: qsTr("No Notifications")
}
}
Behavior on opacity {
Anim {
type: Anim.StandardExtraLarge
}
}
}
@@ -97,10 +110,10 @@ Item {
id: view
anchors.fill: parent
contentHeight: notifList.implicitHeight
contentWidth: width
flickableDirection: Flickable.VerticalFlick
clip: true
contentWidth: width
contentHeight: notifList.implicitHeight
CustomScrollBar.vertical: CustomScrollBar {
flickable: view
@@ -109,8 +122,8 @@ Item {
NotifDockList {
id: notifList
container: view
screenState: root.screenState
container: view
}
}
}
@@ -118,21 +131,19 @@ Item {
Timer {
id: clearTimer
interval: Math.max(15, Math.min(80, 69.8 - 12.3 * Math.log(NotifServer.notClosed.length)))
repeat: true
triggeredOnStart: true
interval: Math.max(15, Math.min(80, 69.8 - 12.3 * Math.log(NotifServer.notClosed.length)))
onTriggered: {
const first = NotifServer.notClosed[0];
if (!first) {
const group = NotifServer.groups[0];
if (!group) {
stop();
return;
}
const appName = first.appName;
let cleared = 0;
for (const n of NotifServer.notClosed.filter(n => n.appName === appName)) {
n.close();
for (const n of [...group.activeNotifs]) {
n.dismiss();
cleared++;
if (cleared > 30) {
interval = 5;
@@ -143,33 +154,40 @@ Item {
}
Loader {
active: opacity > 0
anchors.bottom: parent.bottom
anchors.margins: Tokens.padding.small
asynchronous: true
anchors.right: parent.right
opacity: root.notifCount > 0 ? 1 : 0
scale: root.notifCount > 0 ? 1 : 0.5
anchors.bottom: parent.bottom
anchors.margins: Tokens.padding.medium
scale: root.notifCount > 0 ? 1 : 0.5
opacity: root.notifCount > 0 ? 1 : 0
active: opacity > 0
Behavior on opacity {
Anim {}
}
Behavior on scale {
Anim {}
}
sourceComponent: IconButton {
id: clearBtn
font: Tokens.font.icon.large
icon: "clear_all"
font: Tokens.font.icon.large
isRound: true
onClicked: clearTimer.start()
Elevation {
anchors.fill: parent
level: clearBtn.stateLayer.containsMouse ? 4 : 3
radius: parent.radius
z: -1
level: clearBtn.stateLayer.containsMouse ? 4 : 3
}
}
Behavior on scale {
Anim {
type: Anim.FastSpatial
}
}
Behavior on opacity {
Anim {
type: Anim.DefaultEffects
}
}
}