feat(desktop): port v0.11.4-v0.15.2 from Tauri to Electron + Discord-parity audio (v0.16.0)

Chronological port of every Tauri release commit (v0.11.4 -> v0.15.2)
into the Electron rebuild, plus Discord-style audio handling that goes
beyond the Tauri original.

Highlights:
  - All 17 Tauri release commits ported (audio fixes, custom notification
    sound, Discord-style chat UX, profile banner, changelog page,
    Discord-parity call UX, screen-share echo + re-watch UX, audio-loop
    fix).
  - Native napi-rs audio-loopback addon with WASAPI process-loopback:
      * EXCLUDE_TARGET_PROCESS_TREE for full-screen shares -> peers
        never hear themselves echoed back through the capture.
      * INCLUDE_TARGET_PROCESS_TREE for window shares -> only the
        picked window's audio is captured, not the whole OS mixer
        (Discord parity).
      * HWND -> PID resolution via Win32 GetWindowThreadProcessId.
  - Discord-style screen-source picker (thumbnail grid, screens vs
    apps tabs, live-refreshing thumbnails).
  - Hash routing fix for packaged builds (file:// can't resolve
    BrowserRouter paths).
  - Tauri sources removed (apps/desktop/src-tauri).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
byGalax
2026-05-06 23:35:01 +02:00
parent 72d02e385f
commit 825160ee46
504 changed files with 14217 additions and 14366 deletions
@@ -29,6 +29,16 @@ export interface ScreenShareSettings {
// Linux setups). If the browser ignores the `audio: true` request we
// silently fall through to a video-only share.
includeSystemAudio: boolean;
// While system audio is being shared, mute the local playback of remote
// call audio to prevent peers from hearing themselves echoed back via the
// loopback capture. Defaults to true — Chromium's loopback grant in
// Electron *should* exclude the app's own render output, but the
// process-tree exclusion isn't always watertight (WebView2/Chromium audio
// sessions can render in process owners outside the tree). The user can
// opt out (e.g. when they route call audio to a separate output device
// with setSinkId, in which case the default-render-endpoint capture
// never sees it).
duckRemoteAudioWhileSharing: boolean;
}
const DEFAULTS: ScreenShareSettings = {
@@ -36,6 +46,11 @@ const DEFAULTS: ScreenShareSettings = {
displaySurface: null,
framerateOverride: null,
includeSystemAudio: false,
// Default off — we use Electron's `loopback` (not `loopbackWithMute`)
// so the user keeps local audio while sharing. Auto-ducking remote
// mic audio for echo prevention also kills the user's ability to
// hear peers, which most users don't want. Opt-in only.
duckRemoteAudioWhileSharing: false,
};
export interface PresetParams {
@@ -131,6 +146,10 @@ function read(): ScreenShareSettings {
typeof parsed.includeSystemAudio === 'boolean'
? parsed.includeSystemAudio
: DEFAULTS.includeSystemAudio,
duckRemoteAudioWhileSharing:
typeof parsed.duckRemoteAudioWhileSharing === 'boolean'
? parsed.duckRemoteAudioWhileSharing
: DEFAULTS.duckRemoteAudioWhileSharing,
};
return cached;
} catch {