feat(desktop): add audio muting to browser pane
AN
4m ago+389+389+012345678901234567890123456789-6-6-0123456789
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
setAudioMutedandisAudioMutedmethods onBrowserManagerand wires them through thebrowsertRPC 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
- 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).
- Ran
- Typecheck & Lint:
- Ran
bun run typecheck(42/42 tasks passed with 0 errors). - Ran
biome checkon all modified files (clean, no warnings or formatting issues).
- Ran
- 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 + Rwhile muted to verify mute persistence.
Checklist
- PR title follows conventional commits (
type(scope): subject) -
bun run lintandbun run typecheckpass (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
setAudioMutedandisAudioMutedonBrowserManagerand through thebrowsertRPC router; the guestwebContentsis updated and state re-applied on re-registration. - Adds the menu items to
BrowserOverflowMenu.tsxand 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/i18nmocks toscripts/test-preload.tsso 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.