Notification sound toggle and do-not-disturb schedule
Facebook Messenger on your desktop, without the Facebook clutter
Brought to you by:
kristoffer-r
Originally created by: kristofferR
Two new notification settings (Ref [#54], part of epic [#59]):
UNNotificationSound on macOS, the XDG SuppressSound hint on Linux. On Windows, notify-rust maps an unset sound_name to a silent toast, so the toggle now names the system Default sound when on (Windows toasts were unintentionally always silent before).dnd_start / dnd_end, "HH:MM", empty = off) — while the current local time falls inside the half-open [start, end) window, notification delivery is suppressed entirely. Overnight ranges (e.g. 22:00–07:00) wrap past midnight. Unread badge / tray counts still update — they ride the separate carrier:unread event.carrier:notify path (show_message_notification), so they apply uniformly on all three platforms; the sound flag is threaded into deliver_notification_macos / show_native_notification.dnd_active(start, end, now_minutes) over minutes-since-midnight, with a strict parse_hhmm (malformed input → schedule off). chrono (already in the dependency tree transitively) supplies local wall-clock time.<input type="time"> rows via a new time-field renderer that follows the existing select-row pattern (label + hint inside the <label class="row">, persist on change).cargo fmt && cargo clippy --all-targets -- -D warnings && cargo test --lib — clean, 48 tests pass, including 4 new ones covering disabled/empty bounds, normal ranges, overnight wrap, boundary minutes (start inclusive, end exclusive), and malformed input.node --check inject/messenger.js and a parse check of the settings.html inline script pass.Sibling feature PRs from epic [#59] touch the same Settings struct / FIELDS arrays, so trivial merge conflicts with them are expected.
Ref [#54]
https://claude.ai/code/session_01Pqw8xaJrGLhgSo2YR68ov5
Originally posted by: kristofferR
@coderabbitai review
Originally posted by: coderabbitai[bot]
✅ Action performed
Review finished. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.Originally posted by: coderabbitai[bot]
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
**Configuration used**: Path: .coderabbit.yaml **Review profile**: ASSERTIVE **Plan**: Pro **Run ID**: `0329bb37-513f-4fe6-a3d0-32acf76bc3d7`📥 Commits
Reviewing files that changed from the base of the PR and between [638616] and 41070dfb4b84c85e994471fb5727d5cef92e3f75.⛔ Files ignored due to path filters (1)
* `src-tauri/Cargo.lock` is excluded by `!**/*.lock`📒 Files selected for processing (4)
* `README.md` * `dist/settings.html` * `src-tauri/Cargo.toml` * `src-tauri/src/lib.rs`📝 Walkthrough
## Walkthrough This PR adds a notification sound toggle and a daily do-not-disturb schedule with overnight range support. It extends the Settings model and defaults, adds chrono-based local time parsing and evaluation, updates native notification delivery, and adds matching settings UI and README text. ### Changes **Notification sound and DND feature** |Layer / File(s)|Summary| |---|---| |**Settings model and dependency**`src-tauri/src/lib.rs`, `src-tauri/Cargo.toml`|Adds `notification_sound`, `dnd_start`, and `dnd_end` to `Settings`, sets their defaults, and adds `chrono` for local wall-clock time.| |**DND parsing and evaluation**
`src-tauri/src/lib.rs`|Adds strict `HH:MM` parsing, DND window evaluation, local time calculation, and unit tests for malformed, boundary, and overnight cases.| |**Notification delivery and sound handling**
`src-tauri/src/lib.rs`|Checks DND before notifying and passes the sound flag through macOS and non-macOS native notification paths.| |**Settings UI for notification sound and DND**
`dist/settings.html`|Adds field metadata, tab entries, time input rendering, custom row mapping, and sizing for the new settings controls.| |**README feature description update**
`README.md`|Updates the feature bullet to mention silent delivery and scheduled suppression.| **Estimated code review effort:** 3 (Moderate) | ~25 minutes ### Sequence Diagram(s) :::mermaid sequenceDiagram participant App participant show_message_notification participant dnd_active participant deliver_notification_macos participant show_native_notification App->>show_message_notification: new message show_message_notification->>dnd_active: check dnd_start/dnd_end dnd_active-->>show_message_notification: active or inactive alt DND active show_message_notification-->>App: suppress native notification else DND inactive show_message_notification->>deliver_notification_macos: sound flag on macOS show_message_notification->>show_native_notification: sound flag on non-macOS end **Possibly related issues** - [kristofferR/Carrier#54](https://github.com/kristofferR/Carrier/issues/54): Matches the same notification sound toggle and do-not-disturb scheduling behavior through native notification delivery. **Possibly related PRs** - [[kristofferR/Carrier#13](https://github.com/kristofferR/Carrier/issues/13)](https://github.com/kristofferR/Carrier/pull/13): Both modify the native notification delivery flow in `src-tauri/src/lib.rs`. - [[kristofferR/Carrier#21](https://github.com/kristofferR/Carrier/issues/21)](https://github.com/kristofferR/Carrier/pull/21): Both update the notification settings model and message notification pipeline in `src-tauri/src/lib.rs`. - [[kristofferR/Carrier#34](https://github.com/kristofferR/Carrier/issues/34)](https://github.com/kristofferR/Carrier/pull/34): Both touch the macOS notification delivery path in `src-tauri/src/lib.rs`.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation | | :------------------------: | :------- | :------------------------------------------------------------------------------------------------------------- | | Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. | | Title check | ✅ Passed | The title clearly summarizes the main change: adding notification sound control and a do-not-disturb schedule. | | Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. | | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |✨ Finishing Touches
📝 Generate docstrings
- [ ] Create stacked PR - [ ] Commit on current branch🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests - [ ] Commit unit tests in branch `feature/notification-sound-dnd`Comment
@coderabbitai helpto get the list of available commands.Originally posted by: kristofferR
@coderabbitai review
Originally posted by: coderabbitai[bot]
✅ Action performed
Review finished. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.Originally posted by: kristofferR
@coderabbitai review
Originally posted by: coderabbitai[bot]
✅ Action performed
Review finished. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.Ticket changed by: kristofferR