feat: Raycast extension and deep link support#1743
feat: Raycast extension and deep link support#1743webhop123 wants to merge 2 commits intoCapSoftware:mainfrom
Conversation
This commit adds: - Comprehensive deep link support via the 'cap://' scheme. - Mute/Unmute functionality in the microphone feed actor. - Desktop notifications for all deep link actions. - A full-featured Raycast extension in extensions/raycast. - Rust unit tests for deep link parsing.
| impl Message<Mute> for MicrophoneFeed { | ||
| type Reply = (); | ||
|
|
||
| async fn handle(&mut self, _: Mute, _: &mut Context<Self, Self::Reply>) -> Self::Reply { | ||
| self.muted = true; | ||
| } | ||
| } | ||
|
|
||
| impl Message<Unmute> for MicrophoneFeed { | ||
| type Reply = (); | ||
|
|
||
| async fn handle(&mut self, _: Unmute, _: &mut Context<Self, Self::Reply>) -> Self::Reply { | ||
| self.muted = false; | ||
| } | ||
| } | ||
|
|
||
| impl Message<ToggleMute> for MicrophoneFeed { | ||
| type Reply = bool; | ||
|
|
||
| async fn handle(&mut self, _: ToggleMute, _: &mut Context<Self, Self::Reply>) -> Self::Reply { | ||
| self.muted = !self.muted; | ||
| self.muted | ||
| } | ||
| } |
There was a problem hiding this comment.
Duplicate
Message trait implementations will cause a compile error
Message<Mute>, Message<Unmute>, and Message<ToggleMute> are each implemented twice for MicrophoneFeed. The first set appears at lines 768–791 and the second set at lines 950–973 (added by this PR). Rust's orphan/coherence rules forbid conflicting trait implementations for the same type, so this will produce error[E0119] and prevent the crate from building at all.
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/recording/src/feeds/microphone.rs
Line: 950-973
Comment:
**Duplicate `Message` trait implementations will cause a compile error**
`Message<Mute>`, `Message<Unmute>`, and `Message<ToggleMute>` are each implemented twice for `MicrophoneFeed`. The first set appears at lines 768–791 and the second set at lines 950–973 (added by this PR). Rust's orphan/coherence rules forbid conflicting trait implementations for the same type, so this will produce `error[E0119]` and prevent the crate from building at all.
How can I resolve this? If you propose a fix, please make it concise.| import { open } from "@raycast/api"; | ||
|
|
||
| export default async function Command() { | ||
| await open("cap://start-recording"); | ||
| } |
There was a problem hiding this comment.
No user feedback when Cap is not running
All nine Raycast commands simply fire open() and return immediately. If the Cap app is not installed or is not running to handle the cap:// deep link, the command completes silently with no indication to the user that the action failed. Consider wrapping in a try/catch and using showHUD or showToast to surface an error — e.g.:
import { open, showHUD } from "@raycast/api";
export default async function Command() {
try {
await open("cap://start-recording");
await showHUD("Starting recording…");
} catch {
await showHUD("Failed to open Cap");
}
}This applies to all nine command files.
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/raycast/src/start-recording.tsx
Line: 1-5
Comment:
**No user feedback when Cap is not running**
All nine Raycast commands simply fire `open()` and return immediately. If the Cap app is not installed or is not running to handle the `cap://` deep link, the command completes silently with no indication to the user that the action failed. Consider wrapping in a try/catch and using `showHUD` or `showToast` to surface an error — e.g.:
```ts
import { open, showHUD } from "@raycast/api";
export default async function Command() {
try {
await open("cap://start-recording");
await showHUD("Starting recording…");
} catch {
await showHUD("Failed to open Cap");
}
}
```
This applies to all nine command files.
How can I resolve this? If you propose a fix, please make it concise.|
/claim #1540 |
- Remove duplicate Message implementations in microphone.rs. - Fix unused variable warning in deeplink_actions.rs test. - Add HUD feedback and error handling to all Raycast commands.
Description
This PR implements comprehensive deep link support and a dedicated Raycast extension to allow external control of the Cap recorder.
Key Features:
Testing:
/claim #bounty
Greptile Summary
This PR adds a Raycast extension and expands deep link handling so Cap can be controlled externally via
cap://URLs, adding start/stop/pause/resume/mute/screenshot actions backed by new Rust actor messages and desktop notifications.Message<Mute>,Message<Unmute>, andMessage<ToggleMute>are each implemented twice forMicrophoneFeedinmicrophone.rs(lines 768–791 and 950–973). Rust will reject this witherror[E0119], so the crate won't build until the duplicate impls are removed.Confidence Score: 4/5
Not safe to merge until the duplicate Message trait implementations in microphone.rs are removed — they will prevent the crate from compiling.
A single P0 finding (duplicate trait impls causing a hard compile error) blocks merge. Once removed the rest of the implementation is straightforward and the logic is sound.
crates/recording/src/feeds/microphone.rs — duplicate Message<Mute/Unmute/ToggleMute> implementations at lines 950–973 must be deleted.
Important Files Changed
Sequence Diagram
sequenceDiagram participant R as Raycast Extension participant OS as macOS URL Dispatcher participant T as Tauri deep-link plugin participant H as deeplink_actions::handle() participant A as App / Recording State participant M as MicrophoneFeed Actor participant N as Desktop Notification R->>OS: open("cap://mute-recording") OS->>T: cap:// URL event T->>H: handle(urls) H->>H: parse URL host → DeepLinkAction H->>A: acquire read lock on ArcLock<App> A-->>H: app_state H->>M: tell(Mute) / ask(ToggleMute) M-->>H: () / bool H->>N: emit NewNotification N-->>R: (system notification shown to user)Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "feat: add Raycast extension and deep lin..." | Re-trigger Greptile