feat: toggle global DND when receiving a notification during scheduled DND#2094
Draft
nathanaelhoun wants to merge 2 commits intoferdium:developfrom
Draft
feat: toggle global DND when receiving a notification during scheduled DND#2094nathanaelhoun wants to merge 2 commits intoferdium:developfrom
nathanaelhoun wants to merge 2 commits intoferdium:developfrom
Conversation
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.
Pre-flight Checklist
Please ensure you've completed all of the following.
Description of Change
Scheduled DND now mute all notifications and sounds from all services, instead of "just" disabling the notification sent to the OS.
I also removed the periodic check of _systemDND on OSes where it's doesn't work ; it is only implemented on Mac at the moment.
Motivation and Context
I really like the Schedule DND feature, but as currently, it doesn't remove the sound of notifications of services like Mattermost or WhatsApp.
With this change, schedule DND works as I expected : it toggles the global switch during the scheduled times, instead of silently (because it's not shown in the UI) hiding the OS notification.
Other implementation
I would have preferred to activate and deactivate the global switch at the scheduled times, instead of checking it for each notification, but I didn't have the time to figure out how to schedule code in Electron.
This other implementation would allow users to manually deactivate DND in a scheduled period, or manually activate it while not in a scheduled period.
As this is a real problem, I will let this PR as draft until I figure out how to implement this correctly.
Screenshots
Checklist
pnpm prepare-code)pnpm testpassesRelease Notes
Scheduled DND now toggles the global "Disable notifications & audio" switch, which allows to mute all notifications sounds