diff --git a/src/components/NavigationMenu.tsx b/src/components/NavigationMenu.tsx index 3db0af6..b0af8e5 100644 --- a/src/components/NavigationMenu.tsx +++ b/src/components/NavigationMenu.tsx @@ -3,6 +3,7 @@ import { Button } from '@/components/ui/button' import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from '@/components/ui/sheet' import { ScrollArea } from '@/components/ui/scroll-area' import { Badge } from '@/components/ui/badge' +import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible' import { List, ChartBar, @@ -21,6 +22,7 @@ import { DeviceMobile, Image, Faders, + CaretDown, } from '@phosphor-icons/react' import { FeatureToggles } from '@/types/project' @@ -53,6 +55,9 @@ export function NavigationMenu({ errorCount = 0, }: NavigationMenuProps) { const [open, setOpen] = useState(false) + const [expandedGroups, setExpandedGroups] = useState>( + new Set(['overview', 'development', 'automation', 'design', 'backend', 'testing', 'tools']) + ) const navigationGroups: NavigationGroup[] = [ { @@ -234,6 +239,18 @@ export function NavigationMenu({ setOpen(false) } + const toggleGroup = (groupId: string) => { + setExpandedGroups((prev) => { + const newSet = new Set(prev) + if (newSet.has(groupId)) { + newSet.delete(groupId) + } else { + newSet.add(groupId) + } + return newSet + }) + } + const isItemVisible = (item: NavigationItem) => { if (!item.featureKey) return true return featureToggles[item.featureKey] @@ -255,51 +272,71 @@ export function NavigationMenu({ Navigation -
+
{navigationGroups.map((group) => { const visibleItemsCount = getVisibleItemsCount(group) if (visibleItemsCount === 0) return null + const isExpanded = expandedGroups.has(group.id) + return ( -
-

- {group.label} -

-
- {group.items.map((item) => { - if (!isItemVisible(item)) return null + toggleGroup(group.id)} + > + + +

+ {group.label} +

+ + {visibleItemsCount} + +
+ +
+ {group.items.map((item) => { + if (!isItemVisible(item)) return null - const isActive = activeTab === item.value + const isActive = activeTab === item.value - return ( - - ) - })} -
-
+ return ( + + ) + })} +
+ + ) })}