[Fix] Add Raycast recording controls via deeplinks#1813
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
| "name": "switch-microphone", | ||
| "title": "Switch Microphone", | ||
| "description": "Select the microphone Cap should use", | ||
| "mode": "view", | ||
| "preferences": [ | ||
| { | ||
| "name": "defaultScreenName", | ||
| "description": "Screen display name used by Start Recording when Capture Source is Screen.", | ||
| "type": "textfield", | ||
| "required": false, | ||
| "title": "Default Screen Name", | ||
| "label": "Default Screen Name" | ||
| }, | ||
| { | ||
| "name": "defaultWindowName", | ||
| "description": "Window title used by Start Recording when Capture Source is Window.", | ||
| "type": "textfield", | ||
| "required": false, | ||
| "title": "Default Window Name", | ||
| "label": "Default Window Name" | ||
| }, | ||
| { | ||
| "name": "microphoneLabel", | ||
| "description": "Microphone label Cap should select before recording.", | ||
| "type": "textfield", | ||
| "required": false, | ||
| "title": "Microphone Label", | ||
| "label": "Microphone Label" | ||
| }, | ||
| { | ||
| "name": "cameraDeviceId", | ||
| "description": "Camera device ID Cap should select before recording.", | ||
| "type": "textfield", | ||
| "required": false, | ||
| "title": "Camera Device ID", | ||
| "label": "Camera Device ID" | ||
| }, | ||
| { | ||
| "name": "recordingMode", | ||
| "description": "Default Cap recording mode.", | ||
| "type": "dropdown", | ||
| "required": false, | ||
| "default": "studio", | ||
| "data": [ | ||
| { | ||
| "title": "Studio", | ||
| "value": "studio" | ||
| }, | ||
| { | ||
| "title": "Instant", | ||
| "value": "instant" | ||
| }, | ||
| { | ||
| "title": "Screenshot", | ||
| "value": "screenshot" | ||
| } | ||
| ], | ||
| "title": "Recording Mode", | ||
| "label": "Recording Mode" | ||
| }, | ||
| { | ||
| "name": "captureSystemAudio", | ||
| "description": "Capture system audio by default.", | ||
| "type": "checkbox", | ||
| "required": false, | ||
| "default": true, | ||
| "title": "Capture System Audio", | ||
| "label": "Capture System Audio" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "switch-camera", | ||
| "title": "Switch Camera", | ||
| "description": "Select the camera Cap should use", | ||
| "mode": "view", | ||
| "preferences": [ | ||
| { | ||
| "name": "defaultScreenName", | ||
| "description": "Screen display name used by Start Recording when Capture Source is Screen.", |
There was a problem hiding this comment.
Irrelevant preferences copied into switch-input commands
The switch-microphone and switch-camera commands inherit the full start-recording preference block — defaultScreenName, defaultWindowName, recordingMode, and captureSystemAudio — but neither command's source (switch-microphone.tsx, switch-camera.tsx) reads any of those values. Raycast will surface all six preferences to users under these commands when only microphoneLabel (or cameraDeviceId) is actually needed, which creates a confusing settings experience.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/raycast/package.json
Line: 101-180
Comment:
**Irrelevant preferences copied into switch-input commands**
The `switch-microphone` and `switch-camera` commands inherit the full `start-recording` preference block — `defaultScreenName`, `defaultWindowName`, `recordingMode`, and `captureSystemAudio` — but neither command's source (`switch-microphone.tsx`, `switch-camera.tsx`) reads any of those values. Raycast will surface all six preferences to users under these commands when only `microphoneLabel` (or `cameraDeviceId`) is actually needed, which creates a confusing settings experience.
How can I resolve this? If you propose a fix, please make it concise.| <Form.TextField | ||
| id="targetName" | ||
| title="Target Name" | ||
| defaultValue={defaultTarget} | ||
| placeholder="Display or window name from Cap" | ||
| /> |
There was a problem hiding this comment.
Missing validation on
targetName — an empty or whitespace-only submission is allowed by the form but will always fail inside Cap (the Rust side returns "No screen/window with name \"\"") with no visible error feedback to the user. Adding a validation prop ensures Cap only receives a meaningful name.
| <Form.TextField | |
| id="targetName" | |
| title="Target Name" | |
| defaultValue={defaultTarget} | |
| placeholder="Display or window name from Cap" | |
| /> | |
| <Form.TextField | |
| id="targetName" | |
| title="Target Name" | |
| defaultValue={defaultTarget} | |
| placeholder="Display or window name from Cap" | |
| validation={(v) => (!v?.trim() ? "Target name is required" : undefined)} | |
| /> |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/raycast/src/start-recording.tsx
Line: 63-68
Comment:
**Missing validation on `targetName`** — an empty or whitespace-only submission is allowed by the form but will always fail inside Cap (the Rust side returns `"No screen/window with name \"\""`) with no visible error feedback to the user. Adding a `validation` prop ensures Cap only receives a meaningful name.
```suggestion
<Form.TextField
id="targetName"
title="Target Name"
defaultValue={defaultTarget}
placeholder="Display or window name from Cap"
validation={(v) => (!v?.trim() ? "Target name is required" : undefined)}
/>
```
How can I resolve this? If you propose a fix, please make it concise.
Summary
Validation
pnpm --dir apps/raycast lintpnpm --dir apps/raycast exec tsc --noEmitpnpm --dir apps/raycast buildNote: Rust tooling (
cargo/rustfmt) was not available in this environment, so desktop Rust changes were statically reviewed and covered with parser unit tests.Greptile Summary
This PR adds
PauseRecording,ResumeRecording,SetMicrophone, andSetCameradeeplink actions to the Tauri desktop backend and introduces a new Raycast extension that exposes all recording controls as Raycast commands via those deeplinks. The Rust additions are small, cleanly delegating to existing functions, and are covered by new parser unit tests.deeplink_actions.rsare well-integrated — they reuse the existingpause_recording,resume_recording,set_mic_input, andset_camera_inputhelpers and the JSON shape matches the TypeScript type definitions incap.ts.switch-microphoneandswitch-cameracommands inpackage.jsoncopy the fullstart-recordingpreference block (including unrelateddefaultScreenName,defaultWindowName,recordingMode,captureSystemAudio), none of which those commands read; this creates unnecessary clutter in the Raycast preferences UI.start-recording.tsxhas no form validation on thetargetNamefield, so a blank submission silently fails inside Cap without surfacing an error to the user.Confidence Score: 4/5
The Rust backend changes are safe to merge; the Raycast extension has minor UX rough edges but no breaking issues.
The core deeplink dispatch and the TypeScript-to-Rust JSON contract are correct. The two findings — extraneous preferences on switch commands and the missing target-name validation — affect usability rather than correctness, and neither blocks the primary recording control flows.
apps/raycast/package.json (preference bloat on switch-input commands) and apps/raycast/src/start-recording.tsx (missing field validation).
Important Files Changed
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "feat: add recording deeplinks and raycas..." | Re-trigger Greptile