diff --git a/docs/app/components/docs/sidebar.tsx b/docs/app/components/docs/sidebar.tsx index 391a9cdb..794e3556 100644 --- a/docs/app/components/docs/sidebar.tsx +++ b/docs/app/components/docs/sidebar.tsx @@ -103,7 +103,9 @@ function NavLink({ node, current }: { node: NavNode; current: string }) { ); } -/** A subsection with children — collapsible, auto-opens around the active page. */ +/** A subsection with children — collapsible at any depth, auto-opens around the + * active page. The label itself toggles (same behaviour as a top-level group), + * so a subsection-of-a-subsection expands/collapses on click just like its parent. */ function NavSection({ node, current }: { node: NavNode; current: string }) { const active = node.children?.some((c) => containsHref(c, current)) ?? false; const [open, setOpen] = useState(active); @@ -112,15 +114,21 @@ function NavSection({ node, current }: { node: NavNode; current: string }) { setOpen(true); } }, [active]); + const toggle = () => setOpen((o) => !o); return (