From 915a3ff3cede45ee706e4c403bb371c522bfbc85 Mon Sep 17 00:00:00 2001 From: dotta Date: Wed, 18 Mar 2026 16:30:59 -0500 Subject: [PATCH] fix: default comment reassign to last commenter who isn't me When commenting on an issue, the reassign dropdown now defaults to the last commenter who is not the current user, preventing accidental self-reassignment. Falls back to the current issue assignee if no other commenters exist. Co-Authored-By: Paperclip Co-Authored-By: Claude Opus 4.6 --- ui/src/pages/IssueDetail.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ui/src/pages/IssueDetail.tsx b/ui/src/pages/IssueDetail.tsx index a6ac9c76..7f98db5e 100644 --- a/ui/src/pages/IssueDetail.tsx +++ b/ui/src/pages/IssueDetail.tsx @@ -376,10 +376,20 @@ export function IssueDetail() { }, [agents, currentUserId]); const currentAssigneeValue = useMemo(() => { + // Default to the last commenter who is not "me" so the user doesn't + // accidentally reassign to themselves when commenting on their own issue. + if (comments && comments.length > 0 && currentUserId) { + for (let i = comments.length - 1; i >= 0; i--) { + const c = comments[i]; + if (c.authorAgentId) return `agent:${c.authorAgentId}`; + if (c.authorUserId && c.authorUserId !== currentUserId) + return `user:${c.authorUserId}`; + } + } if (issue?.assigneeAgentId) return `agent:${issue.assigneeAgentId}`; if (issue?.assigneeUserId) return `user:${issue.assigneeUserId}`; return ""; - }, [issue?.assigneeAgentId, issue?.assigneeUserId]); + }, [issue?.assigneeAgentId, issue?.assigneeUserId, comments, currentUserId]); const commentsWithRunMeta = useMemo(() => { const runMetaByCommentId = new Map();