-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Feat; Add deeplink support + raycast extensions support #1575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@richiemcilroy I have make the PR for #1570 . Feel free to check my PR and let's discuss if there's something that I can improve from it. thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 files reviewed, 7 comments
| OpenSettings { | ||
| page: Option<String>, | ||
| }, | ||
| // add Pause Recording, Resume Recording, Toggle Pause Recording, Take Screenshot, SetCamera, & SetMicrophone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
violates NO COMMENTS policy in CLAUDE.md and AGENTS.md
| // add Pause Recording, Resume Recording, Toggle Pause Recording, Take Screenshot, SetCamera, & SetMicrophone | |
| PauseRecording, |
Context Used: Context from dashboard - CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/deeplink_actions.rs
Line: 35:35
Comment:
violates NO COMMENTS policy in CLAUDE.md and AGENTS.md
```suggestion
PauseRecording,
```
**Context Used:** Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=9a906542-f1fe-42c1-89a2-9f252d96d9f0))
How can I resolve this? If you propose a fix, please make it concise.| // Pause Recording | ||
| DeepLinkAction::PauseRecording => { | ||
| crate::recording::pause_recording(app.clone(), app.state()).await | ||
| } | ||
| // Resume Recording | ||
| DeepLinkAction::ResumeRecording => { | ||
| crate::recording::resume_recording(app.clone(), app.state()).await | ||
| } | ||
| // Toggle Pause Recording | ||
| DeepLinkAction::TogglePauseRecording => { | ||
| crate::recording::toggle_pause_recording(app.clone(), app.state()).await | ||
| } | ||
| // Take Screenshot | ||
| DeepLinkAction::TakeScreenshot{ target } => { | ||
| crate::recording::take_screenshot(app.clone(), app.state(), target).await.map(|_| ()) | ||
| } | ||
| // Set Camera | ||
| DeepLinkAction::SetCamera{ camera_id } => { | ||
| let camera_id = camera_id.ok_or_else(|| "camera_id is required".to_string())?; | ||
| let state = app.state::<ArcLock<App>>(); | ||
| crate::set_camera_input(app.clone(), state.clone(), Some(camera_id), None).await | ||
| } | ||
| // Set Microphone | ||
| DeepLinkAction::SetMicrophone{ mic_label } => { | ||
| let label = mic_label.ok_or_else(|| "mic_label is required".to_string())?; | ||
| let state = app.state::<ArcLock<App>>(); | ||
| crate::set_mic_input(state.clone(), Some(mic_label)).await | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
violates NO COMMENTS policy - inline comments on lines 168, 172, 176, 180, 184, and 190 must be removed per CLAUDE.md and AGENTS.md
| // Pause Recording | |
| DeepLinkAction::PauseRecording => { | |
| crate::recording::pause_recording(app.clone(), app.state()).await | |
| } | |
| // Resume Recording | |
| DeepLinkAction::ResumeRecording => { | |
| crate::recording::resume_recording(app.clone(), app.state()).await | |
| } | |
| // Toggle Pause Recording | |
| DeepLinkAction::TogglePauseRecording => { | |
| crate::recording::toggle_pause_recording(app.clone(), app.state()).await | |
| } | |
| // Take Screenshot | |
| DeepLinkAction::TakeScreenshot{ target } => { | |
| crate::recording::take_screenshot(app.clone(), app.state(), target).await.map(|_| ()) | |
| } | |
| // Set Camera | |
| DeepLinkAction::SetCamera{ camera_id } => { | |
| let camera_id = camera_id.ok_or_else(|| "camera_id is required".to_string())?; | |
| let state = app.state::<ArcLock<App>>(); | |
| crate::set_camera_input(app.clone(), state.clone(), Some(camera_id), None).await | |
| } | |
| // Set Microphone | |
| DeepLinkAction::SetMicrophone{ mic_label } => { | |
| let label = mic_label.ok_or_else(|| "mic_label is required".to_string())?; | |
| let state = app.state::<ArcLock<App>>(); | |
| crate::set_mic_input(state.clone(), Some(mic_label)).await | |
| } | |
| DeepLinkAction::PauseRecording => { | |
| crate::recording::pause_recording(app.clone(), app.state()).await | |
| } | |
| DeepLinkAction::ResumeRecording => { | |
| crate::recording::resume_recording(app.clone(), app.state()).await | |
| } | |
| DeepLinkAction::TogglePauseRecording => { | |
| crate::recording::toggle_pause_recording(app.clone(), app.state()).await | |
| } | |
| DeepLinkAction::TakeScreenshot{ target } => { | |
| crate::recording::take_screenshot(app.clone(), app.state(), target).await.map(|_| ()) | |
| } | |
| DeepLinkAction::SetCamera{ camera_id } => { | |
| let camera_id = camera_id.ok_or_else(|| "camera_id is required".to_string())?; | |
| let state = app.state::<ArcLock<App>>(); | |
| crate::set_camera_input(app.clone(), state.clone(), Some(camera_id), None).await | |
| } | |
| DeepLinkAction::SetMicrophone{ mic_label } => { | |
| let label = mic_label.ok_or_else(|| "mic_label is required".to_string())?; | |
| let state = app.state::<ArcLock<App>>(); | |
| crate::set_mic_input(state.clone(), Some(mic_label)).await | |
| } |
Context Used: Context from dashboard - CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
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:195
Comment:
violates NO COMMENTS policy - inline comments on lines 168, 172, 176, 180, 184, and 190 must be removed per CLAUDE.md and AGENTS.md
```suggestion
DeepLinkAction::PauseRecording => {
crate::recording::pause_recording(app.clone(), app.state()).await
}
DeepLinkAction::ResumeRecording => {
crate::recording::resume_recording(app.clone(), app.state()).await
}
DeepLinkAction::TogglePauseRecording => {
crate::recording::toggle_pause_recording(app.clone(), app.state()).await
}
DeepLinkAction::TakeScreenshot{ target } => {
crate::recording::take_screenshot(app.clone(), app.state(), target).await.map(|_| ())
}
DeepLinkAction::SetCamera{ camera_id } => {
let camera_id = camera_id.ok_or_else(|| "camera_id is required".to_string())?;
let state = app.state::<ArcLock<App>>();
crate::set_camera_input(app.clone(), state.clone(), Some(camera_id), None).await
}
DeepLinkAction::SetMicrophone{ mic_label } => {
let label = mic_label.ok_or_else(|| "mic_label is required".to_string())?;
let state = app.state::<ArcLock<App>>();
crate::set_mic_input(state.clone(), Some(mic_label)).await
}
```
**Context Used:** Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=9a906542-f1fe-42c1-89a2-9f252d96d9f0))
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.| const action = { | ||
| open_settings: { page: "recording" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
action doesn't trigger recording start - sends open_settings with recording page instead of start_recording action. Doesn't match command name or description
Prompt To Fix With AI
This is a comment left during a code review.
Path: raycast-extensions/src/start-recording.tsx
Line: 14:15
Comment:
action doesn't trigger recording start - sends `open_settings` with recording page instead of `start_recording` action. Doesn't match command name or description
How can I resolve this? If you propose a fix, please make it concise.
package.json
Outdated
| "dependencies": { | ||
| "@raycast/api": "^1.104.4" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raycast/api dependency added to root package.json but Raycast extension has its own package.json in raycast-extensions/. Root dependencies pollute the monorepo workspace
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: package.json
Line: 63:65
Comment:
`@raycast/api` dependency added to root `package.json` but Raycast extension has its own `package.json` in `raycast-extensions/`. Root dependencies pollute the monorepo workspace
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.|
|
||
| export default async function Command() { | ||
| try { | ||
| const action = { pause_recording: {} }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
action format { pause_recording: {} } doesn't match format used in other commands - stop-recording.tsx uses { stop_recording: null } and toggle-pause.tsx uses { toggle_pause_recording: null }
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: raycast-extensions/src/pause-recording.tsx
Line: 5:5
Comment:
action format `{ pause_recording: {} }` doesn't match format used in other commands - `stop-recording.tsx` uses `{ stop_recording: null }` and `toggle-pause.tsx` uses `{ toggle_pause_recording: null }`
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.|
|
||
| export default async function Command() { | ||
| try { | ||
| const action = { resume_recording: {} }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
action format { resume_recording: {} } should be { resume_recording: null } for consistency with stop-recording.tsx and toggle-pause.tsx
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: raycast-extensions/src/resume-recording.tsx
Line: 5:5
Comment:
action format `{ resume_recording: {} }` should be `{ resume_recording: null }` for consistency with `stop-recording.tsx` and `toggle-pause.tsx`
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.
Summary
🎯 Bounty Submission for Issue #1540
/claim #1540
This pull request adds a new Raycast extension for controlling the Cap screen recorder directly from Raycast, and extends the Cap desktop app's deeplink API to support additional recording and device actions. The main changes include new deeplink actions in the desktop app, new Raycast extension commands, and supporting documentation and configuration.
Raycast Extension Integration:
raycast-extensionsdirectory, with commands for starting, stopping, pausing, resuming, toggling pause, and taking screenshots in Cap. Each command sends the appropriate deeplink to the Cap desktop app.README.mdexplaining installation, usage, and the deeplink protocol for the Raycast extension.Cap Desktop Deeplink API Enhancements:
DeepLinkActionenum and handler indeeplink_actions.rsto support new actions: pause, resume, toggle pause recording, take screenshot, set camera, and set microphone. These are now callable via deeplinks. [1] [2]Dependency and Configuration Updates:
@raycast/apidependency to the mainpackage.jsonto support Raycast extension development.package.jsonfor the Raycast extension, specifying commands, dependencies, devDependencies, and scripts for building and publishing the extension.These changes enable users to control Cap's core recording features from Raycast, improving workflow efficiency and automation.
Greptile Overview
Greptile Summary
This PR adds Raycast extension support to Cap by creating a new extension in
raycast-extensions/and extending the desktop app's deeplink API with 6 new actions (pause, resume, toggle-pause, take-screenshot, set-camera, set-microphone).Key Changes:
DeepLinkActionenum indeeplink_actions.rswith 6 new recording control actionscap-desktop://deeplinksCritical Issues Found:
SetMicrophonehandler -labelis extracted butmic_labelis passed to function (line 192-194)@raycast/apiadded to rootpackage.jsoninstead of staying isolated inraycast-extensions/{}while stop/toggle usenullfor empty actionsConfidence Score: 2/5
apps/desktop/src-tauri/src/deeplink_actions.rsrequires immediate fixes for comments and variable bug;raycast-extensions/src/start-recording.tsxneeds complete reimplementationImportant Files Changed
@raycast/apito root package.json dependencies, should be isolated to raycast-extensions directorySequence Diagram
sequenceDiagram participant User participant Raycast participant RaycastExtension participant Desktop as Cap Desktop App participant DeeplinkHandler as Deeplink Handler participant RecordingModule as Recording Module User->>Raycast: Execute command (e.g. "Pause Recording") Raycast->>RaycastExtension: Trigger command handler RaycastExtension->>RaycastExtension: Build deeplink action JSON Note over RaycastExtension: Format: {"pause_recording": {}} RaycastExtension->>RaycastExtension: Encode to cap-desktop:// URL RaycastExtension->>Desktop: Open deeplink URL Desktop->>DeeplinkHandler: Parse URL & extract action DeeplinkHandler->>DeeplinkHandler: Deserialize JSON to DeepLinkAction enum DeeplinkHandler->>RecordingModule: Execute action (e.g. pause_recording) RecordingModule->>Desktop: Update recording state Desktop-->>User: Recording paused RaycastExtension->>User: Show toast notification(2/5) Greptile learns from your feedback when you react with thumbs up/down!
Context used:
dashboard- CLAUDE.md (source)