From 750c0ae10fef6ac49fcdb4b18769404d7faec05f Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Fri, 16 Jan 2026 03:51:01 +0000 Subject: [PATCH] Generated by Spark: Add expand/collapse all button --- src/components/NavigationMenu.tsx | 35 ++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/components/NavigationMenu.tsx b/src/components/NavigationMenu.tsx index b0af8e5..33f16eb 100644 --- a/src/components/NavigationMenu.tsx +++ b/src/components/NavigationMenu.tsx @@ -23,6 +23,8 @@ import { Image, Faders, CaretDown, + CaretDoubleDown, + CaretDoubleUp, } from '@phosphor-icons/react' import { FeatureToggles } from '@/types/project' @@ -260,6 +262,17 @@ export function NavigationMenu({ return group.items.filter(isItemVisible).length } + const handleExpandAll = () => { + const allGroupIds = navigationGroups + .filter((group) => getVisibleItemsCount(group) > 0) + .map((group) => group.id) + setExpandedGroups(new Set(allGroupIds)) + } + + const handleCollapseAll = () => { + setExpandedGroups(new Set()) + } + return ( @@ -271,7 +284,27 @@ export function NavigationMenu({ Navigation - +
+ + +
+
{navigationGroups.map((group) => { const visibleItemsCount = getVisibleItemsCount(group)