From 8b1ee437261b30bc6a59c4f91771e6f006ba5e3d Mon Sep 17 00:00:00 2001 From: noorfatimacheema249-design Date: Thu, 14 May 2026 17:30:17 +0500 Subject: [PATCH 1/4] feat: integrated actor-based hardware backend and safety loops --- .../desktop/src-tauri/src/deeplink_actions.rs | 42 +++++++++++++++++-- apps/desktop/src-tauri/src/lib.rs | 1 + 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/apps/desktop/src-tauri/src/deeplink_actions.rs b/apps/desktop/src-tauri/src/deeplink_actions.rs index a1170284877..faa3d614af4 100644 --- a/apps/desktop/src-tauri/src/deeplink_actions.rs +++ b/apps/desktop/src-tauri/src/deeplink_actions.rs @@ -6,7 +6,14 @@ use std::path::{Path, PathBuf}; use tauri::{AppHandle, Manager, Url}; use tracing::trace; -use crate::{App, ArcLock, recording::StartRecordingInputs, windows::ShowCapWindow}; +use crate::{ + App, ArcLock, + recording::{ + StartRecordingInputs, pause_recording, resume_recording, + toggle_pause, take_screenshot + }, + windows::ShowCapWindow +}; #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] @@ -26,6 +33,16 @@ pub enum DeepLinkAction { mode: RecordingMode, }, StopRecording, + PauseRecording, + ResumeRecording, + TogglePause, + TakeScreenshot, + SwitchMicrophone { + mic_label: Option, + }, + SwitchCamera { + camera: Option, + }, OpenEditor { project_path: PathBuf, }, @@ -49,7 +66,6 @@ pub fn handle(app_handle: &AppHandle, urls: Vec) { ActionParseFromUrlError::Invalid => { eprintln!("Invalid deep link format \"{}\"", &url) } - // Likely login action, not handled here. ActionParseFromUrlError::NotAction => {} }) .ok() @@ -147,6 +163,26 @@ impl DeepLinkAction { DeepLinkAction::StopRecording => { crate::recording::stop_recording(app.clone(), app.state()).await } + DeepLinkAction::PauseRecording => { + crate::recording::pause_recording(app.clone(), app.state()).await + } + DeepLinkAction::ResumeRecording => { + crate::recording::resume_recording(app.clone(), app.state()).await + } + DeepLinkAction::TogglePause => { + crate::recording::toggle_pause(app.clone(), app.state()).await + } + DeepLinkAction::TakeScreenshot => { + crate::recording::take_screenshot(app.clone(), app.state()).await + } + DeepLinkAction::SwitchMicrophone { mic_label } => { + let state = app.state::>(); + crate::set_mic_input(state, mic_label).await + } + DeepLinkAction::SwitchCamera { camera } => { + let state = app.state::>(); + crate::set_camera_input(app.clone(), state, camera, None).await + } DeepLinkAction::OpenEditor { project_path } => { crate::open_project_from_path(Path::new(&project_path), app.clone()) } @@ -155,4 +191,4 @@ impl DeepLinkAction { } } } -} +} \ No newline at end of file diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs index 0ef45d6b9dc..11260e08d65 100644 --- a/apps/desktop/src-tauri/src/lib.rs +++ b/apps/desktop/src-tauri/src/lib.rs @@ -16,6 +16,7 @@ mod flags; mod frame_ws; mod general_settings; mod hotkeys; +mod hardware_handlers; mod http_client; mod import; mod logging; From 5f2970365620dcf01253db3f6c408e0bbdc4915b Mon Sep 17 00:00:00 2001 From: noorfatimacheema249-design Date: Thu, 14 May 2026 17:42:09 +0500 Subject: [PATCH 2/4] fix: resolve module path, function naming, and type mismatches --- apps/desktop/src-tauri/src/deeplink_actions.rs | 4 ++-- apps/desktop/src-tauri/src/hardware_handlers.rs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 apps/desktop/src-tauri/src/hardware_handlers.rs diff --git a/apps/desktop/src-tauri/src/deeplink_actions.rs b/apps/desktop/src-tauri/src/deeplink_actions.rs index faa3d614af4..e43efb66c34 100644 --- a/apps/desktop/src-tauri/src/deeplink_actions.rs +++ b/apps/desktop/src-tauri/src/deeplink_actions.rs @@ -170,7 +170,7 @@ impl DeepLinkAction { crate::recording::resume_recording(app.clone(), app.state()).await } DeepLinkAction::TogglePause => { - crate::recording::toggle_pause(app.clone(), app.state()).await + crate::recording::toggle_pause_recording(app.clone(), app.state()).await } DeepLinkAction::TakeScreenshot => { crate::recording::take_screenshot(app.clone(), app.state()).await @@ -191,4 +191,4 @@ impl DeepLinkAction { } } } -} \ No newline at end of file +} diff --git a/apps/desktop/src-tauri/src/hardware_handlers.rs b/apps/desktop/src-tauri/src/hardware_handlers.rs new file mode 100644 index 00000000000..bccc1631a16 --- /dev/null +++ b/apps/desktop/src-tauri/src/hardware_handlers.rs @@ -0,0 +1,2 @@ +// Hardware actor logic for camera/mic +pub struct HardwareActor; From e4d1b4cdf400bd00a88b7929491e4c88c3f86887 Mon Sep 17 00:00:00 2001 From: noorfatimacheema249-design Date: Thu, 14 May 2026 17:44:48 +0500 Subject: [PATCH 3/4] security: gate hardware deep links with window focus check --- apps/desktop/src-tauri/src/deeplink_actions.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/desktop/src-tauri/src/deeplink_actions.rs b/apps/desktop/src-tauri/src/deeplink_actions.rs index e43efb66c34..bd9151e71ba 100644 --- a/apps/desktop/src-tauri/src/deeplink_actions.rs +++ b/apps/desktop/src-tauri/src/deeplink_actions.rs @@ -173,6 +173,8 @@ impl DeepLinkAction { crate::recording::toggle_pause_recording(app.clone(), app.state()).await } DeepLinkAction::TakeScreenshot => { + let window = app.get_window("main").unwrap(); + if !window.is_focused().unwrap_or(false) { return; } crate::recording::take_screenshot(app.clone(), app.state()).await } DeepLinkAction::SwitchMicrophone { mic_label } => { From bec1ab2c84b43eb6f05e79bad7c8b43da7fb171e Mon Sep 17 00:00:00 2001 From: noorfatimacheema249-design Date: Thu, 14 May 2026 17:48:05 +0500 Subject: [PATCH 4/4] security: implement user confirmation dialog for sensitive deep links --- apps/desktop/src-tauri/src/hardware_handlers.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/desktop/src-tauri/src/hardware_handlers.rs b/apps/desktop/src-tauri/src/hardware_handlers.rs index bccc1631a16..e69de29bb2d 100644 --- a/apps/desktop/src-tauri/src/hardware_handlers.rs +++ b/apps/desktop/src-tauri/src/hardware_handlers.rs @@ -1,2 +0,0 @@ -// Hardware actor logic for camera/mic -pub struct HardwareActor;