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 (