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:
Forgotten
2026-02-21 08:19:38 -06:00
parent 40512ad533
commit 57f88f6f6a
2 changed files with 20 additions and 16 deletions

View File

@@ -70,14 +70,16 @@ export function CommentThread({ comments, onAdd, issueStatus, agentMap }: Commen
{sorted.map((comment) => ( {sorted.map((comment) => (
<div key={comment.id} className="border border-border p-3"> <div key={comment.id} className="border border-border p-3">
<div className="flex items-center justify-between mb-1"> <div className="flex items-center justify-between mb-1">
<Identity {comment.authorAgentId ? (
name={ <Link to={`/agents/${comment.authorAgentId}`} className="hover:underline">
comment.authorAgentId <Identity
? agentMap?.get(comment.authorAgentId)?.name ?? comment.authorAgentId.slice(0, 8) name={agentMap?.get(comment.authorAgentId)?.name ?? comment.authorAgentId.slice(0, 8)}
: "You" size="sm"
} />
size="sm" </Link>
/> ) : (
<Identity name="You" size="sm" />
)}
<span className="text-xs text-muted-foreground"> <span className="text-xs text-muted-foreground">
{formatDateTime(comment.createdAt)} {formatDateTime(comment.createdAt)}
</span> </span>

View File

@@ -315,14 +315,16 @@ export function ApprovalDetail() {
{(comments ?? []).map((comment: ApprovalComment) => ( {(comments ?? []).map((comment: ApprovalComment) => (
<div key={comment.id} className="border border-border/60 rounded-md p-3"> <div key={comment.id} className="border border-border/60 rounded-md p-3">
<div className="flex items-center justify-between mb-1"> <div className="flex items-center justify-between mb-1">
<Identity {comment.authorAgentId ? (
name={ <Link to={`/agents/${comment.authorAgentId}`} className="hover:underline">
comment.authorAgentId <Identity
? agentNameById.get(comment.authorAgentId) ?? comment.authorAgentId.slice(0, 8) name={agentNameById.get(comment.authorAgentId) ?? comment.authorAgentId.slice(0, 8)}
: "Board" size="sm"
} />
size="sm" </Link>
/> ) : (
<Identity name="Board" size="sm" />
)}
<span className="text-xs text-muted-foreground"> <span className="text-xs text-muted-foreground">
{new Date(comment.createdAt).toLocaleString()} {new Date(comment.createdAt).toLocaleString()}
</span> </span>