Skip to content

Optimize OPENSWIFTUI_LINK_COREUI check#812

Merged
Kyle-Ye merged 1 commit intomainfrom
k-branch-1
Mar 8, 2026
Merged

Optimize OPENSWIFTUI_LINK_COREUI check#812
Kyle-Ye merged 1 commit intomainfrom
k-branch-1

Conversation

@Kyle-Ye
Copy link
Collaborator

@Kyle-Ye Kyle-Ye commented Mar 8, 2026

No description provided.

@Kyle-Ye Kyle-Ye merged commit de7cbe7 into main Mar 8, 2026
8 checks passed
@Kyle-Ye Kyle-Ye deleted the k-branch-1 branch March 8, 2026 07:33
@github-actions github-actions bot added build issue enhancement New feature or request labels Mar 8, 2026
@augmentcode
Copy link

augmentcode bot commented Mar 8, 2026

🤖 Augment PR Summary

Summary: Optimizes OPENSWIFTUI_LINK_COREUI gating in NamedImage to reduce conditional-compilation scope.
Changes:

  • Moves CoreUI `#if` blocks from wrapping entire helpers to inside the helper bodies.
  • Adds explicit non-CoreUI fallbacks via `_openSwiftUIPlatformUnimplementedFailure()` / `_openSwiftUIPlatformUnimplementedWarning()`.
  • Makes `VectorInfo` and relevant cache subscripts compile uniformly, returning `nil` where appropriate.
Notes: CoreUI-backed behavior remains the same when the flag is enabled; unsupported paths are now explicit at runtime.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

}

#if OPENSWIFTUI_LINK_COREUI
fileprivate func loadVectorInfo(from catalog: CUICatalog, idiom: Int) -> VectorInfo? {
Copy link

Choose a reason for hiding this comment

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

With #if OPENSWIFTUI_LINK_COREUI moved inside the body, this file still references CoreUI types (e.g., CUICatalog, CUINamedVectorGlyph) in signatures/fields (loadVectorInfo, VectorInfo, cache subscripts), so non-CoreUI builds may still need those symbols available. Can you confirm this won’t break configurations where CoreUI isn’t importable/linkable?

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

_openSwiftUIPlatformUnimplementedFailure()
#endif
}

Copy link

Choose a reason for hiding this comment

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

_openSwiftUIPlatformUnimplementedFailure() is the only statement in the #else branch of a non-Void function; this relies on it being -> Never for compilation/correctness when OPENSWIFTUI_LINK_COREUI is off (also applies to similar branches like symbolSizeScale).

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@codecov
Copy link

codecov bot commented Mar 8, 2026

Codecov Report

❌ Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.39%. Comparing base (6945325) to head (f0825c9).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...ources/OpenSwiftUICore/View/Image/NamedImage.swift 0.00% 13 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #812       +/-   ##
===========================================
+ Coverage   13.99%   27.39%   +13.40%     
===========================================
  Files         624      659       +35     
  Lines       37809    42366     +4557     
===========================================
+ Hits         5291    11606     +6315     
+ Misses      32518    30760     -1758     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

build issue enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant