From b97df50d00e1a0951dad15b2bd2c05d6ea70c6fd Mon Sep 17 00:00:00 2001 From: Abhishek Choudhary Date: Mon, 24 Aug 2026 16:39:30 +0545 Subject: [PATCH] fix(docs): restore collapsible sidebar categories --- next/src/components/SidebarNodes.astro | 19 +++++++++++++------ next/src/styles/global.css | 20 +++++++++++++++++++- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/next/src/components/SidebarNodes.astro b/next/src/components/SidebarNodes.astro index 3ac471d0490dd..230d74616fe61 100644 --- a/next/src/components/SidebarNodes.astro +++ b/next/src/components/SidebarNodes.astro @@ -17,15 +17,22 @@ const { nodes, active, titleById, urlById } = Astro.props; /** Keep anything that links somewhere or that still has renderable children. */ const renderable = (n: SidebarNode): boolean => Boolean(n.id) || (Array.isArray(n.items) && n.items.some(renderable)); + +const hasChildren = (n: SidebarNode): boolean => + Array.isArray(n.items) && n.items.some(renderable); ---