The best way to control Claude Code, Codex and more from any computer or phone
perf(web): the pull request guide tab compiles without manual memoization (#20716)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 21:47 UTC
d2213c8be56a913fcbe5e535d1b6b526b2d316b0
1 file changed
+18
-21
apps/web/src/components/pullRequest/PullRequestGuideTab.tsx
+18
-21
@@ -1,6 +1,6 @@
1
import type { EnvironmentId, PullRequestRef, PullRequestReviewGuideStop } from "@t3tools/contracts";
2
import { SparklesIcon, TriangleAlertIcon } from "lucide-react";
3
-import { useEffect, useEffectEvent, useMemo } from "react";
3
+import { useEffect, useEffectEvent } from "react";
4
5
import type { ReviewCommentContext } from "~/reviewCommentContext";
6
@@ -56,26 +56,23 @@ export function PullRequestGuideTab({
56
const pending = usePendingReviewComments(reference);
57
const addComment = usePullRequestReviewStore((store) => store.addComment);
58
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
+ };
76
useEffect(() => {
77
if (!active) return;
78
useGuideRunStore.getState().setShown(runKey);