feat(swiftui): support container-installed content decorators - #399
Draft
robmaceachern wants to merge 7 commits into
Draft
robmaceachern wants to merge 7 commits into
robmaceachern wants to merge 7 commits into
Conversation
Run Xcode first-launch setup and establish the runner session before downloading simulator runtimes. Keep all existing OS coverage and let installation errors fail the job. --- *This response was drafted with AI assistance.*
Support Swift 6.2 raw identifiers with a pinned formatter and preserve existing formatting policy. Keep this MRKT-142 supporting tooling change independent of navigation API work. --- *This response was drafted with AI assistance.*
Keep the SwiftFormat upgrade independently reviewable in #400 while validating the MRKT-142 lifecycle API above that prerequisite. --- *This response was drafted with AI assistance.* * origin/codex/mrkt-142-swiftformat-0587: build: upgrade SwiftFormat to 0.58.7
Prepare designated wrapper content before containment and retire integrations before replacement. Report explicit ObservableScreen decoration outcomes while preserving original hosting behavior. Cover replacement ordering, observation retirement, and controller preparation in MRKT-142 tests. Validation: WorkflowUI and WorkflowSwiftUI hosted suites passed 104 tests with one existing expected failure on iOS 26.5; full SwiftFormat lint passed. --- *This response was drafted with AI assistance.*
robmaceachern
changed the base branch from
main
to
codex/mrkt-142-swiftformat-0587
September 10, 2026 18:10
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a pre-load SwiftUI content decoration hook and an explicit designated-content lifecycle for containers. These let a navigation container install preference collection and environment bridging through presentation wrappers while preserving ordinary
ObservableScreenconformances and hosting customization hooks.This framework change belongs to MRKT-142. It is stacked on the independently landable SwiftFormat prerequisite #400; the formatter change is excluded from this PR's target-to-head diff. Keep this PR draft until Rob manually examines it and explicitly approves conversion. No automatic readiness conversion or merge.
How it works
UIViewController.decorateObservableScreenContent(with:)installs oneViewModifieraround a standardObservableScreenhost's complete content, before its view loads. It checks the actual built controller, including after screen type erasure.ObservableScreenContentDecorationResultdistinguishes installation, unsupported hosts, already-loaded views, and an existing decorator. Rejected installations leave the host unchanged.ScreenContentProvidinglets an existing wrapper designate one base child through a retainedScreenContentLifecycle. This is explicit opt-in, not child-hierarchy traversal, presentation-target discovery, or selected-entry forwarding. Modal/toast overlays and nested navigation stacks remain separate integration boundaries.ScreenContentLifecycle.observe(prepare:)prepares the current child immediately and returns a retained observation. Every old integration retires before any replacement is prepared; removal, observation release, and lifecycle destruction also retire it. Replacing with the same controller does nothing, and appearance changes do not end ownership. Access is main-thread-only; preparation and retirement cannot recursively replace the same lifecycle.update(child:with:in:prepareReplacement:onChange:)gains a defaulted preparation callback, invoked only for a newly built replacement before this helper adds containment or loads the view. Custom description closures may already have loaded their controller, so integrations must check installation requirements.Validation
xcodebuild testwith theUnitTestsscheme and the fullWorkflowUI-TestsandWorkflowSwiftUI-Teststargets passed 104 tests with one existing expected failure and zero unexpected failures, after integrating the formatter prerequisite.mise exec -- swiftformat --lint . --cache ignore: 0/285 files require formatting, 22 skipped.git diff --checkpasses; normal commit hooks pass.Risk
This adds a public lifecycle contract to shared hosting code. The one-time, pre-load decorator rule protects rendered content identity; designated-child opt-in and synchronous retirement constrain ownership. Custom wrappers must announce replacements at the documented point, and callers must retain observations for the intended integration lifetime. Multiple independent decorators are deliberately unsupported.
Checklist
This response was drafted with AI assistance.