Skip to content

fix(notifications): edit rules from the menu instead of deleting them - #3670

Merged
bbedward merged 3 commits into
duxlabs-dev:masterfrom
Conava:notification-menu
Oct 3, 2026
Merged

bbedward merged 3 commits into
duxlabs-dev:masterfrom
Conava:notification-menu

Conversation

@Conava

@Conava Conava commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • Unmute resets the rule's action to Default and Block in Do Not Disturb turns Bypass DND off. A rule is removed only when it no longer does anything (action and urgency Default, no bypass)
  • Mute and Allow in Do Not Disturb set their part on the app's existing rule instead of appending a second one
  • Mute is evaluated like Bypass DND: any matching enabled mute rule disables the popup, while the other actions stay first-match. Before, a mute rule behind another matching rule (for example an exact No history rule) never applied, while the menu showed Unmute. Now No history and Mute both apply
  • The menu reads and edits only enabled, exact rules on the app name or desktop entry. Before, it matched any rule whose pattern equaled the app name (including summary, body, contains and regex rules) and could delete a disabled one
  • The notification sound plays only for notifications that are kept, and not when a mute rule applies, like Do Not Disturb. Before, a notification dropped for having neither a popup nor a center entry still played it
  • New Copy item on popups and notification center cards copies the summary and body as plain text. A collapsed group copies its newest notification

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-name requests. 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.

  • openContextMenu in the center card drops its unused x, y parameters and takes the clicked notification instead. Its two callers are in the same file.

Validation

  • Tested by hand: Copy from a popup and from collapsed and expanded center cards, and Mute, Unmute, Allow and Block in Do Not Disturb on a rule that also bypasses DND
  • New quickshell/tests/notification-menu-rules.test.mjs runs the real SettingsData helpers: 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 against upstream/master
  • make lint-qml, python3 quickshell/tests/run-qml.py logic qt lock, node --test quickshell/tests/*.test.mjs, prek run on the changed files. Skipped the qml-tests hook, which launches niri and can't run on this Hyprland machine

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Refactor / internal cleanup
  • Documentation
  • Other

Related issues

Screenshots / video

Checklist

  • My code follows the conventions in CONTRIBUTING.md
  • I have tested my changes locally
  • New user-facing strings are wrapped in I18n.tr() with translator context, reusing existing terms where possible
  • Go changes: ran make fmt, added/updated tests, make test passes, and go mod tidy is clean
  • QML changes: ran make lint-qml with no new warnings
  • I have opened a corresponding pull request in dlx-docs to document any new behaviors: https://github.com/AvengeMedia/DankLinux-Docs

Conava added 3 commits October 3, 2026 10:51
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.
@bbedward

bbedward commented Oct 3, 2026

Copy link
Copy Markdown
Member

/claude review

@claude

claude Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Claude review

No issues found.
Checked: rule edit/remove logic in SettingsData (_appRuleIndex exact/field matching, _updateAppRule cleanup, mute/DND bypass merge), mute evaluation and sound/dismiss reordering in NotificationService, the Copy action (wrapper summary/body, Proc.dmsBin clipboard call, existing I18n terms) and the openContextMenu caller changes in the center card. Model: claude-opus-5-5.

@bbedward
bbedward merged commit 51f115f into duxlabs-dev:master Oct 3, 2026
2 checks passed
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants