Skip to content

feat(appearance): render macOS widgets from appearance catalogs - #1264

Merged
Kyle-Ye merged 9 commits into
mainfrom
feature/appearance_widget_view
Nov 24, 2026
Merged

Kyle-Ye merged 9 commits into
mainfrom
feature/appearance_widget_view

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Nov 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Add AppearanceWidgetView to render macOS widgets with artwork, layout traits, insets, and blend modes from the active appearance.
  • Support CoreUI drawing and layer-backed images, including stretchable artwork. Cache images and measurements by widget within each catalog.
  • Resolve glyph foreground colors and compositing filters from catalog style presets, and refresh asset-reading views when their appearance changes.

Dependency

  • DarwinPrivateFrameworks#92 supplies the CoreUI interfaces used here. The package now resolves DarwinPrivateFrameworks to the merged revision e1b2d5cd.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T18:57:25.045058Z 9ac353b PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added area: graphics Color, shape, gradient, image, symbols, and graphics primitives. platform: macOS macOS-specific behavior or support. type: feature New API, behavior, platform support, or user-facing capability. labels Nov 23, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +21 to +23
static func named(_ name: String) -> AppearanceWidgetAssetCache {
if let cache = caches[name] {
return cache

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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

tuist Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Ran test modules Commit
OpenSwiftUI ✅ 7 3b10c1588

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI ✅ 1m 13s 3b10c1588

Reported by Tuist, faster builds and reliable tests for Xcode, Gradle, Bazel, and more.

@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 10.12658% with 355 lines in your changes missing coverage. Please review.
✅ Project coverage is 31.85%. Comparing base (57f84ee) to head (9ac353b).

Files with missing lines Patch % Lines
...tUICore/Graphic/Appearance/CatalogAppearance.swift 24.53% 123 Missing ⚠️
...ore/Graphic/Appearance/AppearanceGlyphEffect.swift 0.00% 65 Missing ⚠️
...Core/Graphic/Appearance/AppearanceMetricName.swift 0.00% 65 Missing ⚠️
...raphic/Appearance/AppearanceWidgetAssetCache.swift 0.00% 36 Missing ⚠️
...re/Graphic/Appearance/CoreUIAppearanceWidget.swift 0.00% 26 Missing ⚠️
...ic/Appearance/AppearanceEnvironmentAdditions.swift 0.00% 20 Missing ⚠️
...Core/Graphic/Appearance/AppearanceWidgetView.swift 0.00% 14 Missing ⚠️
...raphic/Appearance/AppearanceWidgetArtworkKey.swift 0.00% 6 Missing ⚠️
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.
📢 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 fa97707 into main Nov 24, 2026
7 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/appearance_widget_view branch November 24, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Color, shape, gradient, image, symbols, and graphics primitives. platform: macOS macOS-specific behavior or support. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant