Conversation
- Use _CUIThemeVectorGlyphWeight enum for Font.Weight.glyphWeight - Add Image.HashableScale.glyphSize mapping (small→1, medium→2, large→3) - Fix namedVectorGlyph call to pass glyphSize from imageScale instead of glyphWeight - Pass Locale directly to namedVectorGlyph locale parameter (NSLocale bridging) - Force unwrap CUIDeviceIdiom(rawValue:) instead of fallback to .universal
- Remove explicit get blocks from computed subscripts - Move #if OPENSWIFTUI_LINK_COREUI guards to cover individual subscripts - Add platform unimplemented warning for BitmapKey subscript on non-CoreUI - Use guard let in decode(_:) for cleaner control flow
- Add fillVariant(_:name:) for fill symbol variant lookup - Add mayContainSymbol(_:) for checking if catalog contains a symbol - Add findShapeAndFillVariantName(_:base:body:) for shape+fill variant resolution - Add findName(_:base:body:) for full variant name resolution - Add SystemAssetManager struct with systemAssetManager/privateSystemAssetManager statics
- SystemAssetManager: proper struct with catalog, fillMapping, nameAliases, symbols fields; init(internalUse:) loads from CoreGlyphs bundles - catalog getter: returns SystemAssetManager.catalog for system locations - fillVariant: uses fillMapping dict for system, name+".fill" for bundle - mayContainSymbol: uses symbols array for system, true for bundle - Add aliasedName() using nameAliases dictionary - findShapeAndFillVariantName: calls aliasedName() before lookups - findName: handles .slash variant, normalizes .background semantics - Add _SimulatorSystemRootDirectory() wrapper for GSSystemRootDirectory - Add GraphicsServices_Private SPI module
Move SystemAssetManager and its static instances outside of #if OPENSWIFTUI_LINK_COREUI, keeping only the CUICatalog field and init logic conditional.
🤖 Augment PR SummarySummary: This PR adds initial support for SwiftUI-style named images (asset catalog images and SF Symbols), including a CoreUI-backed resolution path when enabled. Changes:
Technical Notes: Many of the CoreUI/vector symbol pieces are guarded behind 🤖 Was this summary useful? React with 👍 or 👎 |
| ) -> NamedImage.VectorInfo? { | ||
| let environment = context.environment | ||
| let variants = environment.symbolVariants | ||
| let result: NamedImage.VectorInfo? = location.findName(variants, base: name) { candidateName in |
There was a problem hiding this comment.
location.findName(variants, base: name) { candidateName in … } ignores candidateName and always calls vectorInfo(name: name, …), so symbol variant/alias name lookup won’t actually affect the asset lookup here.
Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| } | ||
| let gamut = key.displayGamut.cuiDisplayGamut | ||
| let idiom = CUIDeviceIdiom(rawValue: environment.cuiAssetIdiom) ?? .universal | ||
| let idiom = CUIDeviceIdiom(rawValue: environment.cuiAssetIdiom)! |
There was a problem hiding this comment.
| } | ||
| #if OPENSWIFTUI_LINK_COREUI | ||
| let fullPath = _SimulatorSystemRootDirectory() + bundlePath | ||
| let bundle = Bundle(path: fullPath)! |
There was a problem hiding this comment.
Bundle(path: fullPath)! and try! CUICatalog(...) will crash at runtime if the CoreGlyphs bundle/catalog isn’t present or can’t be opened (e.g. unusual simulator roots or stripped environments) when OPENSWIFTUI_LINK_COREUI is enabled.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| ) | ||
| let environment = EnvironmentValues() | ||
| let resolved = provider.resolveError(in: environment) | ||
| #expect(resolved.image.scale == 0) |
There was a problem hiding this comment.
No description provided.