From 5f4d9bf7898450772c02584756049a7cd624b136 Mon Sep 17 00:00:00 2001 From: Grovy311 Date: Sat, 26 Sep 2026 12:57:50 +0200 Subject: [PATCH] Show the sidebar on every page except the print view AppShell showed the sidebar only on the project list and overview, so it disappeared on the building structure page and in the circuit list editor. It is collapsible, so it now stays on every page. Only the print view, a stand-alone document opened in its own tab and printed as PDF, keeps the full width. Co-Authored-By: Claude Opus 5.5 --- src/app/globals.css | 2 +- src/frontend/components/AppShell.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index f392303..0c40c5c 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -220,7 +220,7 @@ a { --bs-alert-border-color: #205a38; } -/* ── App-Shell / Seitenleiste (nur auf der Projektseite) ────────────────── */ +/* ── App-Shell / Seitenleiste (alle Seiten außer der Seitenansicht) ──── */ .app-shell { display: grid; diff --git a/src/frontend/components/AppShell.tsx b/src/frontend/components/AppShell.tsx index bbfa0ae..77b7c78 100644 --- a/src/frontend/components/AppShell.tsx +++ b/src/frontend/components/AppShell.tsx @@ -4,12 +4,14 @@ import { useEffect, useState } from "react"; import { usePathname } from "next/navigation"; import { Sidebar } from "./Sidebar"; -const PROJECT_AREA_PATTERN = /^\/projects(\/[^/]+)?$/; +// Every page shows the (collapsible) sidebar except the print view, which is +// a stand-alone document opened in its own tab and printed as PDF. +const PRINT_VIEW_PATTERN = /^\/projects\/[^/]+\/print(\/|$)/; const SIDEBAR_COLLAPSED_STORAGE_KEY = "leistungsbilanz:sidebar-collapsed"; export function AppShell({ children }: { children: React.ReactNode }) { const pathname = usePathname(); - const showSidebar = PROJECT_AREA_PATTERN.test(pathname ?? ""); + const showSidebar = !PRINT_VIEW_PATTERN.test(pathname ?? ""); const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(false); useEffect(() => {