Fixes #1540
Added PauseRecording, ResumeRecording, SwitchMicrophone, and SwitchCamera to DeepLinkAction. These implementations hook into the existing recording state and device management functions.
Verification
Due to local build environment constraints (Windows/FFmpeg), I could not record a live demo video. However:
Static Analysis Verified that deeplink_actions.rs correctly hooks into crate::recording.
Edge Cases Validated that Pause/Resume now use the official commands to emit Paused/Resumed events.
Safety Added existence checks for microphones and cameras to prevent crashes or errors on invalid IDs.
How to Test
Trigger cap://action?value={"pause_recording":{}} → The app should pause and emit a Paused event.
Trigger cap://action?value={"resume_recording":{}} → The app should resume and emit a Resumed event.
Demo Video Note: I am developing on a Windows machine where the build environment for this project is difficult to set up fully (FFmpeg/Rust/Tauri dependencies). Therefore, I cannot generate a runtime video recording.
However, I have verified the changes via:
Static Analysis: Ensuring correct hookups to crate::recording. Validating Fixes: I implemented the reviewer’s feedback to use pause_recording() commands (ensuring event emission) and added defensive checks for device IDs. The code compiles and passes the CI checks. I am happy to address any further code review feedback!
/claim #1540
This PR extends deeplink support by adding four new actions: PauseRecording, ResumeRecording, SwitchMicrophone, and SwitchCamera. These implementations properly integrate with existing recording state management and device handling functions, enabling Raycast extension support and other external tools to control the app through deeplinks.
PauseRecording and ResumeRecording actions that delegate to existing Tauri commands which emit proper state-change eventsSwitchMicrophone action with validation to ensure the microphone exists before attempting to switchSwitchCamera action with comprehensive validation supporting both DeviceID and ModelID types| Filename | Overview |
|---|---|
| apps/desktop/src-tauri/src/deeplink_actions.rs | Added four new deeplink actions (PauseRecording, ResumeRecording, SwitchMicrophone, SwitchCamera) that integrate with existing recording and device management functions. Implementation includes proper error handling with existence checks for devices and correctly delegates to established Tauri commands that emit required events. |
sequenceDiagram
participant External as External App
participant DeepLink as DeepLink Handler
participant RecordingCmd as Recording Commands
participant DeviceCmd as Device Commands
participant State as App State
External->>DeepLink: cap://action?value={...}
DeepLink->>DeepLink: Parse & validate URL
rect rgb(200, 220, 255)
note over DeepLink,RecordingCmd: Pause/Resume Actions
DeepLink->>RecordingCmd: pause_recording()
RecordingCmd->>State: Pause recording & emit Paused event
end
rect rgb(200, 255, 220)
note over DeepLink,DeviceCmd: Device Switch Actions
DeepLink->>DeviceCmd: Validate device exists
DeepLink->>DeviceCmd: set_mic_input() or set_camera_input()
DeviceCmd->>State: Update device & emit event if restored
end
HCRSolutions
@Sadik111
Cap
@CapSoftware