The best way to control Claude Code, Codex and more from any computer or phone
perf(web): the guide file diff compiles without manual memoization (#20544)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 22:28 UTC
02d48aec5c75e6abb90d06fd2c63939a82bd3718
1 file changed
+12
-16
apps/web/src/components/pullRequest/guide/GuideFileDiff.tsx
+12
-16
@@ -4,7 +4,6 @@ import {
4
type FileDiffMetadata,
5
} from "@pierre/diffs";
6
import { FileDiff } from "@pierre/diffs/react";
7
-import { useMemo } from "react";
7
8
import { useTheme } from "~/hooks/useTheme";
9
import { resolveDiffThemeName } from "~/lib/diffRendering";
@@ -22,21 +21,18 @@ export function GuideFileDiff({
21
const { resolvedTheme } = useTheme();
22
// Loading the unchanged lines rewrites the diff it is given; the excerpts read the same file
23
// as a patch, so this view expands a copy of its own.
25
- const expandable = useMemo(() => cloneFileDiffMetadata(file), [file]);
26
- const options = useMemo(
27
- () => ({
28
- diffStyle: "unified" as const,
29
- lineDiffType: "none" as const,
30
- overflow: "scroll" as const,
31
- disableFileHeader: true,
32
- theme: resolveDiffThemeName(resolvedTheme),
33
- themeType: resolvedTheme,
34
- preferredHighlighter: PREFERRED_HIGHLIGHTER,
35
- unsafeCSS: DIFF_VIEW_UNSAFE_CSS,
36
- loadDiffFiles,
37
- }),
38
- [loadDiffFiles, resolvedTheme],
39
- );
24
+ const expandable = cloneFileDiffMetadata(file);
25
+ const options = {
26
+ diffStyle: "unified" as const,
27
+ lineDiffType: "none" as const,
28
+ overflow: "scroll" as const,
29
+ disableFileHeader: true,
30
+ theme: resolveDiffThemeName(resolvedTheme),
31
+ themeType: resolvedTheme,
32
+ preferredHighlighter: PREFERRED_HIGHLIGHTER,
33
+ unsafeCSS: DIFF_VIEW_UNSAFE_CSS,
34
+ loadDiffFiles,
35
+ };
36
return (
37
<div className="border-t border-border/60">
38
<FileDiff fileDiff={expandable} options={options} />