fix: extract agent name from title/labels; add navigation to blocked modal
This commit is contained in:
parent
922d574a5a
commit
87ce7dea10
4 changed files with 250 additions and 2 deletions
|
|
@ -12,7 +12,7 @@ import { deriveBlockedIds, buildBlockedByTree, type BlockedTreeNode } from '../.
|
|||
import { useArchetypePicker } from '../../hooks/use-archetype-picker';
|
||||
import { useArchetypes } from '../../hooks/use-archetypes';
|
||||
import type { BeadIssue } from '../../lib/types';
|
||||
import { Blocks, ChevronRight, UserPlus } from 'lucide-react';
|
||||
import { Blocks, ChevronRight, UserPlus, ExternalLink } from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
export interface BlockedTriageModalProps {
|
||||
|
|
@ -20,6 +20,7 @@ export interface BlockedTriageModalProps {
|
|||
onClose: () => void;
|
||||
issues: BeadIssue[];
|
||||
projectRoot: string;
|
||||
onSelectTask?: (taskId: string) => void;
|
||||
}
|
||||
|
||||
export function BlockedTriageModal({
|
||||
|
|
@ -27,6 +28,7 @@ export function BlockedTriageModal({
|
|||
onClose,
|
||||
issues,
|
||||
projectRoot,
|
||||
onSelectTask,
|
||||
}: BlockedTriageModalProps) {
|
||||
const { archetypes } = useArchetypes(projectRoot);
|
||||
const blockedIdsSet = useMemo(() => deriveBlockedIds(issues), [issues]);
|
||||
|
|
@ -102,6 +104,18 @@ export function BlockedTriageModal({
|
|||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
{onSelectTask && (
|
||||
<button
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onSelectTask(issue.id);
|
||||
}}
|
||||
className="p-1 rounded hover:bg-[var(--surface-hover)] text-[var(--text-tertiary)] hover:text-[var(--accent-info)]"
|
||||
title="Open in panel"
|
||||
>
|
||||
<ExternalLink className="w-4 h-4" />
|
||||
</button>
|
||||
)}
|
||||
{issue.status === 'blocked' && (
|
||||
<span className="text-xs px-2 py-0.5 rounded bg-[var(--status-blocked)] text-[var(--text-inverse)]">
|
||||
explicit
|
||||
|
|
|
|||
|
|
@ -340,6 +340,10 @@ export function UnifiedShell({
|
|||
onClose={handleCloseBlockedTriage}
|
||||
issues={issues}
|
||||
projectRoot={projectRoot}
|
||||
onSelectTask={(taskId) => {
|
||||
setTaskId(taskId);
|
||||
handleCloseBlockedTriage();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -51,6 +51,18 @@ function mapPriority(priority: number): SocialCardPriority {
|
|||
return 'P4';
|
||||
}
|
||||
|
||||
function extractAgentName(bead: BeadIssue): string | null {
|
||||
// First check title for "Agent: <name>" pattern
|
||||
const agentMatch = bead.title.match(/Agent:\s*(\S+)/i);
|
||||
if (agentMatch) return agentMatch[1];
|
||||
|
||||
// Then check labels for "agent:" prefix
|
||||
const agentLabel = bead.labels.find(l => l.startsWith('agent:'));
|
||||
if (agentLabel) return agentLabel.replace('agent:', '');
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function extractAgents(bead: BeadIssue): AgentInfo[] {
|
||||
const agents: AgentInfo[] = [];
|
||||
if (bead.assignee) {
|
||||
|
|
@ -64,8 +76,11 @@ function extractAgents(bead: BeadIssue): AgentInfo[] {
|
|||
? (bead.metadata.agentRole as AgentRole)
|
||||
: undefined;
|
||||
|
||||
// Get actual agent name from title/labels, fallback to assignee (bead ID)
|
||||
const agentName = extractAgentName(bead) || bead.assignee;
|
||||
|
||||
agents.push({
|
||||
name: bead.assignee,
|
||||
name: agentName,
|
||||
status: agentStatus,
|
||||
role: agentRole
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue