feat(desktop): add audio muting to browser pane

AN
4m ago
+389-6

What & why

Adds the ability to mute and unmute audio in the desktop application's browser pane via its overflow menu.

Previously, web pages playing media inside a browser pane had no direct audio toggle within the app UI. This change:

  • Exposes setAudioMuted and isAudioMuted methods on BrowserManager and wires them through the browser tRPC router.
  • Adds dynamic Mute tab / Unmute tab actions with speaker icons to BrowserOverflowMenu.tsx.
  • Ensures mute state persists across browser pane reloads and re-registrations on the guest webContents.

How I tested it

  1. Unit Tests:
    • Ran bun test apps/desktop/src/main/lib/browser/browser-manager.test.ts (33/33 tests passed, including the new audio muting persistence tests).
  2. Typecheck & Lint:
    • Ran bun run typecheck (42/42 tasks passed with 0 errors).
    • Ran biome check on all modified files (clean, no warnings or formatting issues).
  3. Manual & Interactive Verification:
    • Opened a browser pane in a local workspace and navigated to YouTube with an active audio stream.
    • Clicked the ... overflow menu and verified the item shows Mute tab.
    • Selected Mute tab and confirmed the guest webContents audio silenced immediately.
    • Re-opened the ... menu, confirmed the label updated to Unmute tab, clicked it, and verified audio playback resumed.
    • Reloaded the pane with Ctrl + R while muted to verify mute persistence.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too)
  • "Allow edits from maintainers" is checked on fork PRs
  • I have signed the CLA (the bot asks on your first PR)

Summary by cubic

Adds audio muting to the desktop app's browser pane so users can mute or unmute a tab from the overflow menu.

Previously, media playing in a browser pane had no audio toggle in the app UI. Now the pane's ... menu shows Mute / Unmute, and mute state persists across reloads and is preserved when popups open.

  • Exposes setAudioMuted and isAudioMuted on BrowserManager and through the browser tRPC router; the guest webContents is updated and state re-applied on re-registration.
  • Adds the menu items to BrowserOverflowMenu.tsx and initializes their state from the router.
  • Newly opened popups inherit the parent pane's mute state, and existing popups update dynamically; popup webContents are tracked and cleaned up on window close.
  • Adds Electron, @lingui, and @superset/i18n mocks to scripts/test-preload.ts so headless Bun tests can import those modules.

Summary by CodeRabbit

  • New Features
    • Mute or unmute audio for a browser pane from its overflow menu while a page is open. The menu shows the current audio state and reflects successful changes.
    • Panes start unmuted by default. A pane’s mute setting is retained when it reloads, applies to its open popups, and is inherited by newly opened popups.