diff --git a/frontend/src/features/workstate/ProjectWorkStatePanel.tsx b/frontend/src/features/workstate/ProjectWorkStatePanel.tsx index 41283edc..f72df5bb 100644 --- a/frontend/src/features/workstate/ProjectWorkStatePanel.tsx +++ b/frontend/src/features/workstate/ProjectWorkStatePanel.tsx @@ -159,6 +159,28 @@ function backgroundTaskSummary(tasks: BackgroundCompletion[]): string | null { return `${tasks.length} background task${tasks.length > 1 ? "s" : ""}`; } +function compactIntent(text: string | null): string | null { + const normalized = text?.replace(/\s+/g, " ").trim(); + if (!normalized) return null; + return normalized.length <= 44 ? normalized : `${normalized.slice(0, 41)}...`; +} + +function compactIndicator({ + tickets, + inboxDepth, + backgroundTasks, +}: { + tickets: AgentTicketState[]; + inboxDepth: number; + backgroundTasks: BackgroundCompletion[]; +}): string | null { + const queuedTickets = tickets.filter((ticket) => ticket.status === "queued").length; + if (queuedTickets > 0) return `+${queuedTickets}`; + if (inboxDepth > 0) return `${inboxDepth} inbox`; + if (backgroundTasks.length > 0) return `${backgroundTasks.length} bg`; + return null; +} + function requesterLabel(ticket: AgentTicketState): string { if (ticket.source.kind === "human") return "Human"; const id = shortTicket(ticket.source.agentId); @@ -592,16 +614,13 @@ function AgentRow({ const currentTurn = busy || tickets.some((ticket) => ticket.status === "inProgress"); const activeTicket = tickets.find((ticket) => ticket.status === "inProgress"); - const activeSummary = activeTicket - ? conversations.get(activeTicket.conversationId) - : undefined; const statusLabel = agentStatusLabel(live, busy); const taskSummary = backgroundTaskSummary(backgroundTasks); - const activityLine = + const activityLine = compactIntent( activeTicket?.taskPreview ?? - (busyState.state === "busy" ? `Ticket ${shortTicket(busyState.ticket)}` : null) ?? - (inboxDepth > 0 ? `${inboxDepth} queued` : null) ?? - taskSummary; + (busyState.state === "busy" ? `Ticket ${shortTicket(busyState.ticket)}` : null), + ); + const indicator = compactIndicator({ tickets, inboxDepth, backgroundTasks }); const hasActions = Boolean(agent.live); const hasDetails = hasActions || @@ -665,18 +684,26 @@ function AgentRow({ return (