mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-02-03 07:33:37 +00:00
feat: add concurrent agents with dependency system and delightful UI
Major feature implementation for parallel agent execution with dependency-aware scheduling and an engaging multi-agent UI experience. Backend Changes: - Add parallel_orchestrator.py for concurrent feature processing - Add api/dependency_resolver.py with cycle detection (Kahn's algorithm + DFS) - Add atomic feature_claim_next() with retry limit and exponential backoff - Fix circular dependency check arguments in 4 locations - Add AgentTracker class for parsing agent output and emitting updates - Add browser isolation with --isolated flag for Playwright MCP - Extend WebSocket protocol with agent_update messages and log attribution - Add WSAgentUpdateMessage schema with agent states and mascot names - Fix WSProgressMessage to include in_progress field New UI Components: - AgentMissionControl: Dashboard showing active agents with collapsible activity - AgentCard: Individual agent status with avatar and thought bubble - AgentAvatar: SVG mascots (Spark, Fizz, Octo, Hoot, Buzz) with animations - ActivityFeed: Recent activity stream with stable keys (no flickering) - CelebrationOverlay: Confetti animation with click/Escape dismiss - DependencyGraph: Interactive node graph visualization with dagre layout - DependencyBadge: Visual indicator for feature dependencies - ViewToggle: Switch between Kanban and Graph views - KeyboardShortcutsHelp: Help overlay accessible via ? key UI/UX Improvements: - Celebration queue system to handle rapid success messages - Accessibility attributes on AgentAvatar (role, aria-label, aria-live) - Collapsible Recent Activity section with persisted preference - Agent count display in header - Keyboard shortcut G to toggle Kanban/Graph view - Real-time thought bubbles and state animations Bug Fixes: - Fix circular dependency validation (swapped source/target arguments) - Add MAX_CLAIM_RETRIES=10 to prevent stack overflow under contention - Fix THOUGHT_PATTERNS to match actual [Tool: name] format - Fix ActivityFeed key prop to prevent re-renders on new items - Add featureId/agentIndex to log messages for proper attribution Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
121
ui/src/components/DependencyBadge.tsx
Normal file
121
ui/src/components/DependencyBadge.tsx
Normal file
@@ -0,0 +1,121 @@
|
||||
import { AlertTriangle, GitBranch, Check } from 'lucide-react'
|
||||
import type { Feature } from '../lib/types'
|
||||
|
||||
interface DependencyBadgeProps {
|
||||
feature: Feature
|
||||
allFeatures?: Feature[]
|
||||
compact?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Badge component showing dependency status for a feature.
|
||||
* Shows:
|
||||
* - Blocked status with count of blocking dependencies
|
||||
* - Dependency count for features with satisfied dependencies
|
||||
* - Nothing if feature has no dependencies
|
||||
*/
|
||||
export function DependencyBadge({ feature, allFeatures = [], compact = false }: DependencyBadgeProps) {
|
||||
const dependencies = feature.dependencies || []
|
||||
|
||||
if (dependencies.length === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
// Use API-computed blocked status if available, otherwise compute locally
|
||||
const isBlocked = feature.blocked ??
|
||||
(feature.blocking_dependencies && feature.blocking_dependencies.length > 0) ??
|
||||
false
|
||||
|
||||
const blockingCount = feature.blocking_dependencies?.length ?? 0
|
||||
|
||||
// Compute satisfied count from allFeatures if available
|
||||
let satisfiedCount = dependencies.length - blockingCount
|
||||
if (allFeatures.length > 0 && !feature.blocking_dependencies) {
|
||||
const passingIds = new Set(allFeatures.filter(f => f.passes).map(f => f.id))
|
||||
satisfiedCount = dependencies.filter(d => passingIds.has(d)).length
|
||||
}
|
||||
|
||||
if (compact) {
|
||||
// Compact view for card displays
|
||||
return (
|
||||
<div
|
||||
className={`
|
||||
inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full font-mono
|
||||
${isBlocked
|
||||
? 'bg-neo-danger/20 text-neo-danger'
|
||||
: 'bg-neo-neutral-200 text-neo-text-secondary'
|
||||
}
|
||||
`}
|
||||
title={isBlocked
|
||||
? `Blocked by ${blockingCount} ${blockingCount === 1 ? 'dependency' : 'dependencies'}`
|
||||
: `${satisfiedCount}/${dependencies.length} dependencies satisfied`
|
||||
}
|
||||
>
|
||||
{isBlocked ? (
|
||||
<>
|
||||
<AlertTriangle size={12} />
|
||||
<span>{blockingCount}</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<GitBranch size={12} />
|
||||
<span>{satisfiedCount}/{dependencies.length}</span>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// Full view with more details
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
{isBlocked ? (
|
||||
<div className="flex items-center gap-1.5 text-sm text-neo-danger">
|
||||
<AlertTriangle size={14} />
|
||||
<span className="font-medium">
|
||||
Blocked by {blockingCount} {blockingCount === 1 ? 'dependency' : 'dependencies'}
|
||||
</span>
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex items-center gap-1.5 text-sm text-neo-text-secondary">
|
||||
<Check size={14} className="text-neo-done" />
|
||||
<span>
|
||||
All {dependencies.length} {dependencies.length === 1 ? 'dependency' : 'dependencies'} satisfied
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Small inline indicator for dependency status
|
||||
*/
|
||||
export function DependencyIndicator({ feature }: { feature: Feature }) {
|
||||
const dependencies = feature.dependencies || []
|
||||
const isBlocked = feature.blocked || (feature.blocking_dependencies && feature.blocking_dependencies.length > 0)
|
||||
|
||||
if (dependencies.length === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (isBlocked) {
|
||||
return (
|
||||
<span
|
||||
className="inline-flex items-center justify-center w-5 h-5 rounded-full bg-neo-danger/20 text-neo-danger"
|
||||
title={`Blocked by ${feature.blocking_dependencies?.length || 0} dependencies`}
|
||||
>
|
||||
<AlertTriangle size={12} />
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<span
|
||||
className="inline-flex items-center justify-center w-5 h-5 rounded-full bg-neo-neutral-200 text-neo-text-secondary"
|
||||
title={`${dependencies.length} dependencies (all satisfied)`}
|
||||
>
|
||||
<GitBranch size={12} />
|
||||
</span>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user