From 4161af67d198121e131f46fce889f6574d8e8a13 Mon Sep 17 00:00:00 2001 From: Devin Foley Date: Wed, 8 Apr 2026 17:14:01 -0700 Subject: [PATCH] fix: address greptile review feedback (greploop iteration 1) - Add missing useMemo deps (pendingApprovalAction, onApproveApproval, onRejectApproval) in CommentThread timelineSection - Use .mutateAsync in useCallback deps instead of full mutation objects in IssueDetail to prevent unnecessary re-renders --- ui/src/components/CommentThread.tsx | 1 + ui/src/pages/IssueDetail.tsx | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ui/src/components/CommentThread.tsx b/ui/src/components/CommentThread.tsx index a22ec463c49..b2125b254cf 100644 --- a/ui/src/components/CommentThread.tsx +++ b/ui/src/components/CommentThread.tsx @@ -736,6 +736,7 @@ export const CommentThread = memo(function CommentThread({ ), [ timeline, agentMap, currentUserId, companyId, projectId, + onApproveApproval, onRejectApproval, pendingApprovalAction, feedbackVoteByTargetId, feedbackDataSharingPreference, onVote, handleFeedbackVote, votingTargetId, highlightCommentId, feedbackTermsUrl, diff --git a/ui/src/pages/IssueDetail.tsx b/ui/src/pages/IssueDetail.tsx index 074b305cc45..16346bb5234 100644 --- a/ui/src/pages/IssueDetail.tsx +++ b/ui/src/pages/IssueDetail.tsx @@ -1052,7 +1052,7 @@ export function IssueDetail() { async (runId: string) => { await interruptQueuedComment.mutateAsync(runId); }, - [interruptQueuedComment], + [interruptQueuedComment.mutateAsync], ); const handleCommentImageUpload = useCallback( @@ -1060,14 +1060,14 @@ export function IssueDetail() { const attachment = await uploadAttachment.mutateAsync(file); return attachment.contentPath; }, - [uploadAttachment], + [uploadAttachment.mutateAsync], ); const handleCommentAttachImage = useCallback( async (file: File) => { await uploadAttachment.mutateAsync(file); }, - [uploadAttachment], + [uploadAttachment.mutateAsync], ); const handleCommentAdd = useCallback( @@ -1078,7 +1078,7 @@ export function IssueDetail() { } await addComment.mutateAsync({ body, reopen }); }, - [addComment, addCommentAndReassign], + [addComment.mutateAsync, addCommentAndReassign.mutateAsync], ); const handleCommentVote = useCallback( @@ -1092,7 +1092,7 @@ export function IssueDetail() { sharingPreferenceAtSubmit: feedbackDataSharingPreference, }); }, - [feedbackVoteMutation, feedbackDataSharingPreference], + [feedbackVoteMutation.mutateAsync, feedbackDataSharingPreference], ); useEffect(() => {