Skip to content

Fix image rendering and add vector glyph support#816

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

Fix image rendering and add vector glyph support#816
Kyle-Ye merged 10 commits intomainfrom
feature/image_rendering

Conversation

@Kyle-Ye
Copy link
Collaborator

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

Summary

  • Fix symbol variant not working by using candidateName instead of name in vectorInfo lookup
  • Fix resolveVector to correctly set isTemplate: true, handle background shape/size, and add redaction support
  • Fix adjustForBackground to use CUIVectorGlyphGraphicVariantOptions properly and move #if OPENSWIFTUI_LINK_COREUI guards inside methods
  • Add basic renderVectorGlyph implementation (single-layer foreground style, TODO for full RBSymbolUpdate multi-layer rendering)
  • Optimize CoreUI conditional compilation checks
  • Add SunsetScene example, variable image example, and new UI test cases
  • Remove rotation animation from SunsetScene example

Test plan

  • Run swift test --filter OpenSwiftUICompatibilityTests to verify snapshot tests
  • Run swift build to confirm compilation
  • Verify SunsetScene example renders correctly on device
  • Verify symbol variant test (symbolVarient) passes
  • Verify variable value image test passes

@github-actions github-actions bot added bug Something isn't working enhancement New feature or request test Test related issue labels Mar 8, 2026
@augmentcode
Copy link

augmentcode bot commented Mar 8, 2026

🤖 Augment PR Summary

Summary: This PR improves SF Symbol/vector-glyph image rendering and adds initial vector-glyph support.

Changes:

  • Fixes symbol-variant resolution by using candidateName for vector glyph lookup (so .symbolVariant(...) selects the correct asset).
  • Updates resolveVector to mark vector glyphs as template images, handle symbol-background sizing/metrics, and support symbol redaction.
  • Reworks background adjustment to use CUIVectorGlyphGraphicVariantOptions and moves #if OPENSWIFTUI_LINK_COREUI checks into the relevant methods.
  • Adds a basic renderVectorGlyph implementation for a single foreground layer (multi-layer/palette rendering remains TODO).
  • Adds a new Sunset scene demo and a variable-value symbol demo.
  • Adds new UI snapshot tests for symbol variants and variable-value symbol images; keeps rendering-mode tests disabled for now.
  • Extends OpenCombine integration by adding OpenCombineFoundation and updates the DarwinPrivateFrameworks pin.

Technical Notes: Multi-layer symbol rendering is intentionally deferred; current implementation focuses on correct lookup, sizing/metrics, and single-layer template rendering.

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

_openSwiftUIUnimplementedFailure()
// TODO: RBSymbolAnimator/RBSymbolUpdate
// We use a plain implementation for now
_openSwiftUIUnimplementedWarning()
Copy link

Choose a reason for hiding this comment

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

_openSwiftUIUnimplementedWarning() prints on every call and (in DEBUG && OPENSWIFTUI_DEVELOPMENT) escalates to _openSwiftUIUnimplementedFailure, so invoking it in renderVectorGlyph can become very noisy or crash in dev builds when rendering SF Symbols.

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 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 13.93%. Comparing base (6c991c1) to head (b19f67a).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...tUICore/Shape/ShapeStyle/ShapeStyleRendering.swift 0.00% 13 Missing ⚠️
...ources/OpenSwiftUICore/View/Image/NamedImage.swift 0.00% 2 Missing ⚠️
...ces/OpenSwiftUICore/View/Image/ResolvedImage.swift 0.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (6c991c1) and HEAD (b19f67a). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (6c991c1) HEAD (b19f67a)
2 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #816       +/-   ##
===========================================
- Coverage   27.48%   13.93%   -13.55%     
===========================================
  Files         661      626       -35     
  Lines       42429    37921     -4508     
===========================================
- Hits        11661     5286     -6375     
- Misses      30768    32635     +1867     

☔ 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 51d5aab into main Mar 8, 2026
6 of 8 checks passed
@Kyle-Ye Kyle-Ye deleted the feature/image_rendering branch March 8, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request platform: iOS platform: macOS RenderEffect test Test related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant