feat(notification): toggle visible notifications on DND - #3701
Conversation
|
Thanks for the PR. I like the idea, this has already happened to me too.
The PR calls dndToggled() only from application_ipc.cpp. The control-center button and internal shortcut call
A notification already in m_pendingAdds can be flushed after the toggle because enabling DND does not clear it and flushPendingAdds() does not re-check the DND state. Clear pending additions when enabling DND or guard the flush. More importantly, we do not want to introduce any replay of hidden toasts when DND is disabled. Notifications are already retained in notification history, which is the appropriate place to read notifications missed while DND was active. The intended behavior is:
|
Summary
Hide visible notifications the moment DND is enabled and show them again when DND is disabled.
Motivation
Imagine you're showing someone something on your computer irl, and you get a text from someone that you quickly recognize that you would prefer to not be seen by the person next to you.
You quickly hit your toggle DND keybind as you clearly forgot to do it beforehand.
After you're done showing whatever it was, you toggle DND and get to read that text in peace.
Type of Change
Testing
Manually tested with
notify-send.just testalso passes.Manual Coverage
Checklist
CONTRIBUTING.md.just formatwith clang-format v22+ installed, or this PR has no code changes.assets/translations/en.json, or this PR adds no new user-facing strings.