You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: Fluent loading screen with phases and network states - #1097
Includes the theme-aware splash commit from dev/mazi/theme-aware-splash: per-theme background and image, with splashScreenColor only used without per-theme values.
What changed
The loader showed a thin bar at the bottom of the page. It sat at ~95% while the app initialized after the downloads, and gave no feedback when the connection was slow, offline or failing.
Fluent 2 layout: logo, a 4 px progress bar, and status text in the system font, following the theme. The logo stays centred in the viewport at its former maximum size (620×300), where Uno.Toolkit's ExtendedSplashScreen draws it, so the hand-off doesn't jump; the bar and text hang below it. On very short screens (landscape phones) everything stays on screen: without text the logo stays centred and shrinks just enough for the bar; when text or the Reload button is shown, it moves up (at most to 16 px from the top) and shrinks only as much as they need. The background is set on html/body too, so there's no white flash before a dark app.
Phases: connecting (indeterminate), downloading (determinate), then starting, with an indeterminate bar while the app initializes.
Clean by default: a normal load shows just the logo and the bar: no text to translate and no space reserved below the bar. Apps can opt in with WasmShellLoaderProgressFormat (percent, or size measured with PerformanceObserver), set 14/20 semibold in the secondary colour, and WasmShellLoaderStatusText=true ("Getting ready…", "Downloading app", "Starting…" and the slow-connection hint). Retry, offline and failed are always described, below the group, so the logo and bar don't move (except on screens too short to fit the text). When startup fails, the bar and value are removed and the text sits 24 px below the logo, with Reload 24 px below it. WasmShellLoaderLogoAnimation=false keeps the logo still (it breathes by default).
Text color: like WinUI's MonochromaticOverlayPresenter, all text and icons (outlined Fluent Warning / Error Circle) draw in one secondary color. Unless the app sets one (foregroundColor, lightThemeForegroundColor, darkThemeForegroundColor in the AppManifest), it's derived from the background's WCAG luminance with CSS relative colors, keeping at least 4.5:1 on any background (5.93:1 / 9.44:1 like the default palette, black or white near the middle); the track follows the background and the Reload label the accent. Default colors give exactly the default palette; browsers without relative colors use it too. splashScreenColor now sets both theme backgrounds, so its text is derived as well.
States: slow (after 15 s, hint only with status text on), offline (online/offline events), retrying (from the resilient loader's counters, when fix: Retry and time out boot downloads #1095 is present), and failed, with a Reload button, when runtime initialization throws.
Motion: the bar eases between progress updates and never goes back. Animations only use transform and opacity, so they keep running while the main thread compiles WebAssembly; a 3 s main-thread block still rendered ~60 fps in the prototype. Retrying and offline use slower motion. prefers-reduced-motion turns it off.
Exit: the loader fades out, also when the app removes the element itself (as Uno Platform does on its first frame): it's put back before the next paint and faded, and its timer and listeners stop. A later failure doesn't re-show it over the running app. Bootstrapper.dismissLoader() is the explicit way; feat(wasm): Let the bootstrapper fade its loader out on first frame uno#25103 switches Uno.UI to it.
Custom loaders: a .uno-loader marked data-uno-loader="custom" is the app's. The build doesn't inline the framework loader stylesheet, and the bootstrapper only publishes data-phase, data-state and --uno-loader-progress on it (plus uno-loader-phase/-state/-progress events, also for the built-in loader), never touches its content, and removes it once its own .uno-leaving transition ends.
AppManifest baked into index.html: colors and logo (with a <picture> source for splashScreenImageDark) are written into the loader markup at build time, so the first paint is final. With a CSP, the bootstrapper still applies them at runtime.
Older index.html files with the pre-Fluent markup get UNOWA0014, reported as a message so warnings-as-errors builds keep working.
Fix:cleanupInit removed the loader even when the app marked it uno-keep-loader, depending on timing.
Stylesheets (breaking):uno-bootstrap.css is inlined in index.html when no CSP is configured, so the loader paints with the HTML; with a CSP it stays a render-blocking link. Other stylesheets, including the app's WasmCSS, load as media="print" and are switched to all by the bootstrapper, so they never delay the loader. CSS that restyled the loader from WasmCSS now applies after the first paint: use the manifest or a custom loader instead (documented).
The default logo URL no longer replaces a logo set in index.html.
Compatibility:index.html files with the earlier markup keep a bottom progress bar. The <progress> element stays for accessibility and existing hooks; missing elements are skipped.
loading-position="top" puts the bar in a full-width strip along the top edge of the window.
New Uno.Wasm.Tests.Loader (CI, linux), on the RayTracer (now with an AppManifest.js with per-theme colors), 26 checks, all passing locally:
The loader stylesheet is inlined and the manifest baked: the light and dark backgrounds are right on the first paint.
The logo is centred in the viewport (0.0 px off); nothing takes space below the bar by default.
The loader goes through download, then starting, and is removed once the app runs.
Uno Platform's hand-off (keep mode): the loader stays while marked uno-keep-loader; when the app removes it, it's put back in the same frame, fades out and is removed after ~330 ms.
Custom loader (custom mode): content and attributes untouched, phase events received, its own 400 ms exit transition runs before removal.
Slow, offline and failed states as before; the failed text is evenly spaced (24 px above and below) and in the same color as the value.
Added since: offline and failed text fit on a 667×375 window; loading-position="top" runs along the window's top edge; readable text on a dark custom background in light mode and a light one in dark mode; an app foreground color wins. These new e2e checks run in CI; locally they were verified against the template and stylesheet in Chrome, along with a contrast sweep of 1,836 backgrounds per theme (worst 4.57:1 for text and the Reload label) and a fit sweep over 6 window sizes, both layouts and all states.
Unit tests (Given_LoaderMarkup, 137 total in the project, all passing) cover manifest parsing and baking (including foreground colors and splashScreenColor through both theme variables), precedence, rejected colors and script URLs, custom and older markup. Building with a custom and an older index.html checked that the framework stylesheet is left out and that UNOWA0014 is reported.
Also checked on a simulated 3G link: the bar follows the progress (eased, monotonic) and dims to an indeterminate sweep for "Starting…". The failed state was checked in light and dark, and the size format shows the MB downloaded.
Bootstrap CSS override is ignored when selecting the first asset
src/Uno.Wasm.Bootstrap/ShellTask.cs:733
The resource search order intentionally puts bootstrap CSS first and application CSS last so apps can override it (ShellTask.cs:490-502), but FirstOrDefault always inlines the bootstrap copy. An app-provided WasmCSS/uno-bootstrap.css is therefore ignored in the generated HTML. Select the last matching asset to preserve the established override order.
Offline status currently overrides every non-failed phase. If connectivity drops after RuntimeReady() has declared downloads complete, the starting phase incorrectly changes to “You're offline” and claims loading waits for reconnection. Restrict this state to connect and download, as already done for slow/retry states.
Add tests for slow, offline, and retry states
src/Uno.Wasm.Tests.Loader/app.js:59
The dedicated loader test covers only the normal ok path and runtime failure; it never drives the new slow, offline, or retry states. Add browser scenarios for those advertised states (including offline during versus after downloads) so the implementation and the spec's validation claim stay aligned.
@MartinZikmund answering your questions here as the doc you shred does not have seem to have an input field.
Q1: Keep it simple for now, but yes it would be best to have a catchall that does not point the finger at the connection
Q2: Bar weight is correct in this situation
Q3: The shine on the bar is alittle busy perhaps it should not bleed into unfilled area of the bar.
Q4:The main issue with those icons is that they do not render correctly, they seem to be multiple paths instead of a single merged path as the circle and the inner icon are not aligned properly. Having the Fluent icons would be nice to have for consistency with the UI being loaded.
Q5: It's barely noticeable
Q6: Acceptable given removing the shine on the unused track would somewhat mitigate the issue, but why not adjust it to avoid compliance issues?
Q7: See Q3 and Q6, the shine over the blue area in dark them should have it's own hue.
Q8: Keep
Q9: I would remove "Your" and "We"
We couldn't load the app -> Could not load app
You're offline -> Device offline
Recommend making logo 30% of heaight instead of the 40% in the spec as it's huge and too close to the text. Logos should optimilly be at least 1x [logo height or width] away from any other element in a layout.
Also recommend removing the colors from the warning and error icons as there are a lot of colors flashing about with the animated logo and progress indicators.
@NVLudwig thanks, this was really useful. Everything is applied in 23065b8, and the design sheet now renders the updated loader.
Your note
Change
Q1 neutral failure copy
"Could not load app" / "Reload the page to try again." No mention of the connection.
Q2, Q5, Q8
Kept as they were.
Q3 shine bleeds into the track
Clipped to the filled part.
Q4 icons don't render right
Replaced with the Fluent System Icons Warning and Error Circle (16, filled). Each is a single merged path drawn as a mask, so the circle and glyph line up.
Q6 track contrast
Two options, see below.
Q7 dark shine hue
In dark theme the shine is a light tint of the accent (color-mix) instead of white, so it shows on #60CDFF and follows custom accents.
Q9 wording
"Could not load app", "Device offline", "Connection looks slow. This can take a minute.", "Loading continues once the connection is back."
1. logo size
At most 30% of the height (was 40%). The gap below now grows with the window: 8% of the viewport height, between 32 and 96 px. A full 1× logo height pushed the bar well below centre on short windows, so this goes part of the way. Let me know if you want more.
2. icon colours
The icons now use the status text colour; the warning and error colours are removed.
One decision for you (Q6). A full-height track can't reach 3:1 against the background without the blue fill blending into it: at 45% black the fill-to-track contrast drops to 1.58:1 in light theme. Two options are side by side in the sheet's Round 2 section:
A, WinUI style (in the PR now): a 1 px track at 45% black / 54% white (3.24:1 / 5.72:1, as WinUI's ProgressBar) under the 4 px fill, which stands out by its weight.
B, middle ground: a full 4 px track at 16% / 22% (1.45:1 / 2.05:1). Doesn't reach 3:1, but the fill keeps 3.5:1+ against the track.
@NVLudwig update on Q6: we went with B, the full 4 px track at 16% black / 22% white (3372ff0). With muted custom accents, such as a sage green, the 1 px strong track of option A ended up nearly the same contrast as the fill (1.2–1.45:1), while B keeps them clearly apart.
Also fixed while reviewing: the logo and bar no longer jump up when the Reload button appears in the failed state. The button now sits outside the layout, below the hint (4b15bd7, with a test in b8ae62a). The design sheet is updated.
@kazo0 (review summary): both pre-merge items are fixed. The failed overlay no longer re-shows after dismissLoader() (566c87d), and the page-wide color-scheme meta is gone (e5a6f19). configLoader now always runs, with baking kept only for the first paint (10f66e2). Together with e0f5f82, that covers the dropped-value, CSP, precedence and dark-logo threads. All 10 inline threads were replied to and resolved.
Code quality (fillStyle reset in the loader test): intentional, explained inline.
@NVLudwig: the logo size / layout question above is still open.
The reason will be displayed to describe this comment to others. Learn more.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed to weigh multiple unpublished concerns spanning loader lifecycle, manifest baking, custom-loader ownership, and accessibility.
Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.
Queue this pull request
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
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.
Fixes #1094
Includes the theme-aware splash commit from
dev/mazi/theme-aware-splash: per-theme background and image, withsplashScreenColoronly used without per-theme values.What changed
The loader showed a thin bar at the bottom of the page. It sat at ~95% while the app initialized after the downloads, and gave no feedback when the connection was slow, offline or failing.
ExtendedSplashScreendraws it, so the hand-off doesn't jump; the bar and text hang below it. On very short screens (landscape phones) everything stays on screen: without text the logo stays centred and shrinks just enough for the bar; when text or the Reload button is shown, it moves up (at most to 16 px from the top) and shrinks only as much as they need. The background is set onhtml/bodytoo, so there's no white flash before a dark app.WasmShellLoaderProgressFormat(percent, orsizemeasured withPerformanceObserver), set 14/20 semibold in the secondary colour, andWasmShellLoaderStatusText=true("Getting ready…", "Downloading app", "Starting…" and the slow-connection hint). Retry, offline and failed are always described, below the group, so the logo and bar don't move (except on screens too short to fit the text). When startup fails, the bar and value are removed and the text sits 24 px below the logo, with Reload 24 px below it.WasmShellLoaderLogoAnimation=falsekeeps the logo still (it breathes by default).MonochromaticOverlayPresenter, all text and icons (outlined Fluent Warning / Error Circle) draw in one secondary color. Unless the app sets one (foregroundColor,lightThemeForegroundColor,darkThemeForegroundColorin the AppManifest), it's derived from the background's WCAG luminance with CSS relative colors, keeping at least 4.5:1 on any background (5.93:1 / 9.44:1 like the default palette, black or white near the middle); the track follows the background and the Reload label the accent. Default colors give exactly the default palette; browsers without relative colors use it too.splashScreenColornow sets both theme backgrounds, so its text is derived as well.online/offlineevents), retrying (from the resilient loader's counters, when fix: Retry and time out boot downloads #1095 is present), and failed, with a Reload button, when runtime initialization throws.transformandopacity, so they keep running while the main thread compiles WebAssembly; a 3 s main-thread block still rendered ~60 fps in the prototype. Retrying and offline use slower motion.prefers-reduced-motionturns it off.Bootstrapper.dismissLoader()is the explicit way; feat(wasm): Let the bootstrapper fade its loader out on first frame uno#25103 switches Uno.UI to it..uno-loadermarkeddata-uno-loader="custom"is the app's. The build doesn't inline the framework loader stylesheet, and the bootstrapper only publishesdata-phase,data-stateand--uno-loader-progresson it (plusuno-loader-phase/-state/-progressevents, also for the built-in loader), never touches its content, and removes it once its own.uno-leavingtransition ends.index.html: colors and logo (with a<picture>source forsplashScreenImageDark) are written into the loader markup at build time, so the first paint is final. With a CSP, the bootstrapper still applies them at runtime.index.htmlfiles with the pre-Fluent markup getUNOWA0014, reported as a message so warnings-as-errors builds keep working.cleanupInitremoved the loader even when the app marked ituno-keep-loader, depending on timing.uno-bootstrap.cssis inlined inindex.htmlwhen no CSP is configured, so the loader paints with the HTML; with a CSP it stays a render-blocking link. Other stylesheets, including the app'sWasmCSS, load asmedia="print"and are switched toallby the bootstrapper, so they never delay the loader. CSS that restyled the loader fromWasmCSSnow applies after the first paint: use the manifest or a custom loader instead (documented).index.html.index.htmlfiles with the earlier markup keep a bottom progress bar. The<progress>element stays for accessibility and existing hooks; missing elements are skipped.loading-position="top"puts the bar in a full-width strip along the top edge of the window.Validation
New
Uno.Wasm.Tests.Loader(CI, linux), on the RayTracer (now with anAppManifest.jswith per-theme colors), 26 checks, all passing locally:download, thenstarting, and is removed once the app runs.keepmode): the loader stays while markeduno-keep-loader; when the app removes it, it's put back in the same frame, fades out and is removed after ~330 ms.custommode): content and attributes untouched, phase events received, its own 400 ms exit transition runs before removal.loading-position="top"runs along the window's top edge; readable text on a dark custom background in light mode and a light one in dark mode; an app foreground color wins. These new e2e checks run in CI; locally they were verified against the template and stylesheet in Chrome, along with a contrast sweep of 1,836 backgrounds per theme (worst 4.57:1 for text and the Reload label) and a fit sweep over 6 window sizes, both layouts and all states.Unit tests (
Given_LoaderMarkup, 137 total in the project, all passing) cover manifest parsing and baking (including foreground colors andsplashScreenColorthrough both theme variables), precedence, rejected colors and script URLs, custom and older markup. Building with a custom and an olderindex.htmlchecked that the framework stylesheet is left out and thatUNOWA0014is reported.Also checked on a simulated 3G link: the bar follows the progress (eased, monotonic) and dims to an indeterminate sweep for "Starting…". The failed state was checked in light and dark, and the size format shows the MB downloaded.
🤖 Generated with Claude Code
https://claude.ai/code/session_01N5azy6DU7ujLte16VPVYQs