feat: make comment identity headers clickable links to agent pages
Wraps the Identity component in comment headers with a Link to
/agents/{agentId} so users can click through to view agent details.
Applied to both CommentThread and ApprovalDetail comment sections.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -70,14 +70,16 @@ export function CommentThread({ comments, onAdd, issueStatus, agentMap }: Commen
|
||||
{sorted.map((comment) => (
|
||||
<div key={comment.id} className="border border-border p-3">
|
||||
<div className="flex items-center justify-between mb-1">
|
||||
<Identity
|
||||
name={
|
||||
comment.authorAgentId
|
||||
? agentMap?.get(comment.authorAgentId)?.name ?? comment.authorAgentId.slice(0, 8)
|
||||
: "You"
|
||||
}
|
||||
size="sm"
|
||||
/>
|
||||
{comment.authorAgentId ? (
|
||||
<Link to={`/agents/${comment.authorAgentId}`} className="hover:underline">
|
||||
<Identity
|
||||
name={agentMap?.get(comment.authorAgentId)?.name ?? comment.authorAgentId.slice(0, 8)}
|
||||
size="sm"
|
||||
/>
|
||||
</Link>
|
||||
) : (
|
||||
<Identity name="You" size="sm" />
|
||||
)}
|
||||
<span className="text-xs text-muted-foreground">
|
||||
{formatDateTime(comment.createdAt)}
|
||||
</span>
|
||||
|
||||
@@ -315,14 +315,16 @@ export function ApprovalDetail() {
|
||||
{(comments ?? []).map((comment: ApprovalComment) => (
|
||||
<div key={comment.id} className="border border-border/60 rounded-md p-3">
|
||||
<div className="flex items-center justify-between mb-1">
|
||||
<Identity
|
||||
name={
|
||||
comment.authorAgentId
|
||||
? agentNameById.get(comment.authorAgentId) ?? comment.authorAgentId.slice(0, 8)
|
||||
: "Board"
|
||||
}
|
||||
size="sm"
|
||||
/>
|
||||
{comment.authorAgentId ? (
|
||||
<Link to={`/agents/${comment.authorAgentId}`} className="hover:underline">
|
||||
<Identity
|
||||
name={agentNameById.get(comment.authorAgentId) ?? comment.authorAgentId.slice(0, 8)}
|
||||
size="sm"
|
||||
/>
|
||||
</Link>
|
||||
) : (
|
||||
<Identity name="Board" size="sm" />
|
||||
)}
|
||||
<span className="text-xs text-muted-foreground">
|
||||
{new Date(comment.createdAt).toLocaleString()}
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user