Avoid false inserted history without macOS accessibility
Before posting Cmd+V on macOS, check the current Accessibility trust state. If permission has been revoked, keep the transcript on the clipboard and reuse the existing CopiedFallback path instead of recording a successful insertion. Constraint: Keep issue #62 fix minimal and avoid adding unreliable target-control paste verification Rejected: AX focused-value readback with timeout | broader and brittle across apps/web editors Confidence: medium Scope-risk: narrow Tested: cargo check --manifest-path openless-all/app/src-tauri/Cargo.toml Tested: git diff --check Not-tested: Live macOS Accessibility revoke flow on this host
This commit is contained in:
1 parent
9b2f65fe71
commit
3282e1e5d9
1 file changed
+6
@@ -58,6 +58,12 @@ fn copy_to_clipboard(text: &str) -> bool {
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
fn simulate_paste() -> Result<(), String> {
|
||||
if !matches!(
|
||||
crate::permissions::check_accessibility(),
|
||||
crate::permissions::PermissionStatus::Granted
|
||||
) {
|
||||
return Err("accessibility permission is not granted".into());
|
||||
}
|
||||
macos::post_cmd_v()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user