Repository navigation
Conversation
|
@cocvn157 is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
| } | ||
| None => None, | ||
| }; | ||
| crate::hotkeys::start_default_recording(mode, cx); |
There was a problem hiding this comment.
StartDefaultRecording waits for target lookup and microphone checks before creating a RecordingStartPermit. If StopRecording arrives during that wait, there is no permit to cancel and the session stays idle. The waiting task can then finish and start recording after the user asked to stop.
Create a cancellable start request before the first wait, and check it before showing prompts or starting capture.
Knowledge Base Used:
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/deeplink.rs
Line: 474
Comment:
**Recording starts after Stop**
`StartDefaultRecording` waits for target lookup and microphone checks before creating a `RecordingStartPermit`. If `StopRecording` arrives during that wait, there is no permit to cancel and the session stays idle. The waiting task can then finish and start recording after the user asked to stop.
Create a cancellable start request before the first wait, and check it before showing prompts or starting capture.
**Knowledge Base Used:**
- [GPUI desktop client](https://app.greptile.com/-/switch-tenant?tenant=cap&next=%2Fcustom-context%2Fknowledge-base%2Fcapsoftware%2Fcap%2F-%2Fdocs%2Fgpui-desktop-client.md)
- [Desktop application and recording experience](https://app.greptile.com/-/switch-tenant?tenant=cap&next=%2Fcustom-context%2Fknowledge-base%2Fcapsoftware%2Fcap%2F-%2Fdocs%2Fdesktop-application.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| const normalized = candidate.replace(/\/+$/, ""); | ||
| return normalized.endsWith("/dashboard") | ||
| ? normalized | ||
| : `${normalized}/dashboard`; |
There was a problem hiding this comment.
Dashboard URL keeps pasted paths
resolveDashboardUrl appends /dashboard to the raw preference, including any query or fragment. For example, https://host/dashboard?x=1 becomes https://host/dashboard?x=1/dashboard. Pasted paths can also send users to the wrong page.
Desktop settings already reduce pasted URLs to their HTTP or HTTPS origin. Parse the preference the same way before adding the dashboard path.
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/raycast/src/utils.ts
Line: 93-96
Comment:
**Dashboard URL keeps pasted paths**
`resolveDashboardUrl` appends `/dashboard` to the raw preference, including any query or fragment. For example, `https://host/dashboard?x=1` becomes `https://host/dashboard?x=1/dashboard`. Pasted paths can also send users to the wrong page.
Desktop settings already reduce pasted URLs to their HTTP or HTTPS origin. Parse the preference the same way before adding the dashboard path.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| assert_eq!( | ||
| DeepLinkAction::try_from(&url), | ||
| Ok(DeepLinkAction::StartRecording { | ||
| capture_mode: CaptureMode::Screen(screen_alias.to_string()), |
There was a problem hiding this comment.
parses_start_recording_action_url_default_and_cursor_screen only checks that alias strings parse. CaptureMode::Screen(String) already accepts arbitrary strings, so this test would pass without the new alias-selection code. It cannot catch a change that records the wrong display.
Extract display selection into a testable helper and check primary selection, cursor selection, and the cursor fallback.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/deeplink.rs
Line: 903-906
Comment:
**Tests miss display selection**
`parses_start_recording_action_url_default_and_cursor_screen` only checks that alias strings parse. `CaptureMode::Screen(String)` already accepts arbitrary strings, so this test would pass without the new alias-selection code. It cannot catch a change that records the wrong display.
Extract display selection into a testable helper and check primary selection, cursor selection, and the cursor fallback.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.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!
Closes #28
/claim #28
Summary
Adds the official Raycast extension for Cap (
extensions/raycast) along with native GPUI deep-link support (apps/desktop-gpui/src/deeplink.rsandapps/desktop-gpui/src/hotkeys.rs) that preserves the user's saved recording defaults.Why
StartDefaultRecordingis needed inapps/desktop-gpuiIssue #28 specifies:
In
apps/desktop-gpui/src/deeplink.rs, the existingDeepLinkAction::StartRecordingarm explicitly overwritesFeeds::global(cx)(feeds.set_camera(selection, cx); feeds.set_microphone(mic_label.clone(), cx)). Sendingcamera: nullandmic_label: nullfrom an external launcher clears the user's selected camera and microphone in Cap and forces a hardcoded recording mode and display.This PR adds:
DeepLinkAction::StartDefaultRecording { mode: Option<RecordingMode> }(apps/desktop-gpui/src/deeplink.rs&hotkeys.rs):hotkeys::start_default_recording(mode, cx)(start_from_hotkey), which preserves the user's selected camera, microphone, and system audio inMainWindow/Feeds::global(cx), honors theconfirmBeforeRecordingWithoutMicrophonesafety check, and resolves the capture target in priority order:view.armed_target())recording_settings.target(verified live viatarget_is_live)scap_targets::Display::get_containing_cursor()), falling back toscap_targets::Display::primary()Mode::from_store()) whenmodeis omitted, while allowing an optional"instant"or"studio"override from Raycast command arguments."default","primary", and"cursor"display aliases toCaptureMode::ScreeninDeepLinkAction::StartRecordingfor direct screen-targeted deep links.extensions/raycast):start-recording: Starts recording using the user's saved Cap defaults via{"start_default_recording":{}}(with an optional dropdown argument to override Instant or Studio mode).stop-recording: Stops the active Cap recording via"stop_recording"(in Instant mode, Cap automatically copies the shareable video link to the clipboard).open-dashboard: Readsgeneral_settings.serverUrlfrom Cap's sharedso.cap.desktop/storefile (with an optional Raycast extension preference override andhttps://cap.so/dashboardfallback) so both Cap Cloud and self-hosted Cap instances open the right dashboard.open-settings: Opens the Cap desktop settings window via{"open_settings":{"page":null}}.Verification
parses_start_default_recording_action_urlsandparses_start_recording_action_url_default_and_cursor_screeninapps/desktop-gpui/src/deeplink.rs.AGENTS.md.Fix pending-start cancellation before merging so Stop cannot be followed by an unexpected recording.
Findings
Fix with agent prompt
Summary
Adds four Raycast commands and a desktop action that starts recording with the user's saved inputs.
Reviews (1) · Last reviewed commit: "feat(raycast): add official Cap Raycast ..." · Reviewed by Greptile