Skip to content

fix(hosting): preserve nested environments and apply _overrideSizeThatFits in representables - #1273

Merged
Kyle-Ye merged 3 commits into
mainfrom
bugfix/platform_view_host
Nov 28, 2026
Merged

Kyle-Ye merged 3 commits into
mainfrom
bugfix/platform_view_host

Conversation

@Kyle-Ye

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

Copy link
Copy Markdown
Member

Close #1270
Close #1272

Summary

  • Forward representable environment, view phase, and focused values through UIKit child trait collections for nested views not already managed by a parent view controller.
  • Inherit the nearest representable host's environment in nested NSHostingView instances on macOS.
  • Apply overrideSizeThatFits after computing default layout sizes in ViewLeafView.sizeThatFits while leaving explicit sizeThatFits results unchanged.
  • Cover nested hosting environment updates and representable size overrides with cross-platform compatibility tests.

@Kyle-Ye
Kyle-Ye requested a review from Mx-Iris as a code owner November 28, 2026 14:34
@Kyle-Ye Kyle-Ye added this to the 0.26.0 milestone Nov 28, 2026
@Kyle-Ye Kyle-Ye added type: bug Something is not working correctly. area: data-flow State, binding, environment, preference, observation, or property data flow. area: layout Layout, geometry, safe area, alignment, stacks, or sizing. area: hosting-bridge SwiftUI bridge, UIHosting/NSHosting, representables, and platform host views. area: tests Test suites, UI tests, fixtures, snapshots, and test support code. impact: visual-diff Visual mismatch, screenshot diff, or rendering fidelity issue. labels Nov 28, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 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-28T14:35:11.742005Z 16502a8 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.

@codecov

codecov Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 45.45455% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 35.09%. Comparing base (0592025) to head (16502a8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...esentable/Platform/PlatformViewRepresentable.swift 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1273      +/-   ##
==========================================
+ Coverage   29.40%   35.09%   +5.68%     
==========================================
  Files         960     1046      +86     
  Lines       71575    85554   +13979     
==========================================
+ Hits        21048    30021    +8973     
- Misses      50527    55533    +5006     

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

@tuist

tuist Bot commented Nov 28, 2026

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI ✅ 53.0s af28905aa

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

@Kyle-Ye
Kyle-Ye merged commit 6265481 into main Nov 28, 2026
6 of 9 checks passed
@Kyle-Ye
Kyle-Ye deleted the bugfix/platform_view_host branch November 28, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: data-flow State, binding, environment, preference, observation, or property data flow. area: hosting-bridge SwiftUI bridge, UIHosting/NSHosting, representables, and platform host views. area: layout Layout, geometry, safe area, alignment, stacks, or sizing. area: tests Test suites, UI tests, fixtures, snapshots, and test support code. impact: visual-diff Visual mismatch, screenshot diff, or rendering fidelity issue. type: bug Something is not working correctly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apply _overrideSizeThatFits when sizing platform view representables Preserve environment values in nested UIKit hosting views

1 participant