From d8445a60b0a7931bdbf38424336506e49b40cafa Mon Sep 17 00:00:00 2001 From: Oliver Kieselbach Date: Wed, 18 Mar 2026 12:04:27 +0100 Subject: [PATCH] added public sites side bar --- .../autopilot-monitor-web/app/about/page.tsx | 2 - .../app/changelog/page.tsx | 3 -- .../app/privacy/page.tsx | 3 -- .../app/roadmap/page.tsx | 3 -- .../autopilot-monitor-web/app/terms/page.tsx | 3 -- .../components/GlobalSidebar.tsx | 46 +++++++++++++++---- .../tsconfig.tsbuildinfo | 2 +- 7 files changed, 39 insertions(+), 23 deletions(-) diff --git a/src/Web/autopilot-monitor-web/app/about/page.tsx b/src/Web/autopilot-monitor-web/app/about/page.tsx index c21c0035..257c6b72 100644 --- a/src/Web/autopilot-monitor-web/app/about/page.tsx +++ b/src/Web/autopilot-monitor-web/app/about/page.tsx @@ -1,13 +1,11 @@ import Link from "next/link"; import { PublicPageHeader } from "../../components/PublicPageHeader"; -import { PublicSiteNavbar } from "../../components/PublicSiteNavbar"; const VERSION = "1.0.0"; export default function AboutPage() { return (
-
diff --git a/src/Web/autopilot-monitor-web/app/changelog/page.tsx b/src/Web/autopilot-monitor-web/app/changelog/page.tsx index 27f97c55..d0d57d32 100644 --- a/src/Web/autopilot-monitor-web/app/changelog/page.tsx +++ b/src/Web/autopilot-monitor-web/app/changelog/page.tsx @@ -1,13 +1,10 @@ "use client"; -import Link from "next/link"; import { PublicPageHeader } from "../../components/PublicPageHeader"; -import { PublicSiteNavbar } from "../../components/PublicSiteNavbar"; export default function ChangelogPage() { return (
-
diff --git a/src/Web/autopilot-monitor-web/app/privacy/page.tsx b/src/Web/autopilot-monitor-web/app/privacy/page.tsx index c064891f..48a42641 100644 --- a/src/Web/autopilot-monitor-web/app/privacy/page.tsx +++ b/src/Web/autopilot-monitor-web/app/privacy/page.tsx @@ -1,11 +1,8 @@ -import Link from "next/link"; import { PublicPageHeader } from "../../components/PublicPageHeader"; -import { PublicSiteNavbar } from "../../components/PublicSiteNavbar"; export default function PrivacyPage() { return (
-
diff --git a/src/Web/autopilot-monitor-web/app/roadmap/page.tsx b/src/Web/autopilot-monitor-web/app/roadmap/page.tsx index 0cd506bf..a0022e07 100644 --- a/src/Web/autopilot-monitor-web/app/roadmap/page.tsx +++ b/src/Web/autopilot-monitor-web/app/roadmap/page.tsx @@ -1,11 +1,8 @@ -import Link from "next/link"; import { PublicPageHeader } from "../../components/PublicPageHeader"; -import { PublicSiteNavbar } from "../../components/PublicSiteNavbar"; export default function RoadmapPage() { return (
-
diff --git a/src/Web/autopilot-monitor-web/app/terms/page.tsx b/src/Web/autopilot-monitor-web/app/terms/page.tsx index 7cab348a..6aedbf7d 100644 --- a/src/Web/autopilot-monitor-web/app/terms/page.tsx +++ b/src/Web/autopilot-monitor-web/app/terms/page.tsx @@ -1,11 +1,8 @@ -import Link from "next/link"; import { PublicPageHeader } from "../../components/PublicPageHeader"; -import { PublicSiteNavbar } from "../../components/PublicSiteNavbar"; export default function TermsPage() { return (
-
diff --git a/src/Web/autopilot-monitor-web/components/GlobalSidebar.tsx b/src/Web/autopilot-monitor-web/components/GlobalSidebar.tsx index e206cff9..58513237 100644 --- a/src/Web/autopilot-monitor-web/components/GlobalSidebar.tsx +++ b/src/Web/autopilot-monitor-web/components/GlobalSidebar.tsx @@ -6,8 +6,9 @@ import { usePathname } from "next/navigation"; import { useAuth } from "../contexts/AuthContext"; import { useSidebar, PageSectionItem } from "../contexts/SidebarContext"; import { CollapseState } from "../hooks/useSidebarState"; -import { DefaultSectionIcon } from "../lib/sidebarIcons"; +import { DefaultSectionIcon, BookOpenIcon, RocketLaunchIcon, InformationCircleIcon, DocumentTextIcon, ShieldCheckIcon } from "../lib/sidebarIcons"; import { DASHBOARD_ITEM, NAV_GROUPS, REGULAR_USER_ITEMS, NavItem, NavGroup } from "../lib/globalNavConfig"; +import { PublicSiteNavbar } from "./PublicSiteNavbar"; // Sidebar pixel widths export const SIDEBAR_PX: Record = { @@ -134,18 +135,23 @@ export function GlobalSidebar({ children }: { children: ReactNode }) { // Docs pages are always accessible (public + authenticated) const isDocsPage = pathname.startsWith("/docs"); + // All public pages that should show sidebar + navbar + const PUBLIC_PATHS = ["/docs", "/terms", "/privacy", "/roadmap", "/about", "/changelog"]; + const isPublicPage = PUBLIC_PATHS.some((p) => pathname === p || pathname.startsWith(p + "/")); + // Landing page: never show sidebar if (pathname === "/") { return <>{children}; } - // Not authenticated and not docs: no sidebar - if (!isAuthenticated && !isDocsPage) { + // Not authenticated and not a public page: no sidebar + if (!isAuthenticated && !isPublicPage) { return <>{children}; } - // Whether the main Navbar is present (determines sidebar top offset) - const hasNavbar = isAuthenticated; + // Whether a top navbar is present (determines sidebar top offset) + // Authenticated users always have the app navbar; public pages have the PublicSiteNavbar + const hasNavbar = isAuthenticated || isPublicPage; // --- Render helpers --- @@ -156,6 +162,7 @@ export function GlobalSidebar({ children }: { children: ReactNode }) { const isNavActive = (href: string) => { if (href === "/dashboard") return pathname === "/dashboard" || pathname === "/"; + if (href === "/") return pathname === "/"; return pathname.startsWith(href); }; @@ -308,15 +315,35 @@ export function GlobalSidebar({ children }: { children: ReactNode }) { )} - {/* Public (unauthenticated): show Home link to landing page */} + {/* Public (unauthenticated): show public nav items */} {!isAuthenticated && ( - renderGlobalItem({ id: "home", label: "Home", href: "/", icon: DASHBOARD_ITEM.icon }) + <> + {renderGlobalItem({ id: "home", label: "Home", href: "/", icon: DASHBOARD_ITEM.icon })} +
+
    + {renderGlobalItem({ id: "docs", label: "Docs", href: "/docs", icon: })} + {renderGlobalItem({ id: "roadmap", label: "Roadmap", href: "/roadmap", icon: })} + {renderGlobalItem({ id: "about", label: "About", href: "/about", icon: })} + {renderGlobalItem({ id: "terms", label: "Terms", href: "/terms", icon: })} + {renderGlobalItem({ id: "privacy", label: "Privacy", href: "/privacy", icon: })} +
+
+ )} {/* Divider (only when both global nav and page sections exist) + page sections */} {hasPageSections && ( <> - {/* Divider only when global nav is also shown */} + {/* Divider / spacing between nav and page sections */} + {!isAuthenticated && ( + collapseState === "icons" && !isMobile ? ( +
+ ) : ( +
+
+
+ ) + )} {isAuthenticated && ( collapseState === "icons" && !isMobile ? (
@@ -341,6 +368,9 @@ export function GlobalSidebar({ children }: { children: ReactNode }) { return ( <> + {/* ===== Public pages: show branded navbar without section links ===== */} + {!isAuthenticated && isPublicPage && } + {/* ===== Mobile: overlay ===== */} {mobileDrawerOpen && (