Skip to content

Fix named image mask rendering and load system vector image issue#815

Merged
Kyle-Ye merged 6 commits intomainfrom
feature/image_rendering
Mar 8, 2026
Merged

Fix named image mask rendering and load system vector image issue#815
Kyle-Ye merged 6 commits intomainfrom
feature/image_rendering

Conversation

@Kyle-Ye
Copy link
Collaborator

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

No description provided.

@github-actions github-actions bot added bug Something isn't working RenderEffect labels Mar 8, 2026
@augmentcode
Copy link

augmentcode bot commented Mar 8, 2026

🤖 Augment PR Summary

Summary: This PR fixes image mask rendering and improves system vector image loading, while adding coverage for named image rendering modes.

Changes:

  • Implements shape-style rendering for .image(GraphicsImage) by tinting via maskColor instead of crashing as unimplemented.
  • Adds Image.renderingMode(_:) support, including logic to toggle template behavior and SF Symbol multicolor resolution.
  • Adjusts GraphicsImage.styleResolverMode handling when contents is nil vs other content types.
  • Fixes CoreUI vector glyph lookup for named/system images by changing asset matching and tidying vector info loading/caching.
  • Removes a stale TODO marker for Image.NamedResolved.
  • Adds new example views and snapshot UI tests covering .original vs .template rendering modes for a named asset.

Technical Notes: Template rendering relies on GraphicsImage.maskColor/contentsMultiplyColor to implement tinting/masking for non-vector images, while vector glyphs are handled via symbol rendering modes.

🤖 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. 1 suggestion posted.

Fix All in Augment

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


func resolve(in context: ImageResolutionContext) -> Image.Resolved {
var context = context
if !context.environment.imageIsTemplate(renderingMode: renderingMode),
Copy link

Choose a reason for hiding this comment

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

The condition that sets context.symbolRenderingMode = .multicolor triggers whenever the effective template mode is non-template, which also includes the renderingMode: nil (reset-to-default) case; that may unintentionally change default SF Symbol behavior compared to not calling renderingMode at all. (Also applies to the same logic in resolveNamedImage below.)

Severity: medium

Fix This in Augment

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

@github-actions github-actions bot added the test Test related issue label Mar 8, 2026
@codecov
Copy link

codecov bot commented Mar 8, 2026

Codecov Report

❌ Patch coverage is 4.00000% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.48%. Comparing base (bf0ff05) to head (419b9c7).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...penSwiftUICore/View/Image/ImageRenderingMode.swift 0.00% 27 Missing ⚠️
...ources/OpenSwiftUICore/View/Image/NamedImage.swift 0.00% 15 Missing ⚠️
...tUICore/Shape/ShapeStyle/ShapeStyleRendering.swift 0.00% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #815   +/-   ##
=======================================
  Coverage   27.47%   27.48%           
=======================================
  Files         660      661    +1     
  Lines       42405    42429   +24     
=======================================
+ Hits        11652    11661    +9     
- Misses      30753    30768   +15     

☔ 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.

@Kyle-Ye Kyle-Ye merged commit 6c991c1 into main Mar 8, 2026
7 of 11 checks passed
@Kyle-Ye Kyle-Ye deleted the feature/image_rendering branch March 8, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working RenderEffect test Test related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant