Repository navigation
feat(splash): match the WASM loader's theme-aware colors and logo - #1667
Draft
MartinZikmund wants to merge 2 commits into
Draft
MartinZikmund wants to merge 2 commits into
MartinZikmund wants to merge 2 commits into
Conversation
ExtendedSplashScreen now applies the Uno.Wasm.Bootstrap loader rules when it rebuilds the splash from appmanifest.js: lightThemeBackgroundColor and darkThemeBackgroundColor (with #F3F3F3/#202020 defaults, ignoring splashScreenColor when either is set) and splashScreenImageDark. The theme is the browser's color scheme, read through UISettings, not the app's theme. The manifest is now read by a small tolerant parser instead of splitting the text on commas and colons. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://polite-field-01aa64f0f-1667.eastus2.azurestaticapps.net |
This was referenced Oct 8, 2026
ramezgerges
approved these changes
Oct 8, 2026
kazo0
approved these changes
Oct 8, 2026
ajpinedam
approved these changes
Oct 8, 2026
This branch has not been deployed
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.
What changed
ExtendedSplashScreenon WebAssembly now picks the splash background and logo fromappmanifest.jswith the same rules as the Uno.Wasm.Bootstrap HTML loader:lightThemeBackgroundColorordarkThemeBackgroundColoris present,splashScreenColoris ignored. Light useslightThemeBackgroundColor(default#F3F3F3), dark usesdarkThemeBackgroundColor(default#202020). With neither key,splashScreenColorapplies to both themes; missing ortransparentfalls back to the per-theme defaults.splashScreenImageDarkin dark theme when present, otherwisesplashScreenImage. Absolute http(s) image URLs are used as is, as the bootstrapper does.,and:) is replaced by a small dependency-free parser (WasmAppManifest.Parse) for the flatvar UnoAppManifest = { ... }shape: single or double quotes, optional quoted keys, escapes, comments, trailing commas; non-string values are ignored, and malformed input yields whatever was read before the problem (no exception).Parse,SelectSplash) lives inWasmAppManifest, free of UI types, so it can be tested without a browser.doc/controls/ExtendedSplashScreen.md.Behavior change worth knowing: a manifest without
splashScreenColorused to give a white splash; it now gives the loader's per-theme default, which is what the HTML loader draws.Why
Uno.Wasm.Bootstrap#1097 makes the HTML loader theme-aware. The toolkit draws a XAML copy of it so the hand-off is seamless, so it has to apply the same rules or the splash flips colour/logo in dark mode.
unoplatform/uno.resizetizer#157will generate these manifest keys.How the browser theme is detected, and why
The theme must be the browser's
prefers-color-scheme, not the app'sRequestedTheme: the HTML loader runs before the app starts and can only see the browser preference, so followingRequestedThemewould flip the hand-off whenever an app forces a theme.I used the existing
SystemThemeHelper.GetCurrentOsTheme()(readsUISettingsBackground). In Uno'sSystemThemeHelper(Uno.WinRT), the browser implementation callswindow.matchMedia("(prefers-color-scheme: dark)"), andUISettings.GetColorValueis derived from it, independent of the app'sRequestedThemeor any root element theme. So no new JS interop is needed. Rejected alternatives:Application.RequestedTheme(reflects app overrides),[JSImport]ofmatchMedia(works, but duplicates what Uno already does and adds interop to the library).Caveat:
Uno.Helpers.Theming.SystemThemeHelperitself is internal to Uno, which is why the toolkit's own helper is used. This was verified by reading the Uno sources, not by running a WASM app.Validation
WasmAppManifestTests, 29 cases: per-theme keys win, only one per-theme key, onlysplashScreenColor, transparent/missing/empty, dark image fallback, quoting, escapes, commas and braces inside values, comments, trailing commas, non-string values, duplicates, truncated and garbage input); they failed to compile before the implementation existed.WasmAppManifest.csand the test file directly: 29 passed, 0 failed.dotnet build src/Uno.Toolkit.UI/Uno.Toolkit.WinUI.csproj -f net10.0: succeeded, 0 warnings, 0 errors.dotnet format whitespaceleft no changes.Uno.Toolkit.RuntimeTests, so CI will run them.🤖 Generated with Claude Code
https://claude.ai/code/session_013terw2KRvw8e64cogQymUL