mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-01-30 06:12:06 +00:00
feat: add "Create Spec" button and fix Windows asyncio subprocess
UI Changes: - Add "Create Spec with AI" button in empty kanban when project has no spec - Button opens SpecCreationChat to guide users through spec creation - Shows in Pending column when has_spec=false and no features exist Windows Fixes: - Fix asyncio subprocess NotImplementedError on Windows - Set WindowsProactorEventLoopPolicy in server/__init__.py - Remove --reload from uvicorn (incompatible with Windows subprocess) - Add process cleanup on startup in start_ui.bat Spec Chat Improvements: - Enable full tool access (remove allowed_tools restriction) - Add "user" to setting_sources for global skills access - Use bypassPermissions mode for auto-approval - Add WebFetch/WebSearch auto-approve hook Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,7 @@ import { CelebrationOverlay } from './components/CelebrationOverlay'
|
||||
import { AssistantFAB } from './components/AssistantFAB'
|
||||
import { AssistantPanel } from './components/AssistantPanel'
|
||||
import { ExpandProjectModal } from './components/ExpandProjectModal'
|
||||
import { SpecCreationChat } from './components/SpecCreationChat'
|
||||
import { SettingsModal } from './components/SettingsModal'
|
||||
import { DevServerControl } from './components/DevServerControl'
|
||||
import { ViewToggle, type ViewMode } from './components/ViewToggle'
|
||||
@@ -51,6 +52,7 @@ function App() {
|
||||
const [showSettings, setShowSettings] = useState(false)
|
||||
const [showKeyboardHelp, setShowKeyboardHelp] = useState(false)
|
||||
const [isSpecCreating, setIsSpecCreating] = useState(false)
|
||||
const [showSpecChat, setShowSpecChat] = useState(false) // For "Create Spec" button in empty kanban
|
||||
const [darkMode, setDarkMode] = useState(() => {
|
||||
try {
|
||||
return localStorage.getItem(DARK_MODE_KEY) === 'true'
|
||||
@@ -74,6 +76,10 @@ function App() {
|
||||
useAgentStatus(selectedProject) // Keep polling for status updates
|
||||
const wsState = useProjectWebSocket(selectedProject)
|
||||
|
||||
// Get has_spec from the selected project
|
||||
const selectedProjectData = projects?.find(p => p.name === selectedProject)
|
||||
const hasSpec = selectedProjectData?.has_spec ?? true
|
||||
|
||||
// Fetch graph data when in graph view
|
||||
const { data: graphData } = useQuery({
|
||||
queryKey: ['dependencyGraph', selectedProject],
|
||||
@@ -391,6 +397,8 @@ function App() {
|
||||
onAddFeature={() => setShowAddFeature(true)}
|
||||
onExpandProject={() => setShowExpandProject(true)}
|
||||
activeAgents={wsState.activeAgents}
|
||||
onCreateSpec={() => setShowSpecChat(true)}
|
||||
hasSpec={hasSpec}
|
||||
/>
|
||||
) : (
|
||||
<div className="neo-card overflow-hidden" style={{ height: '600px' }}>
|
||||
@@ -441,6 +449,23 @@ function App() {
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Spec Creation Chat - for creating spec from empty kanban */}
|
||||
{showSpecChat && selectedProject && (
|
||||
<div className="fixed inset-0 z-50 bg-[var(--color-neo-bg)]">
|
||||
<SpecCreationChat
|
||||
projectName={selectedProject}
|
||||
onComplete={() => {
|
||||
setShowSpecChat(false)
|
||||
// Refresh projects to update has_spec
|
||||
queryClient.invalidateQueries({ queryKey: ['projects'] })
|
||||
queryClient.invalidateQueries({ queryKey: ['features', selectedProject] })
|
||||
}}
|
||||
onCancel={() => setShowSpecChat(false)}
|
||||
onExitToProject={() => setShowSpecChat(false)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Debug Log Viewer - fixed to bottom */}
|
||||
{selectedProject && (
|
||||
<DebugLogViewer
|
||||
@@ -458,7 +483,7 @@ function App() {
|
||||
)}
|
||||
|
||||
{/* Assistant FAB and Panel - hide when expand modal or spec creation is open */}
|
||||
{selectedProject && !showExpandProject && !isSpecCreating && (
|
||||
{selectedProject && !showExpandProject && !isSpecCreating && !showSpecChat && (
|
||||
<>
|
||||
<AssistantFAB
|
||||
onClick={() => setAssistantOpen(!assistantOpen)}
|
||||
|
||||
@@ -7,9 +7,11 @@ interface KanbanBoardProps {
|
||||
onAddFeature?: () => void
|
||||
onExpandProject?: () => void
|
||||
activeAgents?: ActiveAgent[]
|
||||
onCreateSpec?: () => void // Callback to start spec creation
|
||||
hasSpec?: boolean // Whether the project has a spec
|
||||
}
|
||||
|
||||
export function KanbanBoard({ features, onFeatureClick, onAddFeature, onExpandProject, activeAgents = [] }: KanbanBoardProps) {
|
||||
export function KanbanBoard({ features, onFeatureClick, onAddFeature, onExpandProject, activeAgents = [], onCreateSpec, hasSpec = true }: KanbanBoardProps) {
|
||||
const hasFeatures = features && (features.pending.length + features.in_progress.length + features.done.length) > 0
|
||||
|
||||
// Combine all features for dependency status calculation
|
||||
@@ -47,6 +49,8 @@ export function KanbanBoard({ features, onFeatureClick, onAddFeature, onExpandPr
|
||||
onAddFeature={onAddFeature}
|
||||
onExpandProject={onExpandProject}
|
||||
showExpandButton={hasFeatures}
|
||||
onCreateSpec={onCreateSpec}
|
||||
showCreateSpec={!hasSpec && !hasFeatures}
|
||||
/>
|
||||
<KanbanColumn
|
||||
title="In Progress"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { FeatureCard } from './FeatureCard'
|
||||
import { Plus, Sparkles } from 'lucide-react'
|
||||
import { Plus, Sparkles, Wand2 } from 'lucide-react'
|
||||
import type { Feature, ActiveAgent } from '../lib/types'
|
||||
|
||||
interface KanbanColumnProps {
|
||||
@@ -13,6 +13,8 @@ interface KanbanColumnProps {
|
||||
onAddFeature?: () => void
|
||||
onExpandProject?: () => void
|
||||
showExpandButton?: boolean
|
||||
onCreateSpec?: () => void // Callback to start spec creation
|
||||
showCreateSpec?: boolean // Show "Create Spec" button when project has no spec
|
||||
}
|
||||
|
||||
const colorMap = {
|
||||
@@ -32,6 +34,8 @@ export function KanbanColumn({
|
||||
onAddFeature,
|
||||
onExpandProject,
|
||||
showExpandButton,
|
||||
onCreateSpec,
|
||||
showCreateSpec,
|
||||
}: KanbanColumnProps) {
|
||||
// Create a map of feature ID to active agent for quick lookup
|
||||
const agentByFeatureId = new Map(
|
||||
@@ -81,7 +85,20 @@ export function KanbanColumn({
|
||||
<div className="p-4 space-y-3 max-h-[600px] overflow-y-auto bg-[var(--color-neo-bg)]">
|
||||
{features.length === 0 ? (
|
||||
<div className="text-center py-8 text-[var(--color-neo-text-secondary)]">
|
||||
No features
|
||||
{showCreateSpec && onCreateSpec ? (
|
||||
<div className="space-y-4">
|
||||
<p>No spec created yet</p>
|
||||
<button
|
||||
onClick={onCreateSpec}
|
||||
className="neo-btn neo-btn-primary inline-flex items-center gap-2"
|
||||
>
|
||||
<Wand2 size={18} />
|
||||
Create Spec with AI
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
'No features'
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
features.map((feature, index) => (
|
||||
|
||||
Reference in New Issue
Block a user