Skip to content

fix(ios): read the system appearance before the window has a root view controller - #20

Merged
farfromrefug merged 1 commit into
mainfrom
fix/ios-system-appearance-at-launch
Nov 18, 2026
Merged

farfromrefug merged 1 commit into
mainfrom
fix/ios-system-appearance-at-launch

Conversation

@farfromrefug

Copy link
Copy Markdown

PR Checklist

  • The PR title follows our guidelines.
  • There is an issue for the bug/feature this PR is for.
  • You have signed the CLA (fork PR, not applicable).
  • All existing tests are passing: not run.
  • Tests for the changes are included: none, native iOS path (UIKit trait collections), checked manually.

What is the current behavior?

The launch event fires before the primary window gets its root view controller. Application.systemAppearance() and IOSNativeWindow.systemAppearance() both return null until then, so a launch handler that picks its theme from systemAppearance() (theme auto) gets nothing and apps render with empty colors.

What is the new behavior?

Both getters fall back to the window's trait collection, then UIScreen.mainScreen.traitCollection, when there is no root view controller yet. Once a root view controller exists it is still used first, so behavior after launch is unchanged.

Checked in the iOS simulator (iPhone 17, iOS 27) with an app whose launch handler resolves the auto theme: the first screen renders with theme colors.

Notes

  • Regression window: first seen after the upstream merge of 2026-11 (NativeWindow / scene rewrite).
  • Android unchanged.

🤖 Generated with Claude Code

…w controller

The launch event fires before the primary window gets its root view controller, and both
Application.systemAppearance() and IOSNativeWindow.systemAppearance() returned null then. Apps
that pick their theme in a launch handler got no appearance and rendered with empty colors.

Fall back to the window and then the screen trait collection when there is no root view
controller yet.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@farfromrefug
farfromrefug marked this pull request as ready for review November 18, 2026 22:21
@farfromrefug
farfromrefug merged commit f6a5b27 into main Nov 18, 2026
0 of 2 checks passed
@farfromrefug
farfromrefug deleted the fix/ios-system-appearance-at-launch branch November 18, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant