[WebUI] PWA cold start shows a long blank screen before first paint
Bug Description
Cold starting the installed PWA (first open, or after the app is evicted and relaunched) shows a blank screen for a noticeable amount of time before anything renders. Launching from the home screen icon feels slower than opening the same page in Safari.
Steps to Reproduce
- Install the WebUI to the home screen on iOS, and on Android for comparison.
- Force-quit the app, then relaunch it from the home screen icon.
- Observe the blank screen before the app shell paints.
Expected Behavior
Launch should paint the app shell promptly, following the iOS and Android PWA conventions:
- iOS should show a launch screen via
apple-touch-startup-imageinstead of a blank surface while the web content loads. - The app shell should be able to paint from cache on launch instead of waiting for a network round trip.
Additional Context
Client: iPhone Air, iOS 27, standalone PWA, self-hosted deployment over HTTPS.
Two concrete causes, both verified in the current tree:
- No iOS launch screen is served.
webui/index.htmlhas noapple-touch-startup-imagelink and no launch screens are shipped, so iOS has nothing to display during launch and shows a blank screen. - The service worker serves the app shell network-first. In
webui/public/sw.js,/is listed inNETWORK_FIRST_STATIC_PATHS, and the navigation path isfetch(request)with a cache fallback only when the network fails. First paint therefore depends on network latency on every cold start even when a valid cached shell exists, which is the worst case on a high-latency or restricted link. A stale-while-revalidate path for the shell would paint immediately and still pick up updates in the background.
Note that a shell is precached in PRECACHE (/, /manifest.json, /asset-manifest.json), so
the cached copy exists but is not used on the fast path.
The inline boot splash in webui/index.html (.boot-splash) only appears after the document is
parsed, so it cannot cover the native launch gap described in (1).
Source: HKUDS/nanobot