Skip to content

Fix SwiftUI Section builder issues for Swift 6 migration#274

Open
dylans2010 wants to merge 1 commit into
mainfrom
codex/fix-swift-6-migration-errors
Open

Fix SwiftUI Section builder issues for Swift 6 migration#274
dylans2010 wants to merge 1 commit into
mainfrom
codex/fix-swift-6-migration-errors

Conversation

@dylans2010

Copy link
Copy Markdown
Owner

Motivation

  • Swift 6's stricter @ViewBuilder inference rejects non-View expressions placed directly in Section bodies, causing build errors during migration.
  • The codebase contained let bindings and computed expressions inside Section closures which must be moved or wrapped so the Section body only returns views.

Description

  • Wrapped the content rows in FilePreviewView's "Content" Section with a Group and removed an inline let so the Section body contains only view-producing code (SwiftCode/Views/Utilities/FilePreviewView.swift).
  • Moved the filtered deployment logs out of the Section body into a computed property deploymentLogs and updated the Section to use it (SwiftCode/Views/Developer/DeploymentDebug/DeploymentDebugView.swift).
  • Moved the source-branch commit derivation out of the Section body into a computed property sourceBranchCommits and updated the Section to iterate that property (SwiftCode/Views/Collaboration/PRCreateView.swift).
  • Overall changes ensure Section closures contain only view-building code and avoid non-View bindings that trigger Swift 6 builder errors.

Testing

  • Attempted xcodebuild -project SwiftCode.xcodeproj -list, but it failed because Xcode CLI tools are not available in the environment (xcodebuild: command not found), so a full build/test could not be executed.
  • Verified repository modifications and created a commit (git commit) successfully, indicating the patches applied cleanly.
  • No automated unit or integration test runs were executed due to the missing Xcode toolchain in this environment.

Codex Task

Copilot AI review requested due to automatic review settings May 23, 2026 06:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants