Defer the notice presenter's window until the first presentation#25637
Open
crazytonyli wants to merge 3 commits into
Open
Defer the notice presenter's window until the first presentation#25637crazytonyli wants to merge 3 commits into
crazytonyli wants to merge 3 commits into
Conversation
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 32566 | |
| Version | PR #25637 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | a6a1f30 | |
| Installation URL | 7trav2ipijt2o |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 32566 | |
| Version | PR #25637 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | a6a1f30 | |
| Installation URL | 3ut4o3n7opk9o |
0bc2261 to
0816ee3
Compare
0816ee3 to
4897d5a
Compare
UntouchableWindow was created eagerly at setup via init(frame:), which leaves it without a windowScene; such a window does not display (or attaches to the wrong scene) under the UIScene life cycle. The window is now created on the first foreground presentation, attached to the active scene, reattaching it if the scene has changed since the window was created. When no scene is connected yet (e.g. a notice posted during launch, before UIKit connects the scene), the notice stays at the head of the queue and presentation is retried once the app becomes active. The presenter also processes any notice posted before it was created, since the store does not replay state to new subscribers. The frame-based initializer is replaced with a windowScene one.
4897d5a to
a49a457
Compare
The presenter's view accessor required the lazily created window to exist, backed by a fatalError; its safety depended on guards scattered across the call sites. Presentation now reads the view from the window it just ensured, and the keyboard and dismissal paths reach it through the container's superview, so the accessor and its fatalError are gone.
jkmassel
approved these changes
Jun 12, 2026
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.


Note
I recommend reviewing this PR commit by commit. The first commit is swift-format only.
Description
Second PR in the UIScene life cycle preparation series, after #25636.
NoticePresentercreated itsUntouchableWindoweagerly at setup viainit(frame:), which leaves the window without awindowScene; such a window silently never displays once the app adopts the scene life cycle.fatalError-backedviewaccessor is removed; presentation reads the view from the window it just ensured, and the keyboard and dismissal paths reach it through the container's superview.Testing instructions
Regression-test notices: trigger a few (e.g. save a draft, publish a post), and check a notice posted right before backgrounding is delivered as a local notification.