Skip to content

perf(startup): white flash before splash on launch #75

Description

@NicolaasGrobler

Symptom

When v1.0.15 opens on Windows, the window briefly flashes white before settling into the dark UI. The cold-start splash from #72 was supposed to paint immediately, but the white flash appears before it.

Likely causes

  1. WebView2's default background is white. Between the OS allocating the window (now visible immediately per perf(startup): 5-8s cold start — Argon2 not cached, window hidden until React mounts #72) and WebView2 finishing the HTML parse, the OS-allocated canvas is white. No CSS rule on html/body can prevent this — the canvas exists before any HTML loads.

  2. Splash theme mismatch. The index.html splash uses @media (prefers-color-scheme: light) to switch colors. If the OS reports light but the app is in dark mode (the default), the splash itself flashes light before React mounts in dark.

Fix plan

  1. Set the window background color natively. Tauri 2's tauri.conf.json window config supports backgroundColor. Set it to #0b0f17 (matches the dark theme surface) so the OS-allocated canvas is dark from the moment the window appears. If the JSON-level option doesn't work, fall back to setting it in setup() from lib.rs via WebviewWindow::set_background_color().

  2. Decide on the splash. With the Argon2-cache fix in v1.0.15, time-to-React-mount is short enough that the splash is barely visible anyway. Either:

    • Remove the splash entirely. Window appears dark, then UI paints. Simplest.
    • Keep the splash but lock it to dark only (drop the prefers-color-scheme rule) since the app currently boots into dark by default.

Leaning toward removal — less moving parts and the user explicitly asked "could we not have a splash there".

Acceptance

  • No visible white flash on cold start (Windows; verify on Linux + macOS too).
  • App opens straight into the dark UI without any intermediate color.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingperformancePerformance and bundle size

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions