Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 57 additions & 44 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,62 +15,75 @@ import { useAuthStoreIntegration } from '@/auth/store-integration'
import { ProtectedRoute } from '@/components/auth/ProtectedRoute'
import { AnalyticsRouterListener } from '@/features/analytics/AnalyticsRouterListener'
import { PostHogClerkBridge } from '@/features/analytics/PostHogClerkBridge'
import { CommandPalette, useCommandPaletteKeyboard } from '@/features/command-palette'

function AuthIntegration({ children }: { children: React.ReactNode }) {
useAuthStoreIntegration()
return <>{children}</>
}

function CommandPaletteProvider({ children }: { children: React.ReactNode }) {
useCommandPaletteKeyboard()
return (
<>
{children}
<CommandPalette />
</>
)
}

function App() {
return (
<AuthProvider>
<AuthIntegration>
<ToastProvider>
<BrowserRouter>
{/* Analytics wiring */}
<AnalyticsRouterListener />
<PostHogClerkBridge />
<AppLayout>
<ProtectedRoute>
<Routes>
<Route path="/" element={<WorkflowList />} />
<Route
path="/workflows/:id"
element={
<ProtectedRoute>
<WorkflowBuilder />
</ProtectedRoute>
}
/>
<Route
path="/workflows/:id/runs"
element={
<ProtectedRoute>
<WorkflowBuilder />
</ProtectedRoute>
}
/>
<Route
path="/workflows/:id/runs/:runId"
element={
<ProtectedRoute>
<WorkflowBuilder />
</ProtectedRoute>
}
/>
<Route path="/secrets" element={<SecretsManager />} />
<Route path="/api-keys" element={<ApiKeysManager />} />
<Route path="/integrations" element={<IntegrationsManager />} />
<Route path="/schedules" element={<SchedulesPage />} />
<Route path="/artifacts" element={<ArtifactLibrary />} />
<Route
path="/integrations/callback/:provider"
element={<IntegrationCallback />}
/>
<Route path="*" element={<NotFound />} />
</Routes>
</ProtectedRoute>
</AppLayout>
<CommandPaletteProvider>
{/* Analytics wiring */}
<AnalyticsRouterListener />
<PostHogClerkBridge />
<AppLayout>
<ProtectedRoute>
<Routes>
<Route path="/" element={<WorkflowList />} />
<Route
path="/workflows/:id"
element={
<ProtectedRoute>
<WorkflowBuilder />
</ProtectedRoute>
}
/>
<Route
path="/workflows/:id/runs"
element={
<ProtectedRoute>
<WorkflowBuilder />
</ProtectedRoute>
}
/>
<Route
path="/workflows/:id/runs/:runId"
element={
<ProtectedRoute>
<WorkflowBuilder />
</ProtectedRoute>
}
/>
<Route path="/secrets" element={<SecretsManager />} />
<Route path="/api-keys" element={<ApiKeysManager />} />
<Route path="/integrations" element={<IntegrationsManager />} />
<Route path="/schedules" element={<SchedulesPage />} />
<Route path="/artifacts" element={<ArtifactLibrary />} />
<Route
path="/integrations/callback/:provider"
element={<IntegrationCallback />}
/>
<Route path="*" element={<NotFound />} />
</Routes>
</ProtectedRoute>
</AppLayout>
</CommandPaletteProvider>
</BrowserRouter>
</ToastProvider>
</AuthIntegration>
Expand Down
37 changes: 36 additions & 1 deletion frontend/src/components/layout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Link, useLocation, useNavigate } from 'react-router-dom'
import { Sidebar, SidebarHeader, SidebarContent, SidebarFooter, SidebarItem } from '@/components/ui/sidebar'
import { AppTopBar } from '@/components/layout/AppTopBar'
import { Button } from '@/components/ui/button'
import { Workflow, KeyRound, Plus, Plug, Archive, CalendarClock, Sun, Moon, Shield } from 'lucide-react'
import { Workflow, KeyRound, Plus, Plug, Archive, CalendarClock, Sun, Moon, Shield, Search, Command } from 'lucide-react'
import React, { useState, useEffect, useCallback } from 'react'
import { useAuthStore } from '@/store/authStore'
import { hasAdminRole } from '@/utils/auth'
Expand All @@ -13,6 +13,7 @@ import { env } from '@/config/env'
import { useThemeStore } from '@/store/themeStore'
import { cn } from '@/lib/utils'
import { setMobilePlacementSidebarClose } from '@/components/layout/Sidebar'
import { useCommandPaletteStore } from '@/store/commandPaletteStore'

interface AppLayoutProps {
children: React.ReactNode
Expand Down Expand Up @@ -66,6 +67,7 @@ export function AppLayout({ children }: AppLayoutProps) {
const authProvider = useAuthProvider()
const showUserButton = isAuthenticated || authProvider.name === 'clerk'
const { theme, startTransition } = useThemeStore()
const openCommandPalette = useCommandPaletteStore((state) => state.open)

// Get git SHA for version display (monorepo - same for frontend and backend)
const gitSha = env.VITE_GIT_SHA
Expand Down Expand Up @@ -383,6 +385,39 @@ export function AppLayout({ children }: AppLayoutProps) {
)
})}
</div>

{/* Command Palette Button */}
<div className="px-2 mt-4 pt-4 border-t border-border/40">
<button
onClick={openCommandPalette}
className={cn(
'w-full flex items-center gap-3 py-2.5 rounded-lg transition-colors',
'bg-muted/50 hover:bg-muted text-muted-foreground hover:text-foreground',
sidebarOpen ? 'justify-between px-4' : 'justify-center'
)}
>
<div className="flex items-center gap-3">
<Search className="h-4 w-4 flex-shrink-0" />
<span
className={cn(
'transition-all duration-300 whitespace-nowrap overflow-hidden text-sm',
sidebarOpen ? 'opacity-100' : 'opacity-0 max-w-0'
)}
style={{
transitionDelay: sidebarOpen ? '200ms' : '0ms',
transitionProperty: 'opacity, max-width'
}}
>
Search...
</span>
</div>
{sidebarOpen && (
<kbd className="hidden sm:inline-flex h-5 items-center gap-0.5 rounded border border-border/60 bg-background/80 px-1.5 font-mono text-[10px] font-medium text-muted-foreground">
<Command className="h-2.5 w-2.5" />K
</kbd>
)}
</button>
</div>
</SidebarContent>

<SidebarFooter className="border-t p-0">
Expand Down
Loading