import { useState } from 'react' import { useProjects, useFeatures } from './hooks/useProjects' import { useProjectWebSocket } from './hooks/useWebSocket' import { ProjectSelector } from './components/ProjectSelector' import { KanbanBoard } from './components/KanbanBoard' import { AgentControl } from './components/AgentControl' import { ProgressDashboard } from './components/ProgressDashboard' import { SetupWizard } from './components/SetupWizard' import { AddFeatureForm } from './components/AddFeatureForm' import { FeatureModal } from './components/FeatureModal' import { Plus } from 'lucide-react' import type { Feature } from './lib/types' function App() { const [selectedProject, setSelectedProject] = useState(null) const [showAddFeature, setShowAddFeature] = useState(false) const [selectedFeature, setSelectedFeature] = useState(null) const [setupComplete, setSetupComplete] = useState(true) // Start optimistic const { data: projects, isLoading: projectsLoading } = useProjects() const { data: features } = useFeatures(selectedProject) const wsState = useProjectWebSocket(selectedProject) // Combine WebSocket progress with feature data const progress = wsState.progress.total > 0 ? wsState.progress : { passing: features?.done.length ?? 0, total: (features?.pending.length ?? 0) + (features?.in_progress.length ?? 0) + (features?.done.length ?? 0), percentage: 0, } if (progress.total > 0 && progress.percentage === 0) { progress.percentage = Math.round((progress.passing / progress.total) * 100 * 10) / 10 } if (!setupComplete) { return setSetupComplete(true)} /> } return (
{/* Header */}
{/* Logo and Title */}

Autonomous Coder

{/* Controls */}
{selectedProject && ( <> )}
{/* Main Content */}
{!selectedProject ? (

Welcome to Autonomous Coder

Select a project from the dropdown above or create a new one to get started.

) : (
{/* Progress Dashboard */} {/* Kanban Board */}
)}
{/* Add Feature Modal */} {showAddFeature && selectedProject && ( setShowAddFeature(false)} /> )} {/* Feature Detail Modal */} {selectedFeature && selectedProject && ( setSelectedFeature(null)} /> )}
) } export default App