1- import type { Task } from "@/lib/tauri-ipc" ;
1+ import type { Task , AgentProcess } from "@/lib/tauri-ipc" ;
22import type { LoopState } from "@/lib/review-loop" ;
33import { Card , CardContent } from "@/components/ui/card" ;
44import { Badge } from "@/components/ui/badge" ;
@@ -7,6 +7,7 @@ import { Button } from "@/components/ui/button";
77interface KanbanBoardProps {
88 tasks : Task [ ] ;
99 loopStates ?: Map < string , LoopState > ;
10+ runningAgents ?: AgentProcess [ ] ;
1011 onTaskClick ?: ( task : Task ) => void ;
1112 onAddTask ?: ( column : string ) => void ;
1213 onAssignAgent ?: ( task : Task ) => void ;
@@ -70,11 +71,13 @@ function ScoreTrend({ history }: { history: LoopState["reviewHistory"] }) {
7071function TaskCard ( {
7172 task,
7273 loopState,
74+ isAgentRunning,
7375 onClick,
7476 onAssign,
7577} : {
7678 task : Task ;
7779 loopState ?: LoopState ;
80+ isAgentRunning ?: boolean ;
7881 onClick ?: ( ) => void ;
7982 onAssign ?: ( ) => void ;
8083} ) {
@@ -102,10 +105,15 @@ function TaskCard({
102105 < div className = "mt-2 flex items-center gap-2" >
103106 { task . assigned_agent ? (
104107 < div className = "flex items-center gap-1" >
105- < span className = " h-1.5 w-1.5 rounded-full bg-amber-400" />
106- < span className = " mono text-[10px] text-amber-400">
108+ < span className = { ` h-1.5 w-1.5 rounded-full ${ isAgentRunning ? " bg-emerald-400 animate-pulse" : "bg- amber-400"} ` } />
109+ < span className = { ` mono text-[10px] ${ isAgentRunning ? " text-emerald-400" : "text- amber-400"} ` } >
107110 { task . assigned_agent . slice ( 0 , 8 ) }
108111 </ span >
112+ { isAgentRunning && (
113+ < span className = "text-[9px] font-semibold uppercase tracking-wider text-emerald-400/80" >
114+ Live
115+ </ span >
116+ ) }
109117 </ div >
110118 ) : onAssign ? (
111119 < Button
@@ -128,7 +136,17 @@ function TaskCard({
128136 ) ;
129137}
130138
131- export default function KanbanBoard ( { tasks, loopStates, onTaskClick, onAddTask, onAssignAgent } : KanbanBoardProps ) {
139+ /** Check if a task's assigned agent is currently running by matching project_path. */
140+ function isTaskAgentRunning ( task : Task , runningAgents ?: AgentProcess [ ] ) : boolean {
141+ if ( ! task . assigned_agent || ! runningAgents ) return false ;
142+ return runningAgents . some (
143+ ( a ) =>
144+ a . status === "running" &&
145+ a . project_path === task . project_path
146+ ) ;
147+ }
148+
149+ export default function KanbanBoard ( { tasks, loopStates, runningAgents, onTaskClick, onAddTask, onAssignAgent } : KanbanBoardProps ) {
132150 return (
133151 < div className = "grid grid-cols-5 gap-3 min-w-[750px]" >
134152 { columns . map ( ( col ) => {
@@ -176,6 +194,7 @@ export default function KanbanBoard({ tasks, loopStates, onTaskClick, onAddTask,
176194 key = { task . id }
177195 task = { task }
178196 loopState = { loopStates ?. get ( task . id ) }
197+ isAgentRunning = { isTaskAgentRunning ( task , runningAgents ) }
179198 onClick = { ( ) => onTaskClick ?.( task ) }
180199 onAssign = { onAssignAgent ? ( ) => onAssignAgent ( task ) : undefined }
181200 />
0 commit comments