Skip to content

Update NamedImage and fix Linux build#808

Merged
Kyle-Ye merged 7 commits intomainfrom
feature/image
Mar 7, 2026
Merged

Update NamedImage and fix Linux build#808
Kyle-Ye merged 7 commits intomainfrom
feature/image

Conversation

@Kyle-Ye
Copy link
Collaborator

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

Summary

  • Fix Linux build errors for CoreUI-specific types (CUINamedVectorGlyph, SFSymbols, CGImage.width/height) by adding proper platform guards
  • Update NamedImageTests: remove trivial equality/hash tests, add meaningful tests for BitmapKey environment init, size class conversion, fillVariant, findName, and mayContainSymbol logic
  • Fix incorrect resolveError test expectation (scale 0 → 1.0)

Test plan

  • Verify Linux build passes via ./Scripts/build.sh
  • Run swift test --filter OpenSwiftUICoreTests on macOS

Kyle-Ye added 6 commits March 7, 2026 23:34
- Remove trivial equality/hash tests for BitmapKey, Key, Location, and Provider
- Add BitmapKey tests for environment-based init and size class conversion
- Add Location tests for fillVariant, mayContainSymbol, and findName logic
- Fix resolveError test expecting wrong scale value (0 → 1.0)
@github-actions github-actions bot added bug Something isn't working platform: Linux build issue test Test related issue labels Mar 7, 2026
@augmentcode
Copy link

augmentcode bot commented Mar 7, 2026

🤖 Augment PR Summary

Summary: This PR updates the image/symbol pipeline to build cleanly on Linux while improving NamedImage behavior coverage.

Changes:

  • Added platform guards and lightweight shims for CoreUI/RenderBox-related types to avoid CoreUI-specific build failures on non-Darwin platforms.
  • Updated `DisplayList`/`SymbolEffect`/image code to import `OpenRenderBoxShims` and remove/adjust stubs accordingly.
  • Implemented substantial parts of `ResolvedVectorGlyph` setup (animator wiring, environment-driven rendering mode selection, alignment/style helpers).
  • Introduced `ImageResolutionContext.effectiveSymbolRenderingMode` and a placeholder `willUpdateVectorGlyph` hook for future transition logic.
  • Hardened `NamedImage` decoding and system asset initialization with `canImport(Darwin)` / `canImport(CoreGraphics)` checks.
  • Filled in missing font trait mutation for weight/width modifiers.
  • Reworked `NamedImageTests` to drop trivial equality/hash assertions and add targeted behavior tests (environment init, size class conversion, fill/name lookup, symbol detection).

Technical Notes: Several new code paths are guarded behind OPENSWIFTUI_LINK_COREUI / OPENSWIFTUI_RENDERBOX, with explicit platform-unimplemented traps where functionality isn’t expected to work yet.

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

@codecov
Copy link

codecov bot commented Mar 7, 2026

Codecov Report

❌ Patch coverage is 2.85714% with 102 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.43%. Comparing base (33a74eb) to head (385b96d).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ces/OpenSwiftUICore/View/Image/GraphicsImage.swift 4.54% 63 Missing ⚠️
...enSwiftUICore/View/Image/SymbolRenderingMode.swift 0.00% 21 Missing ⚠️
Sources/OpenSwiftUICore/View/Image/Image.swift 0.00% 13 Missing ⚠️
...ources/OpenSwiftUICore/View/Image/NamedImage.swift 0.00% 3 Missing ⚠️
.../OpenSwiftUICore/View/Text/Font/ModifiedFont.swift 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #808      +/-   ##
==========================================
- Coverage   27.57%   27.43%   -0.15%     
==========================================
  Files         658      660       +2     
  Lines       41277    42376    +1099     
==========================================
+ Hits        11383    11624     +241     
- Misses      29894    30752     +858     

☔ 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 6029301 into main Mar 7, 2026
10 of 11 checks passed
@Kyle-Ye Kyle-Ye deleted the feature/image branch March 7, 2026 17:10
@Kyle-Ye Kyle-Ye linked an issue Mar 7, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NamedImage support

1 participant