From a63dfa231edee14e01fa251798d557572a3d87c2 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Wed, 18 Mar 2026 18:42:36 +0100 Subject: [PATCH] fix: render empty sidebar shell until client is ready Previous opacity-0 approach still rendered DOM content which could flash during SSR hydration. Now render an empty div (just border + background, no content) at collapsed width until useEffect fires. Then swap in the real aside with content. Zero DOM content = zero possible flash of text or icons. --- components/dashboard/Sidebar.tsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/components/dashboard/Sidebar.tsx b/components/dashboard/Sidebar.tsx index 948ef0d..b566573 100644 --- a/components/dashboard/Sidebar.tsx +++ b/components/dashboard/Sidebar.tsx @@ -340,13 +340,17 @@ export default function Sidebar({ return ( <> - {/* Desktop — width transitions, internal layout never changes */} - + {/* Desktop — empty shell until ready, then real content */} + {!ready ? ( +
+ ) : ( + + )} {/* Mobile overlay */} {mobileOpen && (