feat(desktop): extend deeplinks + add Raycast extension scaffold - #1633
feat(desktop): extend deeplinks + add Raycast extension scaffold#1633sungdark wants to merge 11 commits into
Conversation
| } | ||
|
|
||
| export async function fireSimpleAction(action: string) { | ||
| await dispatchAction({ type: action }); |
There was a problem hiding this comment.
DeepLinkAction uses Serde's default external tagging, so unit variants need to be JSON strings (e.g. "pause_recording"), not { type: "pause_recording" }.
| await dispatchAction({ type: action }); | |
| await dispatchAction(action); |
| async function onSubmit(values: Values) { | ||
| const captureMode = | ||
| values.captureType === "screen" | ||
| ? { screen: values.captureName } | ||
| : { window: values.captureName }; |
There was a problem hiding this comment.
If captureName is empty, this will dispatch an action that the desktop app can't resolve (and the user gets a pretty opaque failure). Consider validating before dispatch.
| async function onSubmit(values: Values) { | |
| const captureMode = | |
| values.captureType === "screen" | |
| ? { screen: values.captureName } | |
| : { window: values.captureName }; | |
| async function onSubmit(values: Values) { | |
| const captureName = values.captureName.trim(); | |
| if (!captureName) { | |
| await showHUD("Cap: capture name required"); | |
| return; | |
| } | |
| const captureMode = | |
| values.captureType === "screen" ? { screen: captureName } : { window: captureName }; |
| export async function fireSimpleAction(action: string) { | ||
| await dispatchAction({ type: action }); | ||
| await showHUD(`Cap: ${action}`); |
There was a problem hiding this comment.
Serde deserializes unit enum variants from plain JSON strings, not objects. { type: action } should be just action
| export async function fireSimpleAction(action: string) { | |
| await dispatchAction({ type: action }); | |
| await showHUD(`Cap: ${action}`); | |
| export async function fireSimpleAction(action: string) { | |
| await dispatchAction(action); | |
| await showHUD(`Cap: ${action}`); | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/raycast/src/lib/cap.ts
Line: 13-15
Comment:
Serde deserializes unit enum variants from plain JSON strings, not objects. `{ type: action }` should be just `action`
```suggestion
export async function fireSimpleAction(action: string) {
await dispatchAction(action);
await showHUD(`Cap: ${action}`);
}
```
How can I resolve this? If you propose a fix, please make it concise.|
We are closing the deeplinks and Raycast bounty (#1540) without awarding it, and closing the pull requests opened against it. The full reasoning is on that issue: the remaining actions it asked for are deliberately limited to debug builds because deeplinks are a remote control surface any web page can invoke, and widening that in production is a security decision we do not want to take through a bounty. This is not a reflection on your work. Leaving it unreviewed for this long is our failure, and we are sorry for the wasted effort. If you want to contribute again, the open bug reports are the most useful place and we will review promptly. |
Summary
Deeplink actions added
Closes #1540
Greptile Summary
Extended desktop deeplink actions to support pause/resume/toggle recording and device switching (microphone/camera), then added a Raycast extension scaffold to control Cap via these deeplinks.
DeepLinkActionvariants in Rust:PauseRecording,ResumeRecording,TogglePauseRecording,SwitchMicrophone,SwitchCameraapps/raycastwith 7 commands that dispatch Cap deeplinksfireSimpleActionincap.tsincorrectly wraps unit variants in{ type: action }instead of passing the plain string, which will cause deserialization failures for pause/resume/stop/toggle commandsConfidence Score: 2/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant Raycast participant cap.ts participant Desktop App participant Rust Handler User->>Raycast: Trigger command Raycast->>cap.ts: fireSimpleAction("pause_recording") cap.ts->>cap.ts: JSON.stringify({ type: "pause_recording" }) cap.ts->>Desktop App: cap-desktop://action?value=... Desktop App->>Rust Handler: Parse deeplink Rust Handler->>Rust Handler: serde_json::from_str<DeepLinkAction> Note over Rust Handler: FAILS - expects "pause_recording"<br/>but receives {"type":"pause_recording"} Rust Handler-->>User: Error: Failed to parse deeplink Note over cap.ts,Rust Handler: FIX: Pass action string directly,<br/>not wrapped in objectLast reviewed commit: a595e0e
(2/5) Greptile learns from your feedback when you react with thumbs up/down!