From 4322446fcf289abcdff797b3e93b69ce43cd6a71 Mon Sep 17 00:00:00 2001 From: Jonas Bengtsson Date: Sat, 19 Sep 2026 18:29:00 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Update=20menu=20looks=20and=20be?= =?UTF-8?q?haviour?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.tsx | 80 ++++++++++++++++++++-------- frontend/src/styles.css | 112 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 160 insertions(+), 32 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 20505c2..a763b2b 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,3 +1,4 @@ +import { useState } from "react"; import { NavLink, Navigate, Route, Routes, useLocation } from "react-router-dom"; import { useQuery } from "@tanstack/react-query"; import { useAuth } from "./auth"; @@ -83,33 +84,70 @@ function RestartIndicator() { function Layout({ children }: { children: React.ReactNode }) { const { session, logout } = useAuth(); + const location = useLocation(); + // Exactly ONE group is open at a time (null = all closed). The group + // containing the ACTIVE page auto-opens, so navigation (including the + // restart-needed indicator link) always reveals its section. + const [openSection, setOpenSection] = useState(null); + + const activeSection = NAV_SECTIONS.find((section) => + section.items.some( + (item) => + item.to && + item.to.split("#")[0] === location.pathname, + ), + ); + return (