From dbe2481d5759ed474ddb46eadc99e0a337a8cb00 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Mon, 13 Jul 2026 17:37:16 -0700 Subject: [PATCH] Being able to reply to any comment from bot (#8621) * Allow replying to any comment in a thread, not just the root Reply state now tracks a comment id instead of a group id, and reply composers/handlers are threaded through each comment row (root and replies alike) so any comment can receive an inline reply rather than only the thread root. * Fix reply cancellation clearing the wrong comment's reply box When multiple comment threads had reply boxes open, cancelling one reply cleared replyingCommentId unconditionally, closing whichever box was open instead of the one actually cancelled. onCancelReply now threads through the specific commentId so cancellation only clears state if it matches the currently open reply. --- .../right-sidebar/checks-panel-content.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/components/right-sidebar/checks-panel-content.tsx b/src/renderer/src/components/right-sidebar/checks-panel-content.tsx index 0ffc41dd6..84798c944 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel-content.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel-content.tsx @@ -1980,7 +1980,7 @@ function PRCommentGroupView({ presentation: PRCommentPresentationClasses onResolve?: (threadId: string, resolve: boolean) => boolean | Promise onStartReply?: (commentId: number) => void - onCancelReply?: () => void + onCancelReply?: (commentId: number) => void onReply?: (comment: PRComment, body: string) => Promise onEditComment?: (comment: PRComment, body: string) => Promise onDeleteComment?: (comment: PRComment) => void | Promise @@ -2001,7 +2001,7 @@ function PRCommentGroupView({ autoFocus disabled={replyDisabled} disabledReason={replyDisabledReason} - onCancel={onCancelReply} + onCancel={() => onCancelReply?.(comment.id)} onSubmit={(body) => onReply(comment, body)} /> @@ -2113,7 +2113,7 @@ function ResolvedCommentGroupsSection({ presentation: PRCommentPresentationClasses onResolve?: (threadId: string, resolve: boolean) => boolean | Promise onStartReply?: (commentId: number) => void - onCancelReply?: () => void + onCancelReply?: (commentId: number) => void onReply?: (comment: PRComment, body: string) => Promise onEditComment?: (comment: PRComment, body: string) => Promise onDeleteComment?: (comment: PRComment) => void | Promise @@ -2351,7 +2351,9 @@ export function PRCommentsList({ presentation={presentation} onResolve={onResolve} onStartReply={setReplyingCommentId} - onCancelReply={() => setReplyingCommentId(null)} + onCancelReply={(commentId) => + setReplyingCommentId((current) => (current === commentId ? null : current)) + } onReply={onReply} onEditComment={onEditComment} onDeleteComment={onDeleteComment} @@ -2679,7 +2681,9 @@ export function PRCommentsList({ presentation={presentation} onResolve={onResolve} onStartReply={setReplyingCommentId} - onCancelReply={() => setReplyingCommentId(null)} + onCancelReply={(commentId) => + setReplyingCommentId((current) => (current === commentId ? null : current)) + } onReply={onReply} onEditComment={onEditComment} onDeleteComment={onDeleteComment}