Skip to content

Commit df0b037

Browse files
perf(web): the pull request guide tab compiles without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent a702563 commit df0b037

1 file changed

Lines changed: 18 additions & 21 deletions

File tree

‎apps/web/src/components/pullRequest/PullRequestGuideTab.tsx‎

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { EnvironmentId, PullRequestRef, PullRequestReviewGuideStop } from "@t3tools/contracts";
22
import { SparklesIcon, TriangleAlertIcon } from "lucide-react";
3-
import { useEffect, useEffectEvent, useMemo } from "react";
3+
import { useEffect, useEffectEvent } from "react";
44

55
import type { ReviewCommentContext } from "~/reviewCommentContext";
66

@@ -56,26 +56,23 @@ export function PullRequestGuideTab({
5656
const pending = usePendingReviewComments(reference);
5757
const addComment = usePullRequestReviewStore((store) => store.addComment);
5858
const removeComment = usePullRequestReviewStore((store) => store.removeComment);
59-
const commenting = useMemo<ExcerptCommenting | null>(
60-
() =>
61-
!canComment && onAskAboutLines === null
62-
? null
63-
: {
64-
canComment,
65-
pending,
66-
onComment: ({ path, oldPath, position, body }) =>
67-
addComment(reviewKey, {
68-
id: nextPendingReviewCommentId(),
69-
path,
70-
...(oldPath === null ? {} : { oldPath }),
71-
position,
72-
body,
73-
}),
74-
onRemove: (commentId) => removeComment(reviewKey, commentId),
75-
onAskAgent: onAskAboutLines,
76-
},
77-
[addComment, canComment, onAskAboutLines, pending, removeComment, reviewKey],
78-
);
59+
const commenting: ExcerptCommenting | null =
60+
!canComment && onAskAboutLines === null
61+
? null
62+
: {
63+
canComment,
64+
pending,
65+
onComment: ({ path, oldPath, position, body }) =>
66+
addComment(reviewKey, {
67+
id: nextPendingReviewCommentId(),
68+
path,
69+
...(oldPath === null ? {} : { oldPath }),
70+
position,
71+
body,
72+
}),
73+
onRemove: (commentId) => removeComment(reviewKey, commentId),
74+
onAskAgent: onAskAboutLines,
75+
};
7976
useEffect(() => {
8077
if (!active) return;
8178
useGuideRunStore.getState().setShown(runKey);

0 commit comments

Comments
 (0)