Skip to content

fix(desktop): keep UI sounds out of media controls - #4916

Open
nathan-thillairajah wants to merge 2 commits into
block:mainfrom
nathan-thillairajah:pinky/fix-notification-media-session
Open

fix(desktop): keep UI sounds out of media controls#4916
nathan-thillairajah wants to merge 2 commits into
block:mainfrom
nathan-thillairajah:pinky/fix-notification-media-session

Conversation

@nathan-thillairajah

@nathan-thillairajah nathan-thillairajah commented Aug 5, 2026

Copy link
Copy Markdown

Summary

Move all short Buzz-owned UI sounds involved in the reported macOS behavior off resumable HTML media:

  • Play notification cues with one-shot Web Audio sources instead of cached HTMLAudioElements.
  • Remove the poof/plop effect's startup HTMLAudioElement preload and fallback; retain the effect through decoded Web Audio buffers.

This prevents macOS from listing Buzz as localhost in Now Playing and routing the hardware play/pause key to either the last notification or the globally preloaded poof sound. The Settings sound preview remains stoppable.

Root cause

The initial notification-only fix was incomplete. Manual testing exposed a second, different sound registered as localhost: PoofBurstProvider constructed and preloaded /pow/plop.m4a on app mount. Because that HTML media element persisted globally, macOS could retain it as a resumable media session even without a notification.

Manual test (macOS)

Tested a branch-built Buzz Dev (fix-notification-media-session) against the production relay:

  1. Launch the app and leave it open with Control Center → Now Playing visible.
  2. Preview a sound in Settings → Notifications, let it finish, and press the hardware play/pause key.
  3. Exercise the app normally so the poof provider is mounted.

Observed after the expanded fix: no localhost Now Playing item appeared, and no Buzz-owned sound was replayed by the media key.

Validation

At commit 65833a283623194cfe534dd1b30e1136e8cca9a1:

  • desktop tests: 4,293 passed
  • desktop typecheck
  • desktop Biome/file-size checks (existing unrelated warnings only)
  • desktop production build
  • pre-push desktop tests/checks
  • pre-push desktop Tauri checks and full Rust tests
  • pre-push mobile tests

Regression coverage asserts that mounting and triggering PoofBurstProvider never constructs HTML media while Web Audio playback still starts.

Play short notification cues through one-shot Web Audio sources so WebKit does not register resumable HTML media with macOS. Preserve sound previews with a small stoppable playback handle and cover caching, lifecycle, and retry behavior.

Co-authored-by: npub1pgykmagdkjjhrrrdacs803q4gv2ulsz2n276kxmytmcy38aehqkql5tysj <0a096df50db4a5718c6dee2077c4154315cfc04a9abdab1b645ef0489fb9b82c@buzz.block.builderlab.xyz>
Signed-off-by: npub1pgykmagdkjjhrrrdacs803q4gv2ulsz2n276kxmytmcy38aehqkql5tysj <0a096df50db4a5718c6dee2077c4154315cfc04a9abdab1b645ef0489fb9b82c@buzz.block.builderlab.xyz>
@nathan-thillairajah

Copy link
Copy Markdown
Author

Shelving for now: the original macOS Now Playing/media-key behavior is no longer reproducible in the installed app, so we cannot establish a baseline or complete the real-WKWebView validation for this change.

Remove the HTML audio preload and fallback from the poof effect so macOS cannot retain it as resumable localhost media. Keep playback on decoded Web Audio buffers and cover mount and playback with a regression test.

Co-authored-by: Pinky <0a096df50db4a5718c6dee2077c4154315cfc04a9abdab1b645ef0489fb9b82c@buzz.block.builderlab.xyz>
Signed-off-by: Pinky <0a096df50db4a5718c6dee2077c4154315cfc04a9abdab1b645ef0489fb9b82c@buzz.block.builderlab.xyz>
@nathan-thillairajah nathan-thillairajah changed the title fix(desktop): keep notification sounds out of media controls fix(desktop): keep UI sounds out of media controls Aug 5, 2026
@nathan-thillairajah
nathan-thillairajah marked this pull request as ready for review August 5, 2026 20:19
@nathan-thillairajah
nathan-thillairajah requested a review from a team as a code owner August 5, 2026 20:19
@nathan-thillairajah

Copy link
Copy Markdown
Author

Reopened after the baseline reproduced. Manual testing then revealed a second app-owned HTML media source in PoofBurstProvider; commit 65833a28 removes that preload/fallback and adds regression coverage. The rebuilt macOS app no longer produced the localhost Now Playing entry during the retest.

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.

1 participant