diff --git a/frontend/src/components/layout/Sidebar.tsx b/frontend/src/components/layout/Sidebar.tsx index d2eed210..6ee950d8 100644 --- a/frontend/src/components/layout/Sidebar.tsx +++ b/frontend/src/components/layout/Sidebar.tsx @@ -5,6 +5,7 @@ import { LayoutGrid, Clock, AlertTriangle, GitBranch, Layers, Code2, Wand2, ListChecks, Download, BarChart3, Rocket, BookOpen, MessageSquare, Settings, Pin, PinOff, + Zap, Database, HelpCircle, } from 'lucide-react' import { cn } from '@/lib/utils' import { useUserPreferencesStore } from '@/store/userPreferencesStore' @@ -62,6 +63,57 @@ export function Sidebar() { /* ── Navigation data ──────────────────────────────── */ + /* ── Grouped nav: 5 top-level icons (Sentry-style) ── */ + + const railGroups: NavEntry[] = [ + { + href: '/', icon: LayoutGrid, label: 'Home', shortLabel: 'Home', + matchPaths: ['/'], + }, + { + href: '/sessions', icon: Zap, label: 'Work', shortLabel: 'Work', + badge: (stats?.active_count || 0) + (stats?.escalation_count || 0) || undefined, + matchPaths: ['/sessions', '/escalations', '/pilot'], + children: [ + { href: '/sessions', label: 'Active Sessions', count: stats?.active_count || undefined }, + { href: '/escalations', label: 'Escalations', count: stats?.escalation_count || undefined }, + ], + }, + { + href: '/trees', icon: Database, label: 'Knowledge', shortLabel: 'Know', + badge: stats?.tree_counts.total || undefined, + matchPaths: ['/trees', '/flows', '/my-trees', '/step-library', '/scripts', '/script-builder', '/review-queue'], + children: [ + { href: '/trees', label: 'All Flows', count: stats?.tree_counts.total || undefined }, + { href: '/trees?type=troubleshooting', label: 'Troubleshooting', count: stats?.tree_counts.troubleshooting || undefined }, + { href: '/trees?type=procedural', label: 'Projects', count: stats?.tree_counts.procedural || undefined }, + { href: '/trees?type=maintenance', label: 'Maintenance', count: stats?.tree_counts.maintenance || undefined }, + { href: '/step-library', label: 'Step Library' }, + { href: '/scripts', label: 'Scripts' }, + { href: '/script-builder', label: 'Script Builder' }, + { href: '/review-queue', label: 'Review Queue' }, + ], + }, + { + href: '/analytics', icon: BarChart3, label: 'Insights', shortLabel: 'Data', + matchPaths: ['/analytics', '/shares'], + children: [ + { href: '/shares', label: 'Exports' }, + { href: '/analytics', label: 'Analytics' }, + { href: '/analytics/flowpilot', label: 'FlowPilot Analytics' }, + ], + }, + { + href: '/guides', icon: HelpCircle, label: 'Help', shortLabel: 'Help', + matchPaths: ['/guides', '/feedback'], + children: [ + { href: '/guides', label: 'User Guides' }, + { href: '/feedback', label: 'Feedback' }, + ], + }, + ] + + /* Pinned mode still uses the detailed section layout */ const sections: NavSection[] = [ { title: 'RESOLVE', @@ -102,8 +154,6 @@ export function Sidebar() { ] const footerItems: NavEntry[] = [ - { href: '/guides', icon: BookOpen, label: 'User Guides', shortLabel: 'Guides' }, - { href: '/feedback', icon: MessageSquare, label: 'Feedback', shortLabel: 'Feedbk' }, { href: '/account', icon: Settings, label: 'Account', shortLabel: 'Acct' }, ] @@ -167,7 +217,7 @@ export function Sidebar() { return (