Skip to content

Conversation

@jsonify
Copy link
Owner

@jsonify jsonify commented Jul 21, 2025

Enhance the robustness of API interactions by implementing better error handling mechanisms, ensuring clearer feedback for users and reducing potential crashes.

Enhance the robustness of API interactions by implementing better error handling mechanisms, ensuring clearer feedback for users and reducing potential crashes.
@jsonify jsonify merged commit b8ef403 into main Jul 21, 2025
2 of 6 checks passed
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.

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 primarily focuses on two distinct areas: enhancing application capabilities by adding a new macOS entitlement and standardizing SwiftUI preview definitions across various UI components and views. It's important to note that the changes observed in the code do not align with the pull request's stated intent of 'Improve error handling in API requests'; instead, they address application permissions and development-time preview configurations.

Highlights

  • Application Entitlements: Added the com.apple.security.automation.apple-events entitlement to ClickIt.entitlements, which is essential for enabling Accessibility API access within the application.
  • SwiftUI Preview Standardization: Refactored SwiftUI preview code across numerous UI components and views, migrating from the #Preview macro to the PreviewProvider struct for consistent preview generation.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 or fill out our survey to provide feedback.

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.

@jsonify jsonify deleted the feature/fix-permission-macmini branch July 21, 2025 22:47
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 refactors SwiftUI previews from the modern #Preview macro to the older PreviewProvider struct syntax across multiple files and adds the com.apple.security.automation.apple-events entitlement. The pull request title and description state the goal is to "Improve error handling in API requests", but the changes do not seem to be related to this. It would be beneficial to update the title and description to reflect the actual work done, which appears to be a project-wide refactoring of SwiftUI previews.

Comment on lines +10 to +12
<!-- Essential entitlement for Accessibility API access -->
<key>com.apple.security.automation.apple-events</key>
<true/>
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The comment "Essential entitlement for Accessibility API access" is imprecise. This entitlement grants permission to send Apple Events to control other applications. While related to accessibility, it's distinct from the main Accessibility permission. For clarity, describe its specific purpose.

	<!-- Allows the app to send Apple Events to control other applications -->
	<key>com.apple.security.automation.apple-events</key>
	<true/>

Comment on lines +103 to 116
struct ActiveTimerView_Previews: PreviewProvider {
static var previews: some View {
ActiveTimerView(viewModel: {
let vm = ClickItViewModel()
vm.isCountingDown = true
vm.remainingTime = 123 // 2:03
vm.timerDurationMinutes = 2
vm.timerDurationSeconds = 30
return vm
}())
.frame(width: 350)
.padding()
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This change replaces the modern #Preview macro with the older PreviewProvider struct. Given that AppConstants.minimumOSVersion is set to "macOS 15.0", the #Preview macro is fully supported. Unless there's a specific reason for this change, revert to the #Preview macro for better code clarity.

#Preview {
    ActiveTimerView(viewModel: {
        let vm = ClickItViewModel()
        vm.isCountingDown = true
        vm.remainingTime = 123 // 2:03
        vm.timerDurationMinutes = 2
        vm.timerDurationSeconds = 30
        return vm
    }())
    .frame(width: 350)
    .padding()
}

Comment on lines +49 to 55
struct AdvancedSettingsButton_Previews: PreviewProvider {
static var previews: some View {
AdvancedSettingsButton(viewModel: ClickItViewModel())
.frame(width: 400)
.padding()
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This change replaces the modern #Preview macro with the older PreviewProvider struct. Given that AppConstants.minimumOSVersion is set to "macOS 15.0", the #Preview macro is fully supported. Unless there's a specific reason for this change, revert to the #Preview macro for better code clarity.

#Preview {
    AdvancedSettingsButton(viewModel: ClickItViewModel())
        .frame(width: 400)
        .padding()
}

Comment on lines +227 to 234
struct ClickPointSelector_Previews: PreviewProvider {
static var previews: some View {
ClickPointSelector { point in
print("Selected point: \(point)")
}
.frame(width: 400, height: 500)
}
.frame(width: 400, height: 500)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This change replaces the modern #Preview macro with the older PreviewProvider struct. Given that AppConstants.minimumOSVersion is set to "macOS 15.0", the #Preview macro is fully supported. Unless there's a specific reason for this change, revert to the #Preview macro for better code clarity.

#Preview {
    ClickPointSelector { point in
        print("Selected point: \(point)")
    }
    .frame(width: 400, height: 500)
}

Comment on lines +397 to 403
struct ConfigurationPanel_Previews: PreviewProvider {
static var previews: some View {
ConfigurationPanel(selectedClickPoint: CGPoint(x: 100, y: 100))
.environmentObject(ClickCoordinator.shared)
.frame(width: 400, height: 600)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This change replaces the modern #Preview macro with the older PreviewProvider struct. Given that AppConstants.minimumOSVersion is set to "macOS 15.0", the #Preview macro is fully supported. Unless there's a specific reason for this change, revert to the #Preview macro for better code clarity.

#Preview {
    ConfigurationPanel(selectedClickPoint: CGPoint(x: 100, y: 100))
        .environmentObject(ClickCoordinator.shared)
        .frame(width: 400, height: 600)
}

Comment on lines +109 to 113
struct AdvancedSettingsWindow_Previews: PreviewProvider {
static var previews: some View {
AdvancedSettingsWindow(viewModel: ClickItViewModel())
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This change replaces the modern #Preview macro with the older PreviewProvider struct. Given that AppConstants.minimumOSVersion is set to "macOS 15.0", the #Preview macro is fully supported. Unless there's a specific reason for this change, revert to the #Preview macro for better code clarity.

#Preview {
    AdvancedSettingsWindow(viewModel: ClickItViewModel())
}

Comment on lines +152 to 159
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
.environmentObject(PermissionManager.shared)
.environmentObject(HotkeyManager.shared)
.environmentObject(ClickItViewModel())
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This change replaces the modern #Preview macro with the older PreviewProvider struct. Given that AppConstants.minimumOSVersion is set to "macOS 15.0", the #Preview macro is fully supported. Unless there's a specific reason for this change, revert to the #Preview macro for better code clarity.

#Preview {
    ContentView()
        .environmentObject(PermissionManager.shared)
        .environmentObject(HotkeyManager.shared)
        .environmentObject(ClickItViewModel())
}

Comment on lines +345 to 350
struct PermissionRequestView_Previews: PreviewProvider {
static var previews: some View {
PermissionRequestView()
.environmentObject(PermissionManager.shared)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This change replaces the modern #Preview macro with the older PreviewProvider struct. Given that AppConstants.minimumOSVersion is set to "macOS 15.0", the #Preview macro is fully supported. Unless there's a specific reason for this change, revert to the #Preview macro for better code clarity.

#Preview {
    PermissionRequestView()
        .environmentObject(PermissionManager.shared)
}

Comment on lines +254 to 258
struct PermissionsGateView_Previews: PreviewProvider {
static var previews: some View {
PermissionsGateView()
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This change replaces the modern #Preview macro with the older PreviewProvider struct. Given that AppConstants.minimumOSVersion is set to "macOS 15.0", the #Preview macro is fully supported. Unless there's a specific reason for this change, revert to the #Preview macro for better code clarity.

#Preview {
    PermissionsGateView()
}

Comment on lines +266 to 270
struct WindowDetectionTestView_Previews: PreviewProvider {
static var previews: some View {
WindowDetectionTestView()
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This change replaces the modern #Preview macro with the older PreviewProvider struct. Given that AppConstants.minimumOSVersion is set to "macOS 15.0", the #Preview macro is fully supported. Unless there's a specific reason for this change, revert to the #Preview macro for better code clarity.

#Preview {
    WindowDetectionTestView()
}

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