feat(settings): add random notification sound options#3094
Conversation
Add "Random (all)" and "Random (custom)" to the completion sound dropdown. Random-all picks a fresh sound per notification from the built-ins plus any installed custom sounds; random-custom draws from custom sounds only and is offered once at least one is installed. Removing the last custom sound while random-custom is active falls back to silence, matching the existing deleted-sound behaviour. Generated-By: PostHog Code Task-Id: 2e7e511c-6b31-4480-8ac1-37863ddd7c3b
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
|
Reviews (1): Last reviewed commit: "feat(settings): add random notification ..." | Re-trigger Greptile |
pauldambra
left a comment
There was a problem hiding this comment.
QA Swarm review complete. See inline comments.
|
Note 🤖 Automated comment by QA Swarm — not written by a human Multi-perspective review: qa-team (specialists + generalists), paul-reviewer, xp-reviewer, security-audit Verdict: ✅ APPROVESmall, well-tested feature with zero critical/high/medium findings across all four review perspectives. Everything flagged is a low-severity polish item or nit; nothing blocks merge. Key findings🟢 Low
⚪ Nits
Convergence
Reviewer summaries
Automated by QA Swarm — not a human review |
Adds a guard in the persist merge function so that if completionSound is "random-custom" but customSounds is empty, it falls back to "none". Prevents the Select trigger rendering a ghost value after a partial rehydrate or app-version transition that leaves the library empty. Generated-By: PostHog Code Task-Id: 2e7e511c-6b31-4480-8ac1-37863ddd7c3b
Generated-By: PostHog Code Task-Id: 2e7e511c-6b31-4480-8ac1-37863ddd7c3b
|
Note 🤖 Automated comment by QA Swarm — not written by a human Follow-up review of commits 81b8e58 + fca242c (merge() normalization fix, comment removal) Verdict: ✅ APPROVEThe delta is a correct, well-targeted fix for the prior convergent finding — it handles missing-key, null, and empty-array shapes, correctly leaves Key findings🟢 Low
Reviewer summaries
Automated by QA Swarm — not a human review |
…ormalization Pins the merge() guard that downgrades completionSound from random-custom to none when the custom-sounds library is empty or absent on rehydrate. Generated-By: PostHog Code Task-Id: 2e7e511c-6b31-4480-8ac1-37863ddd7c3b
Generated-By: PostHog Code Task-Id: 2e7e511c-6b31-4480-8ac1-37863ddd7c3b
Ports the desktop "Random" completion-sound option (#3094) to the mobile app. Mobile has no custom sounds, so only the `random-all` equivalent is ported: a new "Random" mode that picks a fresh built-in sound each time a task completes. - Add "random" to the CompletionSound union and a "Random" entry to the sound picker. - Resolve a random built-in asset per play via a shared pickRandom helper. - Promote pickRandom to src/lib and reuse it in getRandomThinkingActivity. Generated-By: PostHog Code Task-Id: 2e74262a-f351-45b8-b98e-3cb0dd11df76
Summary
Adds two options to the notification "Sound effect" dropdown in Settings > Notifications:
Details
CompletionSoundvaluesrandom-all/random-customlive alongside thecustom:<id>sentinel rather than inBuiltInCompletionSound, which keys theSOUND_URLSasset recordresolveSoundUrl, which is called per notification (and per press of the "Test sound" button), so each firing draws a fresh random pick with no extra plumbingrandom-customwith an empty pool resolves tonulland plays nothing, matching the existing deleted-custom-sound behaviour; removing the last custom sound whilerandom-customis active falls back to "None", extending the existing fallback inremoveCustomSoundTesting
sounds.test.ts: pool membership for both modes,nullforrandom-customwith nothing installed, and aMath.randomspy at both extremes proving custom sounds are reachable in therandom-allpoolremoveCustomSoundtest insettingsStore.test.tswith therandom-customfallback, plus a case verifying it stays active while other custom sounds remainCreated with PostHog Code