ReviewOS

stacks/paweldregan

Theme-color flash on SPA navigation (regression on stx ≥0.2.40?)

#12
Open glennmichael123 opened this 8 days ago ·
8 days ago

Symptom

When navigating between pages on paweldregan.com, the inverse theme briefly flashes for a split second before the correct theme settles. Per Chris's 2026-05-07 11:36 AM task drop:

"when you change pages there, it briefly shows/flashes the inverse theme for a split second, and i thought i fixed it in a stx version already, but please improve this UX issue too"

Reference

This was supposedly fixed upstream in stx via:

f34f9b7 chore: bump @stacksjs/stx to ^0.2.40 — fix theme-color flash on SPA hop in light mode

(visible in paweldregan's git log as a dep bump). If the flash is reproducing on a build that genuinely uses stx ≥0.2.40, that's an upstream regression.

Diagnosis order

  1. Confirm paweldregan's lockfile is on stx ≥0.2.40. Check bun.lock for @stacksjs/stx resolved version. Also check what version is actually loaded at build time (bun pm why @stacksjs/stx).
  2. If pinned to <0.2.40 (transitive shenanigans, override, etc.): bump it here. Verify flash is gone.
  3. If already ≥0.2.40: this is an stx regression. Capture a minimal repro (single-page → single-page nav, light mode, dark mode), file as an issue on stacksjs/stx, and link back here.
  4. Test cross-browser (Chrome + Safari at minimum — Safari handles <meta name="theme-color"> differently from Chrome).
  5. Test in both light + dark system preferences and after manual theme toggle.

Acceptance

  • No visible inverse-theme flash on SPA navigation between any of the 5 pages (/, /about, /races, /coaching, /404) in light mode.
  • Same in dark mode.
  • Same after manual theme toggle (theme-toggle button in nav).
  • Same across en/de/pl locale switches.
  • If the fix lands upstream in stx, issue closed by a @stacksjs/stx version bump in this repo's lockfile (no in-repo workaround).

Notes

  • The recent layouts-migration commit 353e857 reorganized the head; if the flash is new since that commit, the regression may be in our layout, not in stx. Worth comparing pre/post 353e857 behavior.

Sign in to comment on this issue.