Skip to content

Migrate to scene-based lifecyle#25628

Open
crazytonyli wants to merge 10 commits into
trunkfrom
task/xcode-beta-app
Open

Migrate to scene-based lifecyle#25628
crazytonyli wants to merge 10 commits into
trunkfrom
task/xcode-beta-app

Conversation

@crazytonyli

Copy link
Copy Markdown
Contributor

Note

I recommend reviewing by commit. The first commit is swift-format code changes.

Description

This is a blocker to compiling on Xcode 27. The migration is required by Xcode 27.

https://developer.apple.com/documentation/technotes/tn3187-migrating-to-the-uikit-scene-based-life-cycle

NoticePresenter sizes its window from UIApplication.shared.mainWindow, which
under the scene life cycle does not exist until the main window becomes key in
showInitialUI. Creating it in didFinishLaunching gave it a zero frame.
AppAppearance.overrideAppearance() and the Home Screen quick action creation
both reach the app's window indirectly (the override style target and the 3D
Touch trait check). Under the scene life cycle the window does not exist until
the scene connects, so these no-opped when left in willFinishLaunching and
runStartupSequence. Move them into showInitialUI alongside the other
window-dependent launch steps.
UntouchableWindow was created with 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. Add a windowScene initializer and use it in
NoticePresenter when the main window's scene is available.
@crazytonyli crazytonyli added this to the 27.0 milestone Jun 9, 2026
@crazytonyli crazytonyli requested a review from jkmassel June 9, 2026 08:37
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@wpmobilebot

wpmobilebot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number32479
VersionPR #25628
Bundle IDorg.wordpress.alpha
Commiteef3ea4
Installation URL6bbog6vmv76eo
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number32479
VersionPR #25628
Bundle IDcom.jetpack.alpha
Commiteef3ea4
Installation URL1fmvjdc0v04a8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

The app Info.plist now declares a UIApplicationSceneManifest, so the unit test
host (WordPress.app running TestingAppDelegate) adopts the scene life cycle but
never connects a window scene. UIApplication.mainWindow resolves the connected
scene's key window, which is therefore nil, breaking tests that read it
(RichContentFormatter directly, QRLogin and others via leafViewController). Fall
back to the app delegate's window in the test bundle's mainWindow override, and
expose TestingAppDelegate.window via @objc so the fallback can read it.

@jkmassel jkmassel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The bot is concerned about CompliancePopoverCoordinator.presentPopover() not working and handleWillEnterForeground() being called more than once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants