-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description:
Currently, a desktop notification is always shown when a new task is successfully added via the quick-add dialog. This provides useful feedback, but some users may find it intrusive. This issue proposes adding a configuration option to allow users to enable or disable these notifications.
Proposed Changes
-
Add a Setting for Notifications:
- Introduce a new persistent setting,
showNotifications, to store the user's preference. - The setting should default to
true(enabled).
- Introduce a new persistent setting,
-
Add a UI Toggle in the Tray Menu:
- Add a new checkable menu item, "Show notifications", to the system tray menu.
- The checked state of this item should reflect the current value of the
showNotificationssetting. - Toggling the menu item should update the setting and persist the change.
-
Conditionally Send Notifications:
- The frontend logic in the
QuickAddDialogshould check theshowNotificationssetting before attempting to send a notification. - Notifications for both successful and failed task additions should respect this setting.
- The frontend logic in the
Implementation Plan
Backend (src-tauri)
-
src-tauri/src/desktop/tray.rs:- Add a new
ToggleNotificationsvariant to theMenuIdenum. - In
get_tray_menu, add aCheckMenuItemfor "Show notifications". Its initial state should be loaded from the new setting. - In
handle_menu_event, add a case forToggleNotificationsthat updates the setting and the menu item's checked state.
- Add a new
-
src-tauri/src/ipc/commands.rs:- Expose a new command
get_show_notifications() -> boolthat retrieves the current setting value. - Expose a new command
set_show_notifications(enabled: bool)that updates the setting.
- Expose a new command
-
src-tauri/src/shared/storage/general.rs:- Utilize the existing
setandfindfunctions in this module to manage theshowNotificationssetting. - A new
StorageKeyvariant,ShowNotifications, will need to be added tosrc-tauri/src/shared/storage/key.rs.
- Utilize the existing
Frontend (src/app)
src/app/quick-add/quick-add-dialog.ts:- On initialization, fetch the
showNotificationssetting using the newget_show_notificationscommand. - In the
onSubmitmethod, check the value of this setting before callingthis.notification.send().
- On initialization, fetch the
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request