Skip to content

feat: toggle global DND when receiving a notification during scheduled DND#2094

Draft
nathanaelhoun wants to merge 2 commits intoferdium:developfrom
nathanaelhoun:feat-dnd-schedule-should-toggle-global-dnd
Draft

feat: toggle global DND when receiving a notification during scheduled DND#2094
nathanaelhoun wants to merge 2 commits intoferdium:developfrom
nathanaelhoun:feat-dnd-schedule-should-toggle-global-dnd

Conversation

@nathanaelhoun
Copy link
Contributor

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

  • My pull request is properly named
  • The changes respect the code style of the project (pnpm prepare-code)
  • pnpm test passes
  • I tested/previewed my changes locally

Release Notes

Scheduled DND now toggles the global "Disable notifications & audio" switch, which allows to mute all notifications sounds

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.

1 participant