🧹 Refactor overly long hotkey function into platform-specific helpers - #40
🧹 Refactor overly long hotkey function into platform-specific helpers#40undivisible wants to merge 4 commits into
hotkey function into platform-specific helpers#40Conversation
Moves the inline `#[cfg(windows)]` and `#[cfg(target_os = "macos")]` code blocks from the `hotkey` function into separate helper functions (`win_hotkey` and `mac_hotkey`) to improve readability and maintainability. Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
…-listener` - Fixes the `clippy::chunks-exact-to-as-chunks` warning in `src/cdp.rs` by correctly updating calls to `as_chunks().0.iter()`. (Note: CI handles nightly/stable appropriately). - Updates `event-listener` to fix vulnerability RUSTSEC-2026-0221. Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
…-listener` - Fixes the `clippy::chunks-exact-to-as-chunks` warning in `src/cdp.rs` by suppressing it on stable. (Note: using `.as_chunks` is an unstable nightly API and breaks stable compilation). - Updates `event-listener` to fix vulnerability RUSTSEC-2026-0221. Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
🎯 What: The
hotkeyfunction insrc/lib.rswas overly long and complex, containing inline logic for handling hotkeys on Windows and macOS. This change extracts that platform-specific code into separatewin_hotkeyandmac_hotkeyfunctions.💡 Why: Breaking down the 98-line
hotkeymethod into modular functions significantly improves code maintainability and readability, adhering to the codebase's pattern of using prefixed helper functions for OS-specific behavior.✅ Verification: Verified by running
cargo check, formatting viacargo fmt, linting viacargo clippy, and running the test suites (cargo test --libandcargo test --test conformancein an isolated directory) with no failures or regressions.✨ Result: The
hotkeyfunction is now concise and readable, simply delegating calls to the appropriate platform-specific logic helpers.PR created automatically by Jules for task 8826274499004670539 started by @undivisible
Note
Low Risk
Mechanical extraction with equivalent logic; low risk aside from normal regression risk for input simulation on Windows and macOS.
Overview
Refactors
NativeRuntime::hotkeyby moving Windows and macOS keyboard shortcut simulation out of the trait method into dedicated helpers, matching how Linux already delegates tolinux_input::native_hotkey.win_hotkeyusesSendInputwith modifier down/up sequencing;mac_hotkeykeeps the same accessibility check, modifier flag mapping, andmac_post_keycall.hotkeynow only dispatches per OS with no intended behavior change.tests/cli.rs fixes indentation in the
runhelper’s stdin write block.Reviewed by Cursor Bugbot for commit 62d59a4. Configure here.