From a71c17965fc34d522dcb14a227bbae75ad65fe4f Mon Sep 17 00:00:00 2001 From: iamdoubz <> Date: Wed, 15 Jul 2026 13:57:36 -0500 Subject: [PATCH] feat(recording): toggle_microphone_mute command + recording://mic event --- src-tauri/src/commands.rs | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index db949c7..ec4b55f 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -88,6 +88,7 @@ pub(crate) fn default_settings() -> Settings { mcp_expose: "none".into(), mcp_expose_recordings: false, auto_start: false, + close_to_tray: true, } } @@ -1048,6 +1049,43 @@ pub async fn resume_recording( Ok(()) } +/// Toggle the microphone mute state for the active recording (FR-CAP-7): the +/// mic channel goes silent (recording + live transcript + meter) while loopback +/// keeps capturing. Bound to the "M" key in the UI. Returns the new muted state. +/// Errors if this meeting was started with the mic off (nothing to mute). +#[tauri::command] +pub async fn toggle_microphone_mute( + app: AppHandle, + state: State<'_, AppState>, + meeting_id: MeetingId, +) -> WaResult { + let guard = state.session.lock().await; + let session = guard + .as_ref() + .filter(|s| s.meeting_id == meeting_id) + .ok_or_else(|| WaError::new("recording", "no matching active recording"))?; + let mic = session + .mic_capture + .as_ref() + .ok_or_else(|| WaError::new("audio", "the microphone is off for this meeting"))?; + let muted = !mic.is_muted(); + mic.set_muted(muted); + drop(guard); + let _ = app.emit( + "recording://mic", + serde_json::json!({ "meetingId": meeting_id, "muted": muted }), + ); + crate::update_tray_tooltip( + &app, + if muted { + "WhispAssist — recording (mic muted)" + } else { + "WhispAssist — recording" + }, + ); + Ok(muted) +} + /// Toggle audio retention mid-meeting (ADR-0009, FR-REC-1). #[tauri::command] pub async fn set_recording_retention(