Skip to content

Commit c3e9e19

Browse files
perf(web): the font previews compile with the React Compiler
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 70d60e0 commit c3e9e19

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎apps/web/reactCompiledFiles.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,5 @@ export const REACT_COMPILED_FILES = [
9696
"apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx",
9797
"apps/web/src/components/ThreadTerminalDrawer.tsx",
9898
"apps/web/src/components/settings/SettingsPanels.tsx",
99+
"apps/web/src/components/settings/SettingsFontPreviews.tsx",
99100
] as const;

‎apps/web/src/components/settings/SettingsFontPreviews.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { preloadPatchFile } from "@pierre/diffs/ssr";
2-
import { useCallback, useEffect, useRef, useState } from "react";
2+
import { useEffect, useRef, useState } from "react";
33
import { ComposerPromptEditor, type ComposerPromptEditorHandle } from "../ComposerPromptEditor";
44
import { EMPTY_COMPOSER_CONTEXT_RECORDS } from "../composerContextPresentation";
55
import { terminalThemeFromApp } from "../ThreadTerminalDrawer";
@@ -22,10 +22,10 @@ export function PromptFontPreview() {
2222
const editorRef = useRef<ComposerPromptEditorHandle>(null);
2323
const [prompt, setPrompt] = useState(PROMPT_PREVIEW_TEXT);
2424
const [cursor, setCursor] = useState(PROMPT_PREVIEW_TEXT.length);
25-
const onChange = useCallback((nextValue: string, nextCursor: number) => {
25+
const onChange = (nextValue: string, nextCursor: number) => {
2626
setPrompt(nextValue);
2727
setCursor(nextCursor);
28-
}, []);
28+
};
2929
return (
3030
<div className="mt-1 mb-2 rounded-lg border border-border bg-background px-3 py-2">
3131
<ComposerPromptEditor
@@ -173,6 +173,7 @@ export function TerminalFontPreview({ family, size }: { family: string; size: nu
173173
const surface = surfaceRef.current;
174174
if (!mount || !surface) return;
175175
surface.setTheme(terminalThemeFromApp(mount));
176+
// oxlint-disable-next-line react/exhaustive-effect-dependencies -- The tokens come from the DOM's computed styles, which a theme change rewrites.
176177
}, [theme, resolvedTheme]);
177178

178179
useEffect(() => {

0 commit comments

Comments
 (0)