Repository navigation
feat(appearance): render macOS widgets from appearance catalogs - #1264
Conversation
Move FunctionalAppearanceAssetView and EnvironmentValues.asset into AppearanceGlyphEffect.swift.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ac353ba82
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case baselineMetricName.rawValue: | ||
| guard let value = measurements[kCUIMeasureBaseline as String] as? NSNumber else { return nil } | ||
| // The catalog casts a CGFloat even for the Double-typed baseline metric. | ||
| return .some(CGFloat(value.doubleValue) as! MetricValue) |
There was a problem hiding this comment.
Return a Double for the Double-typed baseline metric
When CoreUI supplies a baseline measurement for baselineMetricName, MetricValue is Double, but this expression force-casts a CGFloat to that type. These are distinct Swift types, so the cast traps rather than returning the baseline; even containsAsset(for:) can reach this through metric lookup. Return value.doubleValue for the declared metric type instead.
Useful? React with 👍 / 👎.
| static func named(_ name: String) -> AppearanceWidgetAssetCache { | ||
| if let cache = caches[name] { | ||
| return cache |
There was a problem hiding this comment.
Include the catalog bundle in the widget cache identity
If two CatalogAppearance instances load identically named catalogs from different bundles, they share this cache despite representing different appearances. Both artwork(for:) and metric(for:) retrieve entries using only name and the widget, so the second catalog returns the first catalog's images and measurements; artwork lookup even returns the cached image before checking whether the second catalog defines it. Key the cache by the full catalog identity, including the bundle, as CatalogAppearance equality and the existing color cache already do.
Useful? React with 👍 / 👎.
🛠️ Tuist Run Report 🛠️Tests 🧪
Builds 🔨
Reported by Tuist, faster builds and reliable tests for Xcode, Gradle, Bazel, and more. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1264 +/- ##
==========================================
- Coverage 31.99% 31.85% -0.15%
==========================================
Files 1020 1027 +7
Lines 84097 84428 +331
==========================================
- Hits 26907 26893 -14
- Misses 57190 57535 +345 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
AppearanceWidgetViewto render macOS widgets with artwork, layout traits, insets, and blend modes from the active appearance.Dependency
e1b2d5cd.