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:
@@ -5,13 +5,14 @@ import {
|
|||||||
LayoutGrid, Clock, AlertTriangle, GitBranch, Code2, Wand2,
|
LayoutGrid, Clock, AlertTriangle, GitBranch, Code2, Wand2,
|
||||||
ListChecks, Download, BarChart3,
|
ListChecks, Download, BarChart3,
|
||||||
Settings, Pin, PinOff,
|
Settings, Pin, PinOff,
|
||||||
History, FileText,
|
History, FileText, Sparkles,
|
||||||
} from 'lucide-react'
|
} from 'lucide-react'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
import { useUserPreferencesStore } from '@/store/userPreferencesStore'
|
import { useUserPreferencesStore } from '@/store/userPreferencesStore'
|
||||||
import { sidebarApi } from '@/api'
|
import { sidebarApi } from '@/api'
|
||||||
import type { SidebarStatsResponse } from '@/api/sidebar'
|
import type { SidebarStatsResponse } from '@/api/sidebar'
|
||||||
import { prefetchForRoute } from '@/lib/routePrefetch'
|
import { prefetchForRoute } from '@/lib/routePrefetch'
|
||||||
|
import { useFeatureFlag } from '@/hooks/useFeatureFlag'
|
||||||
|
|
||||||
/* ── Types ──────────────────────────────────────────── */
|
/* ── Types ──────────────────────────────────────────── */
|
||||||
|
|
||||||
@@ -42,6 +43,7 @@ export function Sidebar() {
|
|||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const sidebarPinned = useUserPreferencesStore(s => s.sidebarPinned)
|
const sidebarPinned = useUserPreferencesStore(s => s.sidebarPinned)
|
||||||
const toggleSidebarPinned = useUserPreferencesStore(s => s.toggleSidebarPinned)
|
const toggleSidebarPinned = useUserPreferencesStore(s => s.toggleSidebarPinned)
|
||||||
|
const hasCockpit = useFeatureFlag('flowpilot_cockpit')
|
||||||
|
|
||||||
const [stats, setStats] = useState<SidebarStatsResponse | null>(null)
|
const [stats, setStats] = useState<SidebarStatsResponse | null>(null)
|
||||||
const [flyoutIndex, setFlyoutIndex] = useState<string | null>(null)
|
const [flyoutIndex, setFlyoutIndex] = useState<string | null>(null)
|
||||||
@@ -74,6 +76,14 @@ export function Sidebar() {
|
|||||||
href: '/', icon: LayoutGrid, label: 'Home', shortLabel: 'Home',
|
href: '/', icon: LayoutGrid, label: 'Home', shortLabel: 'Home',
|
||||||
matchPaths: ['/'],
|
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',
|
href: '/sessions', icon: History, label: 'History', shortLabel: 'History',
|
||||||
badge: stats?.active_count || undefined,
|
badge: stats?.active_count || undefined,
|
||||||
@@ -118,6 +128,8 @@ export function Sidebar() {
|
|||||||
title: 'RESOLVE',
|
title: 'RESOLVE',
|
||||||
items: [
|
items: [
|
||||||
{ href: '/', icon: LayoutGrid, label: 'Dashboard', shortLabel: 'Dash' },
|
{ 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: '/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 },
|
{ href: '/escalations', icon: AlertTriangle, label: 'Escalations', shortLabel: 'Escal', badge: stats?.escalation_count || undefined },
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user