feat: add FlowPilot and FlowPilot Cockpit to sidebar navigation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-04-02 17:32:40 +00:00
parent b994e82c56
commit 3ce4201d62

View File

@@ -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<SidebarStatsResponse | null>(null)
const [flyoutIndex, setFlyoutIndex] = useState<string | null>(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 },
],