Skip to content

Conversation

@jsonify
Copy link
Owner

@jsonify jsonify commented Nov 10, 2025

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jsonify, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the ClickIt application by introducing an 'active target mode'. This new functionality allows users to control click automation dynamically, where the application will click at the current mouse cursor's position. It involves comprehensive changes across core logic, event handling, UI, and settings to provide a more interactive and flexible clicking experience.

Highlights

  • Active Target Mode: Introduced a new 'Active Target Mode' feature, allowing the application to perform clicks at the current mouse cursor's position instead of a fixed location. This mode is toggled via a new UI element and managed by mouse event monitoring.
  • Dynamic Click Location: The ClickCoordinator now dynamically determines the click location based on whether 'Active Target Mode' is enabled, using NSEvent.mouseLocation for dynamic targeting.
  • Mouse Event Monitoring: Added global and local mouse click monitoring capabilities to HotkeyManager, including debouncing for click events, to detect user left clicks for starting/stopping automation in active target mode.
  • Custom Cursor Management: A new CursorManager service was added to display a crosshair cursor when 'Active Target Mode' is active and restore the default arrow cursor when it's disabled, enhancing visual feedback for the user.
  • UI Integration and Settings: Integrated the 'Active Target Mode' into ClickSettings with a new isActiveTargetMode property, updated data export/import, and added a dedicated ActiveTargetModeCard to the QuickStartTab for user control and information.
  • Version Update: The application version in Info.plist has been updated from 1.5.3 to 1.5.5, and the settings export version has been bumped from 1.1 to 1.2.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an 'active target mode', allowing clicks to follow the cursor's position. The implementation is solid, adding a CursorManager to handle cursor state, extending HotkeyManager to monitor mouse clicks, and updating the view model and settings to support the new mode. The changes are well-structured and handle aspects like backward compatibility and re-entrancy correctly. I have one suggestion to refactor some duplicated code in the new CursorManager for better maintainability.

Comment on lines +45 to +76
func restoreNormalCursor() {
DispatchQueue.main.async { [weak self] in
guard let self = self else { return }

if self.isTargetCursorActive {
self.isTargetCursorActive = false

// Stop the cursor update timer
self.cursorUpdateTimer?.invalidate()
self.cursorUpdateTimer = nil

// Restore arrow cursor
NSCursor.arrow.set()

self.logger.info("Normal cursor restored")
}
}
}

/// Force restore cursor (useful for cleanup on app termination)
func forceRestoreNormalCursor() {
DispatchQueue.main.async { [weak self] in
guard let self = self else { return }

self.isTargetCursorActive = false
self.cursorUpdateTimer?.invalidate()
self.cursorUpdateTimer = nil
NSCursor.arrow.set()

self.logger.info("Cursor forcefully restored")
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To improve maintainability and reduce code duplication, the common logic for resetting the cursor state in restoreNormalCursor() and forceRestoreNormalCursor() can be extracted into a private helper method. This makes the code cleaner and easier to manage.

    /// Restores the normal system cursor
    func restoreNormalCursor() {
        DispatchQueue.main.async { [weak self] in
            guard let self, self.isTargetCursorActive else { return }

            self.performCursorReset()
            self.logger.info("Normal cursor restored")
        }
    }

    /// Force restore cursor (useful for cleanup on app termination)
    func forceRestoreNormalCursor() {
        DispatchQueue.main.async { [weak self] in
            guard let self else { return }

            self.performCursorReset()
            self.logger.info("Cursor forcefully restored")
        }
    }

    private func performCursorReset() {
        isTargetCursorActive = false
        cursorUpdateTimer?.invalidate()
        cursorUpdateTimer = nil
        NSCursor.arrow.set()
    }

@jsonify jsonify closed this Nov 10, 2025
@jsonify jsonify deleted the feature/adding-active-target-mode branch November 10, 2025 23:44
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.

2 participants