From 0a9df9d8c48081768d8f124556e1dffcd7963088 Mon Sep 17 00:00:00 2001 From: vankhaygpsc5400cc-bot Date: Sat, 24 Jan 2026 00:08:01 +0700 Subject: [PATCH 1/2] feat: add pause-recording --- .../desktop/src-tauri/src/deeplink_actions.rs | 23 +++++++++++-------- apps/desktop/src-tauri/src/lib.rs | 8 +++---- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/apps/desktop/src-tauri/src/deeplink_actions.rs b/apps/desktop/src-tauri/src/deeplink_actions.rs index dbd90f667f..543dac4dc5 100644 --- a/apps/desktop/src-tauri/src/deeplink_actions.rs +++ b/apps/desktop/src-tauri/src/deeplink_actions.rs @@ -17,7 +17,7 @@ pub enum CaptureMode { #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] -pub enum DeepLinkAction { +pub enum Action { StartRecording { capture_mode: CaptureMode, camera: Option, @@ -26,6 +26,7 @@ pub enum DeepLinkAction { mode: RecordingMode, }, StopRecording, + PauseRecording, OpenEditor { project_path: PathBuf, }, @@ -41,7 +42,7 @@ pub fn handle(app_handle: &AppHandle, urls: Vec) { .into_iter() .filter(|url| !url.as_str().is_empty()) .filter_map(|url| { - DeepLinkAction::try_from(&url) + Action::try_from(&url) .map_err(|e| match e { ActionParseFromUrlError::ParseFailed(msg) => { eprintln!("Failed to parse deep link \"{}\": {}", &url, msg) @@ -49,7 +50,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() @@ -76,7 +76,7 @@ pub enum ActionParseFromUrlError { NotAction, } -impl TryFrom<&Url> for DeepLinkAction { +impl TryFrom<&Url> for Action { type Error = ActionParseFromUrlError; fn try_from(url: &Url) -> Result { @@ -104,10 +104,10 @@ impl TryFrom<&Url> for DeepLinkAction { } } -impl DeepLinkAction { +impl Action { pub async fn execute(self, app: &AppHandle) -> Result<(), String> { match self { - DeepLinkAction::StartRecording { + Action::StartRecording { capture_mode, camera, mic_label, @@ -143,15 +143,18 @@ impl DeepLinkAction { .await .map(|_| ()) } - DeepLinkAction::StopRecording => { + Action::StopRecording => { crate::recording::stop_recording(app.clone(), app.state()).await } - DeepLinkAction::OpenEditor { project_path } => { + Action::PauseRecording => { + crate::recording::pause_recording(app.clone(), app.state()).await + } + Action::OpenEditor { project_path } => { crate::open_project_from_path(Path::new(&project_path), app.clone()) } - DeepLinkAction::OpenSettings { page } => { + Action::OpenSettings { page } => { crate::show_window(app.clone(), ShowCapWindow::Settings { page }).await } } } -} +} \ 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 90803f8abe..862215a178 100644 --- a/apps/desktop/src-tauri/src/lib.rs +++ b/apps/desktop/src-tauri/src/lib.rs @@ -7,7 +7,7 @@ mod auth; mod camera; mod camera_legacy; mod captions; -mod deeplink_actions; +mod _actions; mod editor_window; mod export; mod fake_window; @@ -84,7 +84,7 @@ use std::{ time::Duration, }; use tauri::{AppHandle, Manager, State, Window, WindowEvent, ipc::Channel}; -use tauri_plugin_deep_link::DeepLinkExt; +use tauri_plugin_deep_link::Ext; use tauri_plugin_dialog::DialogExt; use tauri_plugin_global_shortcut::GlobalShortcutExt; use tauri_plugin_notification::{NotificationExt, PermissionState}; @@ -2776,7 +2776,7 @@ pub async fn run(recording_logging_handle: LoggingHandle, logs_dir: PathBuf) { tauri::Builder::default().plugin(tauri_plugin_single_instance::init(|app, args, _cwd| { trace!("Single instance invoked with args {args:?}"); - // This is also handled as a deeplink on some platforms (eg macOS), see deeplink_actions + // This is also handled as a on some platforms (eg macOS), see _actions let Some(cap_file) = args .iter() .find(|arg| arg.ends_with(".cap")) @@ -3070,7 +3070,7 @@ pub async fn run(recording_logging_handle: LoggingHandle, logs_dir: PathBuf) { let app_handle = app.clone(); app.deep_link().on_open_url(move |event| { - deeplink_actions::handle(&app_handle, event.urls()); + _actions::handle(&app_handle, event.urls()); }); Ok(()) From 7c685edf63261203a2a5ef6408963f40dff717b5 Mon Sep 17 00:00:00 2001 From: vankhaygpsc5400cc-bot Date: Sat, 24 Jan 2026 09:04:32 +0700 Subject: [PATCH 2/2] fix: address all review comment and restore naming --- apps/desktop/src-tauri/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs index 862215a178..c4004d4f6f 100644 --- a/apps/desktop/src-tauri/src/lib.rs +++ b/apps/desktop/src-tauri/src/lib.rs @@ -7,7 +7,7 @@ mod auth; mod camera; mod camera_legacy; mod captions; -mod _actions; +mod deeplink_actions; mod editor_window; mod export; mod fake_window; @@ -84,7 +84,7 @@ use std::{ time::Duration, }; use tauri::{AppHandle, Manager, State, Window, WindowEvent, ipc::Channel}; -use tauri_plugin_deep_link::Ext; +use tauri_plugin_deep_link::DeepLinkExt; use tauri_plugin_dialog::DialogExt; use tauri_plugin_global_shortcut::GlobalShortcutExt; use tauri_plugin_notification::{NotificationExt, PermissionState}; @@ -2776,7 +2776,7 @@ pub async fn run(recording_logging_handle: LoggingHandle, logs_dir: PathBuf) { tauri::Builder::default().plugin(tauri_plugin_single_instance::init(|app, args, _cwd| { trace!("Single instance invoked with args {args:?}"); - // This is also handled as a on some platforms (eg macOS), see _actions + // This is also handled as a deeplink on some platforms (eg macOS), see deeplink_actions. let Some(cap_file) = args .iter() .find(|arg| arg.ends_with(".cap")) @@ -3070,7 +3070,7 @@ pub async fn run(recording_logging_handle: LoggingHandle, logs_dir: PathBuf) { let app_handle = app.clone(); app.deep_link().on_open_url(move |event| { - _actions::handle(&app_handle, event.urls()); + deeplink_actions::handle(&app_handle, event.urls()); }); Ok(())