mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-03 21:03:08 +00:00
fix: summary modal not appearing when clicking the button in kanban card
This commit is contained in:
@@ -128,116 +128,130 @@ export function AgentInfoPanel({
|
|||||||
// Agent Info Panel for non-backlog cards
|
// Agent Info Panel for non-backlog cards
|
||||||
if (showAgentInfo && feature.status !== 'backlog' && agentInfo) {
|
if (showAgentInfo && feature.status !== 'backlog' && agentInfo) {
|
||||||
return (
|
return (
|
||||||
<div className="mb-3 space-y-2 overflow-hidden">
|
<>
|
||||||
{/* Model & Phase */}
|
<div className="mb-3 space-y-2 overflow-hidden">
|
||||||
<div className="flex items-center gap-2 text-[11px] flex-wrap">
|
{/* Model & Phase */}
|
||||||
<div className="flex items-center gap-1 text-[var(--status-info)]">
|
<div className="flex items-center gap-2 text-[11px] flex-wrap">
|
||||||
<Cpu className="w-3 h-3" />
|
<div className="flex items-center gap-1 text-[var(--status-info)]">
|
||||||
<span className="font-medium">{formatModelName(feature.model ?? DEFAULT_MODEL)}</span>
|
<Cpu className="w-3 h-3" />
|
||||||
</div>
|
<span className="font-medium">{formatModelName(feature.model ?? DEFAULT_MODEL)}</span>
|
||||||
{agentInfo.currentPhase && (
|
|
||||||
<div
|
|
||||||
className={cn(
|
|
||||||
'px-1.5 py-0.5 rounded-md text-[10px] font-medium',
|
|
||||||
agentInfo.currentPhase === 'planning' &&
|
|
||||||
'bg-[var(--status-info-bg)] text-[var(--status-info)]',
|
|
||||||
agentInfo.currentPhase === 'action' &&
|
|
||||||
'bg-[var(--status-warning-bg)] text-[var(--status-warning)]',
|
|
||||||
agentInfo.currentPhase === 'verification' &&
|
|
||||||
'bg-[var(--status-success-bg)] text-[var(--status-success)]'
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{agentInfo.currentPhase}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
{agentInfo.currentPhase && (
|
||||||
</div>
|
<div
|
||||||
|
className={cn(
|
||||||
{/* Task List Progress */}
|
'px-1.5 py-0.5 rounded-md text-[10px] font-medium',
|
||||||
{agentInfo.todos.length > 0 && (
|
agentInfo.currentPhase === 'planning' &&
|
||||||
<div className="space-y-1">
|
'bg-[var(--status-info-bg)] text-[var(--status-info)]',
|
||||||
<div className="flex items-center gap-1 text-[10px] text-muted-foreground/70">
|
agentInfo.currentPhase === 'action' &&
|
||||||
<ListTodo className="w-3 h-3" />
|
'bg-[var(--status-warning-bg)] text-[var(--status-warning)]',
|
||||||
<span>
|
agentInfo.currentPhase === 'verification' &&
|
||||||
{agentInfo.todos.filter((t) => t.status === 'completed').length}/
|
'bg-[var(--status-success-bg)] text-[var(--status-success)]'
|
||||||
{agentInfo.todos.length} tasks
|
)}
|
||||||
</span>
|
>
|
||||||
</div>
|
{agentInfo.currentPhase}
|
||||||
<div className="space-y-0.5 max-h-16 overflow-y-auto">
|
|
||||||
{agentInfo.todos.slice(0, 3).map((todo, idx) => (
|
|
||||||
<div key={idx} className="flex items-center gap-1.5 text-[10px]">
|
|
||||||
{todo.status === 'completed' ? (
|
|
||||||
<CheckCircle2 className="w-2.5 h-2.5 text-[var(--status-success)] shrink-0" />
|
|
||||||
) : todo.status === 'in_progress' ? (
|
|
||||||
<Loader2 className="w-2.5 h-2.5 text-[var(--status-warning)] animate-spin shrink-0" />
|
|
||||||
) : (
|
|
||||||
<Circle className="w-2.5 h-2.5 text-muted-foreground/50 shrink-0" />
|
|
||||||
)}
|
|
||||||
<span
|
|
||||||
className={cn(
|
|
||||||
'break-words hyphens-auto line-clamp-2 leading-relaxed',
|
|
||||||
todo.status === 'completed' && 'text-muted-foreground/60 line-through',
|
|
||||||
todo.status === 'in_progress' && 'text-[var(--status-warning)]',
|
|
||||||
todo.status === 'pending' && 'text-muted-foreground/80'
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{todo.content}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
{agentInfo.todos.length > 3 && (
|
|
||||||
<p className="text-[10px] text-muted-foreground/60 pl-4">
|
|
||||||
+{agentInfo.todos.length - 3} more
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Summary for waiting_approval and verified */}
|
|
||||||
{(feature.status === 'waiting_approval' || feature.status === 'verified') && (
|
|
||||||
<>
|
|
||||||
{(feature.summary || summary || agentInfo.summary) && (
|
|
||||||
<div className="space-y-1.5 pt-2 border-t border-border/30 overflow-hidden">
|
|
||||||
<div className="flex items-center justify-between gap-2">
|
|
||||||
<div className="flex items-center gap-1 text-[10px] text-[var(--status-success)] min-w-0">
|
|
||||||
<Sparkles className="w-3 h-3 shrink-0" />
|
|
||||||
<span className="truncate font-medium">Summary</span>
|
|
||||||
</div>
|
|
||||||
<button
|
|
||||||
onClick={(e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
setIsSummaryDialogOpen(true);
|
|
||||||
}}
|
|
||||||
onPointerDown={(e) => e.stopPropagation()}
|
|
||||||
className="p-0.5 rounded-md hover:bg-muted/80 transition-colors text-muted-foreground/60 hover:text-muted-foreground shrink-0"
|
|
||||||
title="View full summary"
|
|
||||||
data-testid={`expand-summary-${feature.id}`}
|
|
||||||
>
|
|
||||||
<Expand className="w-3 h-3" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<p className="text-[10px] text-muted-foreground/70 line-clamp-3 break-words hyphens-auto leading-relaxed overflow-hidden">
|
|
||||||
{feature.summary || summary || agentInfo.summary}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{!feature.summary && !summary && !agentInfo.summary && agentInfo.toolCallCount > 0 && (
|
</div>
|
||||||
<div className="flex items-center gap-2 text-[10px] text-muted-foreground/60 pt-2 border-t border-border/30">
|
|
||||||
<span className="flex items-center gap-1">
|
{/* Task List Progress */}
|
||||||
<Wrench className="w-2.5 h-2.5" />
|
{agentInfo.todos.length > 0 && (
|
||||||
{agentInfo.toolCallCount} tool calls
|
<div className="space-y-1">
|
||||||
|
<div className="flex items-center gap-1 text-[10px] text-muted-foreground/70">
|
||||||
|
<ListTodo className="w-3 h-3" />
|
||||||
|
<span>
|
||||||
|
{agentInfo.todos.filter((t) => t.status === 'completed').length}/
|
||||||
|
{agentInfo.todos.length} tasks
|
||||||
</span>
|
</span>
|
||||||
{agentInfo.todos.length > 0 && (
|
</div>
|
||||||
<span className="flex items-center gap-1">
|
<div className="space-y-0.5 max-h-16 overflow-y-auto">
|
||||||
<CheckCircle2 className="w-2.5 h-2.5 text-[var(--status-success)]" />
|
{agentInfo.todos.slice(0, 3).map((todo, idx) => (
|
||||||
{agentInfo.todos.filter((t) => t.status === 'completed').length} tasks done
|
<div key={idx} className="flex items-center gap-1.5 text-[10px]">
|
||||||
</span>
|
{todo.status === 'completed' ? (
|
||||||
|
<CheckCircle2 className="w-2.5 h-2.5 text-[var(--status-success)] shrink-0" />
|
||||||
|
) : todo.status === 'in_progress' ? (
|
||||||
|
<Loader2 className="w-2.5 h-2.5 text-[var(--status-warning)] animate-spin shrink-0" />
|
||||||
|
) : (
|
||||||
|
<Circle className="w-2.5 h-2.5 text-muted-foreground/50 shrink-0" />
|
||||||
|
)}
|
||||||
|
<span
|
||||||
|
className={cn(
|
||||||
|
'break-words hyphens-auto line-clamp-2 leading-relaxed',
|
||||||
|
todo.status === 'completed' && 'text-muted-foreground/60 line-through',
|
||||||
|
todo.status === 'in_progress' && 'text-[var(--status-warning)]',
|
||||||
|
todo.status === 'pending' && 'text-muted-foreground/80'
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{todo.content}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
{agentInfo.todos.length > 3 && (
|
||||||
|
<p className="text-[10px] text-muted-foreground/60 pl-4">
|
||||||
|
+{agentInfo.todos.length - 3} more
|
||||||
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
</div>
|
||||||
</>
|
)}
|
||||||
)}
|
|
||||||
</div>
|
{/* Summary for waiting_approval and verified */}
|
||||||
|
{(feature.status === 'waiting_approval' || feature.status === 'verified') && (
|
||||||
|
<>
|
||||||
|
{(feature.summary || summary || agentInfo.summary) && (
|
||||||
|
<div className="space-y-1.5 pt-2 border-t border-border/30 overflow-hidden">
|
||||||
|
<div className="flex items-center justify-between gap-2">
|
||||||
|
<div className="flex items-center gap-1 text-[10px] text-[var(--status-success)] min-w-0">
|
||||||
|
<Sparkles className="w-3 h-3 shrink-0" />
|
||||||
|
<span className="truncate font-medium">Summary</span>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
setIsSummaryDialogOpen(true);
|
||||||
|
}}
|
||||||
|
onPointerDown={(e) => e.stopPropagation()}
|
||||||
|
onMouseDown={(e) => e.stopPropagation()}
|
||||||
|
className="p-0.5 rounded-md hover:bg-muted/80 transition-colors text-muted-foreground/60 hover:text-muted-foreground shrink-0"
|
||||||
|
title="View full summary"
|
||||||
|
data-testid={`expand-summary-${feature.id}`}
|
||||||
|
>
|
||||||
|
<Expand className="w-3 h-3" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<p className="text-[10px] text-muted-foreground/70 line-clamp-3 break-words hyphens-auto leading-relaxed overflow-hidden">
|
||||||
|
{feature.summary || summary || agentInfo.summary}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{!feature.summary &&
|
||||||
|
!summary &&
|
||||||
|
!agentInfo.summary &&
|
||||||
|
agentInfo.toolCallCount > 0 && (
|
||||||
|
<div className="flex items-center gap-2 text-[10px] text-muted-foreground/60 pt-2 border-t border-border/30">
|
||||||
|
<span className="flex items-center gap-1">
|
||||||
|
<Wrench className="w-2.5 h-2.5" />
|
||||||
|
{agentInfo.toolCallCount} tool calls
|
||||||
|
</span>
|
||||||
|
{agentInfo.todos.length > 0 && (
|
||||||
|
<span className="flex items-center gap-1">
|
||||||
|
<CheckCircle2 className="w-2.5 h-2.5 text-[var(--status-success)]" />
|
||||||
|
{agentInfo.todos.filter((t) => t.status === 'completed').length} tasks done
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{/* SummaryDialog must be rendered alongside the expand button */}
|
||||||
|
<SummaryDialog
|
||||||
|
feature={feature}
|
||||||
|
agentInfo={agentInfo}
|
||||||
|
summary={summary}
|
||||||
|
isOpen={isSummaryDialogOpen}
|
||||||
|
onOpenChange={setIsSummaryDialogOpen}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user