fix(ui): library-switch overlay was fully opaque — the 'new page' wipe

The switch overlay intended a 50% dim (bg-opacity-50) but set its
background with an inline style — Tailwind's bg-opacity variable does
not apply to inline styles, so the overlay rendered fully opaque. Every
library switch wiped the material area to a solid sheet (chrome stays
visible: the sidebar sits at z-60 above the overlay's z-50) and
hard-cut back when the overlay dropped — reading exactly as a new page
instead of a fade. The dashboard showed it worst because its switch
holds the overlay longest (sections fetch + awaited week-widget refresh
behind it).

- overlay background is now theme-aware translucent
  (color-mix 55% bg-primary over transparent); the dead bg-opacity-50
  class is gone
- the dim lifts before the fade-in starts, so the new content's fade
  plays fully visible rather than being hard-cut mid-transition
This commit is contained in:
John O'Keefe committed 2026-10-18 13:16:35 -04:00
1 parent 040c10ac76
commit a11b4a9cc4
3 files changed
+8 -3

No files matched your search

+5
View File
@@ -27,6 +27,11 @@ export async function switchWithTransition(
await fetchFn();
// Lift the dim BEFORE the fade-in starts, so the new content's fade
// plays fully visible instead of being hard-cut by the overlay
// disappearing mid-transition.
loading.classList.add("hidden");
container.classList.remove("duration-150");
container.classList.add("duration-300");
void container.offsetHeight;