fix: Bounty: Deeplinks support + Raycast Extension#1765
fix: Bounty: Deeplinks support + Raycast Extension#1765bounty-bot-beep wants to merge 2 commits intoCapSoftware:mainfrom
Conversation
| DeepLinkAction::SetMicrophone { label } => { | ||
| crate::set_mic_input(app.state(), label).await |
There was a problem hiding this comment.
SetMicrophone silently succeeds outside Studio recordings
set_mic_input only updates the live mic feed for InProgressRecording::Studio mode; for other recording modes (e.g., Instant/Segment) the function updates selected_mic_label but does NOT rewire the active recording's audio input. A caller (e.g., the Raycast extension) will receive Ok(()) even when the microphone wasn't actually switched mid-recording. The same asymmetry exists for SetCamera. This matches the in-app UI's behaviour, but it may be surprising for external callers relying on these deeplinks for real-time control. Consider emitting a warning or returning an informational status in those cases.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/deeplink_actions.rs
Line: 168-169
Comment:
**`SetMicrophone` silently succeeds outside Studio recordings**
`set_mic_input` only updates the live mic feed for `InProgressRecording::Studio` mode; for other recording modes (e.g., Instant/Segment) the function updates `selected_mic_label` but does NOT rewire the active recording's audio input. A caller (e.g., the Raycast extension) will receive `Ok(())` even when the microphone wasn't actually switched mid-recording. The same asymmetry exists for `SetCamera`. This matches the in-app UI's behaviour, but it may be surprising for external callers relying on these deeplinks for real-time control. Consider emitting a warning or returning an informational status in those cases.
How can I resolve this? If you propose a fix, please make it concise.| PauseRecording, | ||
| ResumeRecording, | ||
| TogglePauseRecording, | ||
| SetMicrophone { | ||
| label: Option<String>, | ||
| }, | ||
| SetCamera { | ||
| camera: Option<DeviceOrModelID>, | ||
| }, |
There was a problem hiding this comment.
SetCamera field name diverges from underlying command parameter
The struct variant uses camera: Option<DeviceOrModelID> while the underlying set_camera_input command names the same parameter id. The call site is correct (camera is passed positionally), but the JSON key exposed in the deep-link URL will be camera (due to rename_all = "snake_case"), whereas anyone reading set_camera_input's signature would expect id. A brief doc-comment on the variant clarifying the mapping would help future contributors and Raycast extension maintainers.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/deeplink_actions.rs
Line: 29-37
Comment:
**`SetCamera` field name diverges from underlying command parameter**
The struct variant uses `camera: Option<DeviceOrModelID>` while the underlying `set_camera_input` command names the same parameter `id`. The call site is correct (`camera` is passed positionally), but the JSON key exposed in the deep-link URL will be `camera` (due to `rename_all = "snake_case"`), whereas anyone reading `set_camera_input`'s signature would expect `id`. A brief doc-comment on the variant clarifying the mapping would help future contributors and Raycast extension maintainers.
How can I resolve this? If you propose a fix, please make it concise.P2-1 (L168-169): SetMicrophone and SetCamera deep-link actions now emit a tracing::warn! when no active Studio recording is present, making it explicit to external callers (e.g. Raycast extension) that the preference is persisted but the live audio/camera path is not immediately switched in non-Studio modes. P2-2 (L29-37): Added a doc-comment on the SetCamera enum variant clarifying that the JSON deep-link key is `camera` while the underlying set_camera_input Tauri command parameter is named `id`; the positional call is correct at runtime but the naming divergence was undocumented.
|
@greptileai please re-review Addressed both P2 findings in 4b30c13:
Ready for re-review. Thanks! |
|
Hi @CapSoftware team 👋 I've addressed the greptile P2 findings in commit 4b30c13:
Greptile re-review has passed (CI green). The PR is ready for maintainer review whenever you have a moment. Thanks! |
Summary
Resolves #1540: Bounty: Deeplinks support + Raycast Extension
I've extended the desktop deeplink action handler at
apps/desktop/src-tauri/src/deeplink_actions.rs:18to cover the operations the Raycast extension needs.Added variants on
DeepLinkAction:PauseRecording→crate::recording::pause_recordingResumeRecording→crate::recording::resume_recordingTogglePauseRecording→crate::recording::toggle_pause_recordingSetMicrophone { label }→crate::set_mic_inputSetCamera { camera }→crate::set_camera_inputThese match the existing
cap-desktop://action?value=<json>URL convention used byStartRecording/StopRecording. Each variant delegates to the existing tauri commands, so mic/camera switching during a recording uses the samestudio_handlepath that the in-app UI uses.Sample URLs the Raycast extension c
Closes #1540
Greptile Summary
Adds five new
DeepLinkActionvariants (PauseRecording,ResumeRecording,TogglePauseRecording,SetMicrophone,SetCamera) to enable Raycast extension control over recordings via thecap-desktop://actionURL scheme. Each variant delegates to the existing Tauri command layer, and the PR addresses prior review feedback by addingis_studiochecks with informationaltracing::warnmessages and a doc-comment explaining thecamera/idfield-name divergence.Confidence Score: 5/5
Safe to merge; only P2 style suggestions found, no logic or security issues.
All new variants delegate directly to well-tested existing Tauri commands, and the PR correctly addresses previous review comments. The two P2 findings (camera window popup and false-positive warning) are minor UX/logging concerns that do not affect correctness.
No files require special attention.
Important Files Changed
Sequence Diagram
sequenceDiagram participant Raycast as Raycast Extension participant OS as macOS URL Scheme participant Handler as handle() participant Action as DeepLinkAction::execute() participant State as ArcLock<App> participant Cmd as Tauri Commands Raycast->>OS: cap-desktop://action?value={...} OS->>Handler: handle(app_handle, urls) Handler->>Action: DeepLinkAction::try_from(url) Handler->>Action: action.execute(app_handle).await alt PauseRecording / ResumeRecording / TogglePauseRecording Action->>Cmd: recording::pause/resume/toggle_pause_recording(app, state) Cmd-->>Action: Result else SetMicrophone Action->>State: state.read().await.current_recording() State-->>Action: Option<InProgressRecording> Note over Action: warn if not Studio Action->>Cmd: set_mic_input(state, label) Cmd-->>Action: Result else SetCamera Action->>State: state.read().await.current_recording() State-->>Action: Option<InProgressRecording> Note over Action: warn if not Studio Action->>Cmd: set_camera_input(app, state, camera, None) Cmd-->>Action: Result end Action-->>Handler: Result<(), String>Prompt To Fix All With AI
Reviews (2): Last reviewed commit: "fix(deeplink): address greptile P2 findi..." | Re-trigger Greptile