From c0473d87565569202d548eba47279321e287990c Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 15 Sep 2026 14:54:36 +0200 Subject: fix(notifications): apply final review fixes Mirror the balloon's right-click close-all on the drawer row: the spec says the gestures are identical in both forms, and a right-click on a row previously did nothing. The right-button branch precedes the live guard so it behaves the same on history rows. Stop importing the Status singleton into the notification shell. Referencing it instantiated it, and its onPresentationChanged writes status.dnd and runs breaktimer.sh, so a read-only consumer was writing state and shelling out on every presentation toggle, and doubled the dndBeforePresentation race. Notify now reads "/run/user//status.dnd" directly through a FileView, the same convention as the notifyd files; a missing file means off. AGENTS.md named Drawer.qml as the drawer's reserved space; it is desktop/NotificationList.qml. --- shared/Notify.qml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'shared/Notify.qml') diff --git a/shared/Notify.qml b/shared/Notify.qml index ff07575..897e50b 100644 --- a/shared/Notify.qml +++ b/shared/Notify.qml @@ -39,6 +39,14 @@ Singleton { // Epoch milliseconds; 0 means not snoozing. property double snoozeUntil: 0 + // Read from the status registry's own file rather than from the Status + // singleton. The renderers only read DND; referencing Status here would + // instantiate it, and its onPresentationChanged writes status.dnd and + // shells out to breaktimer.sh, side effects a read-only consumer must not + // trigger. The file is the interface, so reading it directly is the same + // value with none of the write side. + property bool dnd: false + function parseQueue() { try { root.queue = JSON.parse(queueFile.text() || "[]"); } catch (e) { root.queue = []; } @@ -108,6 +116,16 @@ Singleton { onLoadFailed: root.drawerOpen = false } + FileView { + id: dndFile + path: (Quickshell.env("XDG_RUNTIME_DIR") || "/tmp") + "/status.dnd" + watchChanges: true + printErrors: false + onFileChanged: reload() + onLoaded: root.dnd = dndFile.text().trim() === "1" + onLoadFailed: root.dnd = false + } + FileView { id: snoozeFile path: root.dir + "/snooze" -- cgit v1.2.3