feat(desktop): improve ringtone settings with duration display and bug fixes

Merged
AV
1y ago
+804-25

Summary

  • Add duration display to ringtone cards showing how long each sound is
  • Make the Silent option more visually distinct with dashed border and bell-slash icon
  • Fix electron-store JSON parsing so ringtone preferences are correctly read
  • Fix nested button accessibility issue (invalid HTML)
  • Consolidate ringtone metadata to shared location to prevent drift
  • Add fallback to default ringtone for stale/unknown IDs
  • Fix timer cleanup on unmount to prevent state updates after navigation
  • Stop ringtone preview when navigating away from settings

Test plan

  • Verify duration badges appear on ringtone cards
  • Verify Silent option has dashed border and bell-slash icon
  • Verify selecting Silent actually silences notifications
  • Verify stop button works for all ringtones including longer ones like EDM Drop
  • Verify navigating away from settings stops any playing preview
  • Verify selecting an invalid/removed ringtone ID falls back to default sound

Summary by CodeRabbit

  • New Features
    • Added a Ringtones settings section enabling users to preview, select, and manage notification sounds from a catalog of ringtones.
    • Configured notification sounds to use the user's selected ringtone preference with automatic playback control.
    • Extended settings to persist ringtone selection across sessions.

✏️ Tip: You can customize this high-level summary in your review settings.