Repository navigation
fix(notifications): edit rules from the menu instead of deleting them - #3670
Merged
Merged
Conversation
A notification rule can set an action and Bypass DND together, but Unmute and Block in Do Not Disturb spliced the whole rule, dropping the other setting. They now reset only their own field, and a rule is removed once it no longer does anything (action and urgency default, no bypass). Mute and Allow in Do Not Disturb set their field on the app's existing rule instead of appending one that first-match policy would shadow. The menu now only reads and edits enabled, exact rules on the app name or desktop entry. It used to match any rule whose pattern equaled the app name, including summary, body, contains and regex rules, and could delete disabled ones. Also adds a Copy item to the notification menu on popups and center cards, copying the summary and body as plain text.
Rule actions are first-match, so a mute rule behind an app's existing rule (e.g. No history) never applied while the menu showed Unmute. Mute is now evaluated like Bypass DND: any matching enabled mute rule disables the popup, and the other actions stay first-match, so No history and Mute both apply.
The notification sound played before the check that dismisses a notification with neither a popup nor a center entry, so dropped notifications (transient while muted, Popup only plus Mute) still made a sound. Play it only for notifications that are kept, and not when a mute rule applies, like Do Not Disturb.
Member
|
/claude review |
Contributor
Claude reviewNo issues found. |
bbedward
pushed a commit
that referenced
this pull request
Oct 7, 2026
…#3670) * fix(notifications): edit rules from the menu instead of deleting them A notification rule can set an action and Bypass DND together, but Unmute and Block in Do Not Disturb spliced the whole rule, dropping the other setting. They now reset only their own field, and a rule is removed once it no longer does anything (action and urgency default, no bypass). Mute and Allow in Do Not Disturb set their field on the app's existing rule instead of appending one that first-match policy would shadow. The menu now only reads and edits enabled, exact rules on the app name or desktop entry. It used to match any rule whose pattern equaled the app name, including summary, body, contains and regex rules, and could delete disabled ones. Also adds a Copy item to the notification menu on popups and center cards, copying the summary and body as plain text. * fix(notifications): let mute apply alongside other rule actions Rule actions are first-match, so a mute rule behind an app's existing rule (e.g. No history) never applied while the menu showed Unmute. Mute is now evaluated like Bypass DND: any matching enabled mute rule disables the popup, and the other actions stay first-match, so No history and Mute both apply. * fix(notifications): skip the sound for dropped and muted notifications The notification sound played before the check that dismisses a notification with neither a popup nor a center entry, so dropped notifications (transient while muted, Popup only plus Mute) still made a sound. Play it only for notifications that are kept, and not when a mute rule applies, like Do Not Disturb. stable-1.6: ported the rule edits and the sound/mute policy only, the Copy menu item depends on NotificationActions which stable does not have (cherry picked from commit 51f115f)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR stops the notification menu from deleting whole rules, and adds a Copy item to it.
A notification rule can set an action and Bypass DND together. Unmute and Block in Do Not Disturb removed the whole rule, so turning one off also dropped the other. The menu also had no way to copy a notification's text.
No new strings: "Copy" and "Copied to clipboard" already exist.
Important notes:
An app with a Popup only rule that gets muted shows neither a popup nor a center entry, so the notification is dropped. Is this acceptable or should it get pushed into center anyways, requiring an intentional disabling?
An earlier matching rule no longer shields an app from a later mute rule (for example exact Firefox with action Default, then contains "fire" with Mute). Nothing in Settings describes rule order, but it's a change for hand-written rules.
A mute rule now also silences the app's critical notifications and its explicit
sound-namerequests. Do Not Disturb can let critical notifications through; mute has no such exception.The menu only recognizes the exact rules it creates, so a hand-written contains, regex or summary mute rule that matches the app still leaves the menu offering Mute.
openContextMenuin the center card drops its unusedx, yparameters and takes the clicked notification instead. Its two callers are in the same file.Validation
quickshell/tests/notification-menu-rules.test.mjsruns the realSettingsDatahelpers: unmute keeps a bypass, blocking keeps an action, a rule goes once nothing is left, disabled rules are never touched, mute and bypass share one rule, mute applies alongside an earlier rule's action, and summary, contains, regex and desktop-entry rules are matched correctly. Every case fails againstupstream/mastermake lint-qml,python3 quickshell/tests/run-qml.py logic qt lock,node --test quickshell/tests/*.test.mjs,prek runon the changed files. Skipped theqml-testshook, which launches niri and can't run on this Hyprland machineType of change
Related issues
Screenshots / video
Checklist
I18n.tr()with translator context, reusing existing terms where possiblemake fmt, added/updated tests,make testpasses, andgo mod tidyis cleanmake lint-qmlwith no new warnings