Skip to content

feat: Extend deeplinks support + Raycast extension#1

Open
tedy69 wants to merge 29 commits intomainfrom
feat/deeplinks-raycast-extension
Open

feat: Extend deeplinks support + Raycast extension#1
tedy69 wants to merge 29 commits intomainfrom
feat/deeplinks-raycast-extension

Conversation

@tedy69
Copy link
Copy Markdown
Owner

@tedy69 tedy69 commented Mar 4, 2026

/claim CapSoftware#1540

Summary

Extends the existing deeplink infrastructure in deeplink_actions.rs with new actions and adds a complete Raycast extension for controlling Cap.

Deeplink Changes

Added 10 new DeepLinkAction variants to apps/desktop/src-tauri/src/deeplink_actions.rs:

Action Description
PauseRecording Pause the current recording
ResumeRecording Resume a paused recording
TogglePauseRecording Toggle pause/resume state
RestartRecording Restart the current recording
TakeScreenshot Take a screenshot (optional capture_mode, defaults to primary display)
ListCameras List available cameras (JSON copied to clipboard)
SetCamera Switch camera input
ListMicrophones List available microphones (JSON copied to clipboard)
SetMicrophone Switch microphone input
ListDisplays / ListWindows List available capture targets (JSON copied to clipboard)
  • capture_mode is optional in both StartRecording and TakeScreenshot — when omitted, falls back to the primary display
  • List* actions write JSON results to the system clipboard so external callers can read the data
  • Extracted resolve_capture_target helper to DRY up target resolution logic

Deeplink URL Format

Unit actions: cap-desktop://action?value="stop_recording"
Parameterized: cap-desktop://action?value={"take_screenshot":{"capture_mode":null}}

Raycast Extension

Created apps/raycast/ with 9 commands:

  • Start Instant Recording / Start Studio Recording
  • Stop / Pause / Resume / Toggle Pause / Restart Recording
  • Take Screenshot
  • Open Settings

All commands use the cap-desktop:// deeplink scheme to communicate with the desktop app. Error handling ensures failure toasts are shown only on actual errors, not unconditionally.

Closes CapSoftware#1540

tedy69 and others added 29 commits March 4, 2026 17:25
… existing deeplink infrastructure with new actions:\n- PauseRecording, ResumeRecording, TogglePauseRecording\n- RestartRecording\n- TakeScreenshot (with optional capture mode)\n- ListCameras, SetCamera\n- ListMicrophones, SetMicrophone\n- ListDisplays, ListWindows\n\nAdds a Raycast extension (apps/raycast) with commands:\n- Start Instant Recording / Start Studio Recording\n- Stop / Pause / Resume / Toggle Pause / Restart Recording\n- Take Screenshot\n- Open Settings\n\nAll commands communicate with Cap via the cap-desktop:// deeplink scheme.\n\nCloses CapSoftware#1540"
- Add start_current_recording deeplink action (uses saved app settings)
- Fix URL parsing: use host_str() instead of domain() for reliability
- Add comprehensive unit tests for deeplink parsing (15 tests)
- Add DEEPLINKS.md documentation for all available actions
- Move Raycast extension from apps/raycast to extensions/raycast
- Switch UX from Toast to HUD + closeMainWindow (cleaner for no-view)
- Add start-current-recording Raycast command
- Add extensions/* to pnpm-workspace.yaml
- Use shared runDeepLinkAction utility in lib/deeplink.ts
- Case-insensitive display/window name matching (eq_ignore_ascii_case)
- Camera permission check before listing cameras
- Display::list() fallback instead of Display::primary() for headless safety
- Log settings read errors with inspect_err before fallback
- Move closeMainWindow() inside try/catch block
- Fix DEEPLINKS.md: URL-encode unit example, fix nested shell quoting
- Use start_current_recording for instant/studio commands (respects saved settings)
- Soften HUD messages to 'dispatched' (deeplinks are fire-and-forget)
- Update command descriptions to clarify they use saved settings
Aligns implementation with docs — capture_mode: null defaults to the
primary display, so use the explicit Display::primary() API.
Co-authored-by: tembo[bot] <208362400+tembo[bot]@users.noreply.github.com>
Co-authored-by: tembo[bot] <208362400+tembo[bot]@users.noreply.github.com>
Co-authored-by: tembo[bot] <208362400+tembo[bot]@users.noreply.github.com>
Co-authored-by: tembo[bot] <208362400+tembo[bot]@users.noreply.github.com>
- Add screen recording, camera, and microphone permission checks to
  StartRecording and StartCurrentRecording, consistent with TakeScreenshot,
  SetCamera, and SetMicrophone
- Add camera permission guard to SetCamera for consistency with ListCameras
  and SetMicrophone
- Fix error message in deeplink.ts: macOS auto-launches installed apps so
  "running" is not required — only "installed"
- Clarify command descriptions in package.json to distinguish instant/studio
  (mode override, saved device settings) from start-current (all saved settings)
- Fix quote style inconsistency in open-settings.ts
- Improve toggle-pause HUD message wording
…disable

SetCamera { id: None } and SetMicrophone { label: None } disable the device
and require no hardware access. Blocking them behind a permission check
prevents users from turning off a device overlay if permission was revoked
after a recording session. Mirror the conditional pattern already used in
StartRecording.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bounty: Deeplinks support + Raycast Extension

1 participant