pause_recording, resume_recording, toggle_pause_recordingset_microphone and set_camerarecording.rs and lib.rscargo test -p cap-desktop deeplink_actions -- --nocapture in this environment because cargo is not installed in PATH./claim #1540
This PR extends deeplink_actions.rs with five new deeplink actions (PauseRecording, ResumeRecording, TogglePauseRecording, SetMicrophone, and SetCamera) and wires them to the existing Tauri command handlers in recording.rs and lib.rs. The changes are additive and follow established patterns already used by StartRecording and StopRecording.
Key changes:
pause_recording, resume_recording, toggle_pause_recording) delegate to the corresponding crate::recording::* functions.SetMicrophone, SetCamera) delegate to the private-but-descendant-accessible crate::set_mic_input and crate::set_camera_input Tauri commands.ResumeRecording and TogglePauseRecording do not have equivalent tests yet.SetCamera unconditionally passes skip_camera_window: Some(true), suppressing the camera preview popup on camera switch — behaviour that differs from StartRecording and is currently undocumented.ResumeRecording and TogglePauseRecording, and the silently-suppressed camera preview window for SetCamera deeplinks that could confuse future maintainers.skip_camera_window: Some(true) decision.| Filename | Overview |
|---|---|
| apps/desktop/src-tauri/src/deeplink_actions.rs | Adds PauseRecording, ResumeRecording, TogglePauseRecording, SetMicrophone, and SetCamera deeplink actions and wires them to existing handlers; parsing tests cover only 3 of 5 new actions (missing ResumeRecording and TogglePauseRecording), and the decision to suppress the camera preview window (skip_camera_window: Some(true)) for the SetCamera deeplink is undocumented. |
%%{init: {'theme': 'neutral'}}%%
flowchart TD
URL["cap-desktop://action?value=..."] --> Parse["DeepLinkAction::try_from(url)"]
Parse --> Deserialise["serde_json::from_str(value)"]
Deserialise -->|pause_recording| PR["PauseRecording"]
Deserialise -->|resume_recording| RR["ResumeRecording"]
Deserialise -->|toggle_pause_recording| TPR["TogglePauseRecording"]
Deserialise -->|set_microphone| SM["SetMicrophone { mic_label }"]
Deserialise -->|set_camera| SC["SetCamera { camera }"]
PR --> pause["crate::recording::pause_recording()"]
RR --> resume["crate::recording::resume_recording()"]
TPR --> toggle["crate::recording::toggle_pause_recording()"]
SM --> setMic["crate::set_mic_input(state, mic_label)"]
SC --> setCam["crate::set_camera_input(app, state, camera, Some(true))"]
setCam -->|skip_camera_window=true| noPop["Camera preview window NOT shown"]
setCam -->|camera=None| disableCam["Camera input removed"]
Last reviewed commit: bf6f9aa
Greptile also left 2 inline comments on this PR.
(2/5) Greptile learns from your feedback when you react with thumbs up/down!
Abu1982
@Abu1982
Cap
@CapSoftware
Abhishek Verma
@w3Abhishek