Skip to content

Conversation

@MortenGregersen
Copy link
Owner

This pull request introduces platform-specific code handling by wrapping certain files in #if canImport(WebKit) directives, ensuring that the code is only compiled when the WebKit module is available - some platforms doesn't have the WebKit framework.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds platform compatibility support by wrapping WebKit-dependent code in #if canImport(WebKit) compiler directives. This ensures the ConnectAccountsUI module compiles on platforms that don't have WebKit support (such as Linux or watchOS).

  • Wraps ConnectWebHandler.swift and GenerateAPIKeyView.swift in WebKit availability guards
  • Keeps public API types (APIKeyValidator, APIKeyCredentials) available on all platforms for API consistency
  • Includes minor code cleanup (removal of self. prefix and trailing newline)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Sources/ConnectAccountsUI/Internal/ConnectWebHandler.swift Wrapped entire file in #if canImport(WebKit) guard; removed unnecessary self. prefix in init method
Sources/ConnectAccountsUI/Internal/APIKeyValidator.swift Removed trailing newline (whitespace cleanup)
Sources/ConnectAccountsUI/GenerateAPIKeyView.swift Wrapped entire file in #if canImport(WebKit) guard to prevent compilation on non-WebKit platforms

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MortenGregersen MortenGregersen enabled auto-merge (squash) December 9, 2025 10:22
@MortenGregersen MortenGregersen merged commit e35fc6d into main Dec 9, 2025
8 checks passed
@MortenGregersen MortenGregersen deleted the support-non-webkit-platforms branch December 9, 2025 10:25
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