diff --git a/ui/src/components/IssueChatThread.tsx b/ui/src/components/IssueChatThread.tsx index a0b8ae25..0b28c3cc 100644 --- a/ui/src/components/IssueChatThread.tsx +++ b/ui/src/components/IssueChatThread.tsx @@ -360,45 +360,47 @@ function IssueChatUserMessage() { return ( -
-
- {queued ? ( -
- - Queued - - {queueTargetRunId && onInterruptQueued ? ( - - ) : null} -
- ) : null} - {pending ?
Sending...
: null} +
+
+
+ {queued ? ( +
+ + Queued + + {queueTargetRunId && onInterruptQueued ? ( + + ) : null} +
+ ) : null} + {pending ?
Sending...
: null} -
- , - }} - /> +
+ , + }} + /> +
- + + + You +
); @@ -453,9 +459,11 @@ function IssueChatAssistantMessage() { : typeof custom.runAgentName === "string" ? custom.runAgentName : "Agent"; + const authorAgentId = typeof custom.authorAgentId === "string" ? custom.authorAgentId : null; const runId = typeof custom.runId === "string" ? custom.runId : null; const runAgentId = typeof custom.runAgentId === "string" ? custom.runAgentId : null; - const runAgentIcon = runAgentId ? agentMap?.get(runAgentId)?.icon : undefined; + const agentId = authorAgentId ?? runAgentId; + const agentIcon = agentId ? agentMap?.get(agentId)?.icon : undefined; const commentId = typeof custom.commentId === "string" ? custom.commentId : null; const notices = Array.isArray(custom.notices) ? custom.notices.filter((notice): notice is string => typeof notice === "string" && notice.length > 0) @@ -476,97 +484,98 @@ function IssueChatAssistantMessage() { return ( -
- +
+ + {agentIcon ? ( + + ) : ( + {initialsForName(authorName)} + )} + -
- , - ChainOfThought: IssueChatChainOfThought, - }} - /> - {message.content.length === 0 && waitingText ? ( -
- {waitingText} +
+
+
+ {authorName} + {isRunning ? ( + + + Running + + ) : null}
- ) : null} - {notices.length > 0 ? ( -
- {notices.map((notice, index) => ( -
- {notice} -
- ))} +
+ + {message.createdAt ? formatShortDate(message.createdAt) : ""} + + {runHref ? ( + + + + + + + View run + + + + ) : null}
- ) : null} -
+
-
- - - - - {commentId && onVote ? ( - + , + ChainOfThought: IssueChatChainOfThought, + }} /> - ) : null} + {message.content.length === 0 && waitingText ? ( +
+ {waitingText} +
+ ) : null} + {notices.length > 0 ? ( +
+ {notices.map((notice, index) => ( +
+ {notice} +
+ ))} +
+ ) : null} +
+ +
+ + + + + {commentId && onVote ? ( + + ) : null} +
@@ -803,6 +812,8 @@ function IssueChatSystemMessage() { const runAgentName = typeof custom.runAgentName === "string" ? custom.runAgentName : null; const runStatus = typeof custom.runStatus === "string" ? custom.runStatus : null; const actorName = typeof custom.actorName === "string" ? custom.actorName : null; + const actorType = typeof custom.actorType === "string" ? custom.actorType : null; + const actorId = typeof custom.actorId === "string" ? custom.actorId : null; const statusChange = typeof custom.statusChange === "object" && custom.statusChange ? custom.statusChange as { from: string | null; to: string | null } : null; @@ -814,50 +825,73 @@ function IssueChatSystemMessage() { : null; if (custom.kind === "event" && actorName) { + const isCurrentUser = actorType === "user" && !!currentUserId && actorId === currentUserId; + const isAgent = actorType === "agent"; + const agentIcon = isAgent && actorId ? agentMap?.get(actorId)?.icon : undefined; + + const eventContent = ( +
+
+ {actorName} + updated this task + + {timeAgo(message.createdAt)} + +
+ + {statusChange ? ( +
+ + Status + + {humanizeValue(statusChange.from)} + + {humanizeValue(statusChange.to)} +
+ ) : null} + + {assigneeChange ? ( +
+ + Assignee + + + {formatTimelineAssigneeLabel(assigneeChange.from, agentMap, currentUserId)} + + + + {formatTimelineAssigneeLabel(assigneeChange.to, agentMap, currentUserId)} + +
+ ) : null} +
+ ); + + if (isCurrentUser) { + return ( + +
+ {eventContent} +
+
+ ); + } + return (
- {initialsForName(actorName)} + {agentIcon ? ( + + ) : ( + {initialsForName(actorName)} + )} - -
-
- {actorName} - updated this task - - {timeAgo(message.createdAt)} - -
- - {statusChange ? ( -
- - Status - - {humanizeValue(statusChange.from)} - - {humanizeValue(statusChange.to)} -
- ) : null} - - {assigneeChange ? ( -
- - Assignee - - - {formatTimelineAssigneeLabel(assigneeChange.from, agentMap, currentUserId)} - - - - {formatTimelineAssigneeLabel(assigneeChange.to, agentMap, currentUserId)} - -
- ) : null} +
+ {eventContent}
@@ -865,12 +899,17 @@ function IssueChatSystemMessage() { } const displayedRunAgentName = runAgentName ?? (runAgentId ? agentMap?.get(runAgentId)?.name ?? runAgentId.slice(0, 8) : null); + const runAgentIcon = runAgentId ? agentMap?.get(runAgentId)?.icon : undefined; if (custom.kind === "run" && runId && runAgentId && displayedRunAgentName && runStatus) { return (
- {initialsForName(displayedRunAgentName)} + {runAgentIcon ? ( + + ) : ( + {initialsForName(displayedRunAgentName)} + )}
diff --git a/ui/src/lib/issue-chat-messages.ts b/ui/src/lib/issue-chat-messages.ts index aebba354..6f0dc9c8 100644 --- a/ui/src/lib/issue-chat-messages.ts +++ b/ui/src/lib/issue-chat-messages.ts @@ -235,6 +235,8 @@ function createTimelineEventMessage(args: { anchorId: `activity-${event.id}`, eventId: event.id, actorName, + actorType: event.actorType, + actorId: event.actorId, statusChange: event.statusChange ?? null, assigneeChange: event.assigneeChange ?? null, },