Conversation
The app was not recognizing when accessibility permissions were granted because it checked immediately after opening System Settings, before the user had a chance to grant permission. Now the app automatically detects when it becomes active (e.g., user returning from System Settings) and re-checks permissions at that time, properly updating the UI. Changes: - Added NSApplication.didBecomeActiveNotification observer to monitor app activation - Re-check permissions automatically when app becomes active - Removed premature permission check in requestAccessibilityPermission() - Added proper cleanup in deinit to remove observer Fixes: Permission banner now disappears and clicking is enabled after granting permission
This commit addresses two major issues: 1. **Refactor build system to use separate SPM targets** - Created separate ClickIt and ClickItLite targets in Package.swift - Each target excludes the other's entry point file - Both ClickItApp.swift and ClickItLiteApp.swift now have @main permanently enabled - Updated build_app_unified.sh to build the correct SPM target - No more file modification during builds - git working directory stays clean - Updated BUILD_VERSIONS_GUIDE.md to reflect new approach 2. **Fix ESC emergency stop and add SPACEBAR support** - Added local event monitor in addition to global monitor - Global monitor catches events when app is inactive - Local monitor catches events when app is active - Added SPACEBAR as secondary emergency stop key - Updated UI to show "Press ESC or SPACEBAR to emergency stop" Benefits: - Source files no longer modified during builds (fixes git status issues) - Emergency stop now works reliably in all scenarios - Users have two keys for emergency stop (ESC and SPACEBAR) - Cleaner separation between Pro and Lite versions Files changed: - Package.swift: Added ClickItLite target with proper exclusions - build_app_unified.sh: Updated to build correct SPM target - Sources/ClickIt/Lite/ClickItLiteApp.swift: Uncommented @main - Sources/ClickIt/Lite/SimpleHotkeyManager.swift: Added local monitor and SPACEBAR support - Sources/ClickIt/Lite/SimplifiedMainView.swift: Updated UI text - BUILD_VERSIONS_GUIDE.md: Updated documentation
SPM expects targets to either be in Sources/TargetName/ or have an explicit path specified. Since both ClickIt and ClickItLite share Sources/ClickIt/, we need to specify path: "Sources/ClickIt" for both targets. This fixes the build error: 'Source files for target ClickItLite should be located under Sources/ClickItLite'
The previous approach had both targets using the same path which caused overlapping sources. Now: - ClickIt target uses Sources/ClickIt and excludes the entire Lite directory - ClickItLite target uses Sources/ClickIt/Lite exclusively This eliminates the overlapping sources error while keeping files organized.
Summary of ChangesHello @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 introduces a significant refactoring of the application's build process by migrating to distinct Swift Package Manager targets for its Pro and Lite versions, thereby simplifying build configurations and maintaining a cleaner codebase. Concurrently, it addresses a critical bug preventing accessibility permissions from updating reliably after user interaction with system settings. Additionally, the user experience is enhanced with the introduction of the SPACEBAR as an alternative emergency stop hotkey. Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a significant improvement to the build system by using separate SPM targets for the Pro and Lite versions, which makes the build process cleaner and more reliable. The fix for the accessibility permission not updating is well-implemented by observing app activation. The addition of the spacebar as an emergency stop key is also a nice usability enhancement. The code quality is high, and the changes are well-structured. I have one suggestion regarding test coverage for the new ClickItLite target to ensure its long-term stability.
| // ClickIt Lite - Simplified version | ||
| .executableTarget( | ||
| name: "ClickItLite", | ||
| dependencies: [], | ||
| path: "Sources/ClickIt/Lite", | ||
| resources: [] | ||
| ), |
There was a problem hiding this comment.
With the addition of the ClickItLite target, it's important to also add a corresponding test target to ensure its functionality is covered by tests. Currently, only the ClickIt (Pro) target has a test target.
To maintain code quality and prevent regressions in the Lite version, please consider adding a new test target for ClickItLite. For example:
.testTarget(
name: "ClickItLiteTests",
dependencies: ["ClickItLite"],
path: "Tests/ClickItLiteTests" // You may need to create this directory
)
No description provided.