Repository navigation
fix: render the default variant's scheme on first launch - #1
Merged
Merged
Conversation
ThemeApplier forced the first frame of a first launch to fallback.colorScheme, then flipped once handleAppear stored the default variant. It now follows the system until a value is persisted, and applies the stored scheme on first appear instead of relying on onChange(of: theme.value), which does not fire when the default equals fallback.
Correct the fallback.colorScheme doc for undecodable stored values and mirror it in REFERENCE.md, inline effectiveColorScheme, tidy the changelog entry, regroup and tighten the tests, cover an unspecified default, and fail the changelog check on an Unreleased heading.
handleAppear stored the default variant on first launch but never set overrideUserInterfaceStyle, and theme observation starts after onAppear(), so the window was left unforced for the first session.
Cover an unspecified default, route the new tests through makeApplier, note the harmless double application, and tighten the changelog wording.
Following the system on first launch still flipped for a default variant that forces a scheme different from the system's, such as an always-dark palette on a light system. Render the scheme of the value handleAppear is about to store instead.
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.
Stops
ThemeApplierfrom rendering the first frame of a first launch infallback.colorScheme, and applies the default variant's scheme on first appear in both the SwiftUI and UIKit appliers.Changes
ThemeKitSwiftUI.ThemeApplierrenders the scheme of the default variant value it is about to store, so a first launch no longer renders in the fallback's scheme and flips, which left macOS window titles and sidebar text resolved light.onChange(of: theme.value), which never fires when the default equalsfallback; UIKit's observation starts afteronAppear().fallback.colorSchemeinThemeExtension.swiftandREFERENCE.md, adds a 0.3.1 CHANGELOG entry (dated at tag time), and makescheck_changelog_entry.swiftreject anUnreleasedheading.NSApplication.shared.appearanceandoverrideUserInterfaceStyle.