From dae1c97814c33c810399396806b7e5852e10d160 Mon Sep 17 00:00:00 2001 From: Colum Ferry Date: Fri, 21 Mar 2025 12:34:22 +0000 Subject: [PATCH] fix(nx-dev): sidebar should not always show angular-rs* links (#30448) ## Current Behavior The `angular-rspack` and `angular-rsbuild` packages links are always shown on the menu after navigating to the API section ## Expected Behavior The links for these packages should only display on the `API` page --- nx-dev/ui-common/src/lib/sidebar-container.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nx-dev/ui-common/src/lib/sidebar-container.tsx b/nx-dev/ui-common/src/lib/sidebar-container.tsx index aac16082fb..cae409a10a 100644 --- a/nx-dev/ui-common/src/lib/sidebar-container.tsx +++ b/nx-dev/ui-common/src/lib/sidebar-container.tsx @@ -81,6 +81,9 @@ export function SidebarContainer({ // TODO(colum): Remove this angular-rspack modification once we move angular rspack into main repo (when stable). const menuWithAngularRspack = useMemo(() => { const angularIdx = menu.sections.findIndex((s) => s.id === 'angular'); + if (angularIdx === -1) { + return menu; + } const sections = [ ...menu.sections.slice(0, angularIdx), angularRspackSection,