Skip to content

Add notification sound volume and custom sounds - #2830

Open
ChocoTonic wants to merge 3 commits into
Foundry376:masterfrom
ChocoTonic:feature/notification-sound-customization
Open

ChocoTonic wants to merge 3 commits into
Foundry376:masterfrom
ChocoTonic:feature/notification-sound-customization

Conversation

@ChocoTonic

@ChocoTonic ChocoTonic commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Add notification sound volume and custom sounds

Summary

  • Add a 0–100 new-mail notification volume slider in General > Notifications.
  • Add a native custom-sound picker for MP3, OGG, WAV, M4A, AAC, and FLAC files,
    with Play Test Sound and reset-to-default actions.
  • Keep both settings scoped to new-mail notifications so sent-message and other UI
    sounds retain their existing behavior.
  • Resolve custom files at playback time and fall back to the bundled sound when a
    selection is missing, unsupported, or cannot be played.
  • Permit local files only as media resources, without expanding the script policy,
    and reject relative paths, non-regular files, empty files, and files over 25 MiB.
  • Extend SoundRegistry with reusable per-play volume and source options, keeping
    the preference UI, sound selection, and audio playback concerns separate.
  • Add regression coverage for the silent Windows toast behavior established by
    Silence audio in native Windows notifications #2619, which ensures native toast audio does not bypass Mailspring's playback
    settings.

The work is organized as two focused commits in this PR: the first introduces the
volume control and reusable playback option, and the second adds custom sound
selection on top of that foundation.

Testing

  • Added registry coverage for muted, intermediate, full, invalid, and out-of-range
    volume values, custom sources, and decode-error fallback.
  • Added resolver coverage for supported extensions, file URLs, missing files, and
    unsupported selections.
  • Added preference UI coverage for slider persistence and choose, reset, and test
    actions.
  • Added new-mail integration coverage showing that configured sound options apply
    only to notification playback.
  • Added regression coverage for silent individual and summary Windows toast XML.
  • npm run lint:check
  • Targeted Electron specs: 31 passing
  • Real external-file playback in Electron: MP3, OGG, WAV, M4A, AAC, and FLAC all
    passed through the production resolver and Content Security Policy.
  • npm run build (produced the macOS arm64 app and ZIP)

npm run typecheck reaches the full project and reports three existing errors
outside this change: the marginType option in print-window.ts and two inert
attribute errors in sheet-container.tsx. It reports no errors in files changed by
this PR.

Feature requests and related material

Per-filter notification sounds remain out of scope for this change.

@ChocoTonic
ChocoTonic marked this pull request as draft August 30, 2026 23:07
@ChocoTonic

Copy link
Copy Markdown
Contributor Author

Implemented the notification sound settings follow-up and tested it in a packaged Windows build.

  • Grouped notification sound selection, reset, volume, and preview controls.
  • Kept Choose Sound… and Use Default Sound together as setting-changing actions.
  • Moved Play Sound to a separate row because it previews the current selection.
  • Made Choose Sound… the emphasized action.
  • Displayed the current filename as the setting value; the reset state displays Default notification sound without exposing the bundled filename.
  • Made Play Sound and actual new-mail notifications use the selected custom sound, falling back to the bundled default only when needed.
  • Allowed selected local audio files through the app's media CSP.
  • Opened the file picker at the selected sound or the bundled default sound location using a relative runtime path.

Updated notification sound settings

Related community request: https://community.getmailspring.com/t/add-a-receive-sound-that-is-selectable-for-incoming-email/14455

@ChocoTonic
ChocoTonic marked this pull request as ready for review August 31, 2026 05:34
bengotow pushed a commit that referenced this pull request Sep 4, 2026
Bug-fix pass against v1.24.0 (released 9/1) plus six new forum
threads since 08-28: dark-theme image/text inversion (traced to the
blanket invert() filter in email-frame.less, two contributor PRs
open), notification volume/custom-sound requests (PR #2830 open),
and a sync-accounts-across-devices feature request. Updated the two
carried-forward items whose fix (PR #2821, scrollbar glitch) has
now actually shipped rather than just being merged.

Also flags a new calendar-roadmap thread where two contributors are
asking directly for maintainer direction, and reiterates that this
pipeline has produced fourteen weeks of researched drafts with none
ever reviewed or posted (discourse-posted-ids.json unchanged since
May).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAwTY7mBdTEsnUkmzgHDqE
@CEOYap

CEOYap commented Sep 10, 2026

Copy link
Copy Markdown

Looking forward to this!

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.

2 participants