diff --git a/frontend/src/components/layout/Sidebar.tsx b/frontend/src/components/layout/Sidebar.tsx index 506438a5..f8c400df 100644 --- a/frontend/src/components/layout/Sidebar.tsx +++ b/frontend/src/components/layout/Sidebar.tsx @@ -5,13 +5,14 @@ import { LayoutGrid, Clock, AlertTriangle, GitBranch, Code2, Wand2, ListChecks, Download, BarChart3, Settings, Pin, PinOff, - History, FileText, + History, FileText, Sparkles, } from 'lucide-react' import { cn } from '@/lib/utils' import { useUserPreferencesStore } from '@/store/userPreferencesStore' import { sidebarApi } from '@/api' import type { SidebarStatsResponse } from '@/api/sidebar' import { prefetchForRoute } from '@/lib/routePrefetch' +import { useFeatureFlag } from '@/hooks/useFeatureFlag' /* ── Types ──────────────────────────────────────────── */ @@ -42,6 +43,7 @@ export function Sidebar() { const location = useLocation() const sidebarPinned = useUserPreferencesStore(s => s.sidebarPinned) const toggleSidebarPinned = useUserPreferencesStore(s => s.toggleSidebarPinned) + const hasCockpit = useFeatureFlag('flowpilot_cockpit') const [stats, setStats] = useState(null) const [flyoutIndex, setFlyoutIndex] = useState(null) @@ -74,6 +76,14 @@ export function Sidebar() { href: '/', icon: LayoutGrid, label: 'Home', shortLabel: 'Home', matchPaths: ['/'], }, + { + href: '/assistant', icon: Sparkles, label: 'FlowPilot', shortLabel: 'FP', + matchPaths: ['/assistant', '/cockpit'], + children: [ + { href: '/assistant', label: 'FlowPilot' }, + ...(hasCockpit ? [{ href: '/cockpit', label: 'FlowPilot Cockpit' }] : []), + ], + }, { href: '/sessions', icon: History, label: 'History', shortLabel: 'History', badge: stats?.active_count || undefined, @@ -118,6 +128,8 @@ export function Sidebar() { title: 'RESOLVE', items: [ { href: '/', icon: LayoutGrid, label: 'Dashboard', shortLabel: 'Dash' }, + { href: '/assistant', icon: Sparkles, label: 'FlowPilot', shortLabel: 'FP', matchPaths: ['/assistant', '/cockpit'] }, + ...(hasCockpit ? [{ href: '/cockpit', icon: Sparkles, label: 'FlowPilot Cockpit', shortLabel: 'Cockpit', matchPaths: ['/cockpit'] } as NavEntry] : []), { href: '/sessions', icon: Clock, label: 'Session History', shortLabel: 'History', badge: stats?.active_count || undefined, matchPaths: ['/sessions'] }, { href: '/escalations', icon: AlertTriangle, label: 'Escalations', shortLabel: 'Escal', badge: stats?.escalation_count || undefined }, ],