Skip to content

[Bug Fix] Fix UIImage to Image environment override issue#823

Merged
Kyle-Ye merged 10 commits intomainfrom
bugfix/uiimage_dark
Mar 15, 2026
Merged

[Bug Fix] Fix UIImage to Image environment override issue#823
Kyle-Ye merged 10 commits intomainfrom
bugfix/uiimage_dark

Conversation

@Kyle-Ye
Copy link
Collaborator

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

Fix ImageConversionsUITests.platformImageNamed failure on iOS

@github-actions github-actions bot added bug Something isn't working platform: iOS test Test related issue labels Mar 15, 2026
@augmentcode
Copy link

augmentcode bot commented Mar 15, 2026

🤖 Augment PR Summary

Summary: Fixes an iOS-only failure in ImageConversionsUITests.platformImageNamed by improving how UIKit trait collections are overridden/resolved from OpenSwiftUI environment values (notably for image/asset evaluation).

Changes:

  • Adds C shims for missing/private UIKit symbols (_UIBacklightLuminance, _UIUserInterfaceVibrancy) and a safe-wrapper category for additional UITraitCollection private accessors.
  • Expands UITraitCollection.resolvedTraitCollection to copy more environment fields into UIMutableTraits (Dynamic Type, color scheme/style, gamut, size classes, contrast, etc.).
  • Implements UITraitCollection.resolvedEnvironment(base:) to derive OpenSwiftUI environment values back from UIKit traits (luminance reduction, fidelity, corner radius, materials/vibrancy, etc.).
  • Introduces EnvironmentValues.updateFidelity and EnvironmentValues.inheritedTraitCollection helpers to support caching/trait inheritance.
  • Adds a UIKit bridge for TypesettingConfiguration via TypesettingConfigurationKey + trait read/write.
  • Refactors Dynamic Type conversion helpers to share package-level implementations.
  • Makes Material.thick available at package scope and tightens other internal material access.
  • Replaces an unimplemented failure with an unreachable-code marker in UIImageConversions.

Technical Notes: The new logic relies on safe wrappers around private UIKit selectors to avoid hard failures when running on OS versions without those APIs.

🤖 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. 3 suggestions posted.

Fix All in Augment

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

@Kyle-Ye Kyle-Ye merged commit cd3b4ff into main Mar 15, 2026
7 of 8 checks passed
@Kyle-Ye Kyle-Ye deleted the bugfix/uiimage_dark branch March 15, 2026 06:42
@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 27.45%. Comparing base (b1ac85f) to head (f88b951).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #823   +/-   ##
=======================================
  Coverage   27.44%   27.45%           
=======================================
  Files         663      663           
  Lines       42510    42510           
=======================================
+ Hits        11668    11672    +4     
+ Misses      30842    30838    -4     

☔ 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

bug Something isn't working platform: iOS test Test related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant