From 7ae5facd0cb19685c47d68f851488b222f72d620 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Wed, 18 Mar 2026 15:38:58 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20proper=20dashboard=20layout=20=E2=80=94?= =?UTF-8?q?=20header=20+=20sidebar=20+=20content=20fill=20viewport?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use h-screen overflow-hidden on the root container for authenticated views. Sidebar and content fill the remaining height below the header. Remove footer from dashboard pages. Content scrolls inside its own container, sidebar stays fixed in place. --- app/layout-content.tsx | 109 ++++++++++++------------ components/dashboard/DashboardShell.tsx | 4 +- components/dashboard/Sidebar.tsx | 2 +- 3 files changed, 58 insertions(+), 57 deletions(-) diff --git a/app/layout-content.tsx b/app/layout-content.tsx index ccf5075..55111d5 100644 --- a/app/layout-content.tsx +++ b/app/layout-content.tsx @@ -112,65 +112,66 @@ function LayoutInner({ children }: { children: React.ReactNode }) { return } + const headerElement = ( +
: null} + apps={CIPHERA_APPS} + currentAppId="pulse" + onOpenSettings={openSettings} + leftActions={isAuthenticated ? : undefined} + customNavItems={ + <> + {!auth.user && ( + + Features + + )} + + } + /> + ) + + if (isAuthenticated) { + // Dashboard layout: header pinned, sidebar + content fill remaining viewport + return ( +
+ {auth.user && } +
{headerElement}
+ {children} + +
+ ) + } + + // Public/marketing layout: floating header, scrollable page, footer return (
- {auth.user && } -
+ {children} + +
: null} - apps={CIPHERA_APPS} - currentAppId="pulse" - onOpenSettings={openSettings} - leftActions={isAuthenticated ? : undefined} - customNavItems={ - <> - {!auth.user && ( - - Features - - )} - - } + isAuthenticated={false} /> - {isAuthenticated ? ( - // Authenticated: sidebar layout — children include DashboardShell - <>{children} - ) : ( - // Public: standard content with footer - <> -
- {children} -
-
- - )} - {isAuthenticated && ( -
- )}
) diff --git a/components/dashboard/DashboardShell.tsx b/components/dashboard/DashboardShell.tsx index a2aeb3c..bd83581 100644 --- a/components/dashboard/DashboardShell.tsx +++ b/components/dashboard/DashboardShell.tsx @@ -13,9 +13,9 @@ export default function DashboardShell({ const { mobileOpen, closeMobile } = useSidebar() return ( -
+
-
+
{children}
diff --git a/components/dashboard/Sidebar.tsx b/components/dashboard/Sidebar.tsx index ad08a1d..b47884d 100644 --- a/components/dashboard/Sidebar.tsx +++ b/components/dashboard/Sidebar.tsx @@ -319,7 +319,7 @@ export default function Sidebar({ {/* Desktop sidebar */}