Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 40 additions & 2 deletions apps/desktop/src-tauri/src/deeplink_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ use std::path::{Path, PathBuf};
use tauri::{AppHandle, Manager, Url};
use tracing::trace;

use crate::{App, ArcLock, recording::StartRecordingInputs, windows::ShowCapWindow};
use crate::{
App, ArcLock,
recording::{
StartRecordingInputs, pause_recording, resume_recording,
toggle_pause, take_screenshot
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Function name mismatch — unresolved import and call site

toggle_pause does not exist in crate::recording. The actual function is named toggle_pause_recording (see recording.rs:1539). This causes two compile errors: the import on this line, and the call crate::recording::toggle_pause(...) at the TogglePause match arm. Any deep-link TogglePause action is therefore impossible to dispatch.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/deeplink_actions.rs
Line: 13

Comment:
**Function name mismatch — unresolved import and call site**

`toggle_pause` does not exist in `crate::recording`. The actual function is named `toggle_pause_recording` (see `recording.rs:1539`). This causes two compile errors: the import on this line, and the call `crate::recording::toggle_pause(...)` at the `TogglePause` match arm. Any deep-link `TogglePause` action is therefore impossible to dispatch.

How can I resolve this? If you propose a fix, please make it concise.

},
Comment on lines +11 to +14
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unused imports

pause_recording, resume_recording, toggle_pause, and take_screenshot are imported here but every call site uses the fully-qualified crate::recording:: path instead. These imports are dead — the compiler will emit unused import warnings, and toggle_pause will additionally cause an unresolved-import error as noted above.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/deeplink_actions.rs
Line: 11-14

Comment:
**Unused imports**

`pause_recording`, `resume_recording`, `toggle_pause`, and `take_screenshot` are imported here but every call site uses the fully-qualified `crate::recording::` path instead. These imports are dead — the compiler will emit `unused import` warnings, and `toggle_pause` will additionally cause an unresolved-import error as noted above.

How can I resolve this? If you propose a fix, please make it concise.

windows::ShowCapWindow
};
Comment on lines +9 to +16
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This use crate::{ ... } block introduces several unused imports (and toggle_pause doesn’t exist in apps/desktop/src-tauri/src/recording.rs — it’s toggle_pause_recording). With -D warnings this will fail CI.

Suggested change
use crate::{
App, ArcLock,
recording::{
StartRecordingInputs, pause_recording, resume_recording,
toggle_pause, take_screenshot
},
windows::ShowCapWindow
};
use crate::{App, ArcLock, recording::StartRecordingInputs, windows::ShowCapWindow};


#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
Expand All @@ -26,6 +33,16 @@ pub enum DeepLinkAction {
mode: RecordingMode,
},
StopRecording,
PauseRecording,
ResumeRecording,
TogglePause,
TakeScreenshot,
SwitchMicrophone {
mic_label: Option<String>,
},
SwitchCamera {
camera: Option<DeviceOrModelID>,
},
OpenEditor {
project_path: PathBuf,
},
Expand All @@ -49,7 +66,6 @@ pub fn handle(app_handle: &AppHandle, urls: Vec<Url>) {
ActionParseFromUrlError::Invalid => {
eprintln!("Invalid deep link format \"{}\"", &url)
}
// Likely login action, not handled here.
ActionParseFromUrlError::NotAction => {}
})
.ok()
Expand Down Expand Up @@ -147,6 +163,28 @@ impl DeepLinkAction {
DeepLinkAction::StopRecording => {
crate::recording::stop_recording(app.clone(), app.state()).await
}
DeepLinkAction::PauseRecording => {
crate::recording::pause_recording(app.clone(), app.state()).await
}
DeepLinkAction::ResumeRecording => {
crate::recording::resume_recording(app.clone(), app.state()).await
}
DeepLinkAction::TogglePause => {
crate::recording::toggle_pause_recording(app.clone(), app.state()).await
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MEDIUM] Deep links expose screenshot and hardware controls without authentication

Deep links can trigger screenshots and camera/mic switching with only a focus check.

Fix: Remove these deep-link actions or gate them with user confirmation and a per-session nonce.

}
DeepLinkAction::TakeScreenshot => {
let window = app.get_window("main").unwrap();
if !window.is_focused().unwrap_or(false) { return; }
Comment on lines +176 to +177
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor thing in the focus gate: return; won’t type-check inside execute (it needs to return Result<(), String>), and get_window(...).unwrap() can panic if the window isn’t available.

Suggested change
let window = app.get_window("main").unwrap();
if !window.is_focused().unwrap_or(false) { return; }
let Some(window) = app.get_window("main") else {
return Ok(());
};
if !window.is_focused().unwrap_or(false) {
return Ok(());
}

crate::recording::take_screenshot(app.clone(), app.state()).await
}
Comment on lines +175 to +179
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Wrong argument types passed to take_screenshot

recording::take_screenshot is declared as async fn take_screenshot(app: AppHandle, target: ScreenCaptureTarget) -> Result<PathBuf, String>, but it is called here with (app.clone(), app.state()) — passing a MutableState<'_, App> where a ScreenCaptureTarget is required. This is a type mismatch that will prevent compilation, and even if it compiled, no capture target would be supplied.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/deeplink_actions.rs
Line: 175-177

Comment:
**Wrong argument types passed to `take_screenshot`**

`recording::take_screenshot` is declared as `async fn take_screenshot(app: AppHandle, target: ScreenCaptureTarget) -> Result<PathBuf, String>`, but it is called here with `(app.clone(), app.state())` — passing a `MutableState<'_, App>` where a `ScreenCaptureTarget` is required. This is a type mismatch that will prevent compilation, and even if it compiled, no capture target would be supplied.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +175 to +179
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As written this won’t compile: take_screenshot takes (AppHandle, ScreenCaptureTarget) and returns a PathBuf.

One low-friction option is to default to the first display and ignore the returned path:

Suggested change
DeepLinkAction::TakeScreenshot => {
crate::recording::take_screenshot(app.clone(), app.state()).await
}
DeepLinkAction::TakeScreenshot => {
let (display, _) = cap_recording::screen_capture::list_displays()
.into_iter()
.next()
.ok_or("No displays found".to_string())?;
crate::recording::take_screenshot(
app.clone(),
ScreenCaptureTarget::Display { id: display.id },
)
.await
.map(|_| ())
}

DeepLinkAction::SwitchMicrophone { mic_label } => {
let state = app.state::<ArcLock<App>>();
crate::set_mic_input(state, mic_label).await
}
DeepLinkAction::SwitchCamera { camera } => {
let state = app.state::<ArcLock<App>>();
crate::set_camera_input(app.clone(), state, camera, None).await
}
DeepLinkAction::OpenEditor { project_path } => {
crate::open_project_from_path(Path::new(&project_path), app.clone())
}
Expand Down
Empty file.
1 change: 1 addition & 0 deletions apps/desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ mod flags;
mod frame_ws;
mod general_settings;
mod hotkeys;
mod hardware_handlers;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Missing module file — build will not compile

mod hardware_handlers; declares a module but neither src/hardware_handlers.rs nor src/hardware_handlers/mod.rs exists in the repository. Rust will fail to compile the crate with error[E0583]: file not found for module 'hardware_handlers'. The PR description references this module as containing actor-based camera/microphone logic, but the actual file was never committed.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/lib.rs
Line: 19

Comment:
**Missing module file — build will not compile**

`mod hardware_handlers;` declares a module but neither `src/hardware_handlers.rs` nor `src/hardware_handlers/mod.rs` exists in the repository. Rust will fail to compile the crate with `error[E0583]: file not found for module 'hardware_handlers'`. The PR description references this module as containing actor-based camera/microphone logic, but the actual file was never committed.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail to compile unless apps/desktop/src-tauri/src/hardware_handlers.rs or apps/desktop/src-tauri/src/hardware_handlers/mod.rs is included in the PR (it doesn’t seem to exist on the head SHA).

mod http_client;
mod import;
mod logging;
Expand Down