Skip to content

Commit 77a4083

Browse files
perf(web): the project icon picker compiles with the React Compiler
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 3cde87d commit 77a4083

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

‎apps/web/reactCompiledFiles.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ export const REACT_COMPILED_FILES = [
3232
"apps/web/src/components/ThreadNotificationCoordinator.tsx",
3333
"apps/web/src/state/queries.ts",
3434
"apps/web/src/state/sourceControlActions.ts",
35+
"apps/web/src/components/settings/ProjectFaviconPickerDialog.tsx",
3536
] as const;

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

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useAtomValue } from "@effect/atom-react";
22
import type { EnvironmentId } from "@t3tools/contracts";
33
import { isWindowsAbsolutePath } from "@t3tools/shared/path";
4-
import { useMemo, useState } from "react";
4+
import { useState } from "react";
55

66
import { primaryServerKeybindingsAtom } from "~/state/server";
77
import { useTheme } from "~/hooks/useTheme";
@@ -48,23 +48,22 @@ export function ProjectFaviconPickerDialog(props: {
4848
);
4949
const { resolvedTheme } = useTheme();
5050
const keybindings = useAtomValue(primaryServerKeybindingsAtom);
51-
const pickExternal = props.onPickExternal;
51+
const { onPickExternal: pickExternal, onSelect } = props;
5252
const fileManagerName = getLocalFileManagerName(
5353
typeof navigator === "undefined" ? "" : navigator.platform,
5454
);
55-
const items = useMemo<CommandPaletteActionItem[]>(
56-
() =>
57-
getProjectFilePickerMatches(result.entries, result.matchedQuery).map((match) => ({
58-
kind: "action",
59-
value: `project-favicon:${match.path}`,
60-
searchTerms: [match.name, match.path],
61-
title: match.name,
62-
description: match.path,
63-
icon: <PierreEntryIcon pathValue={match.path} kind="file" theme={resolvedTheme} />,
64-
run: async () => props.onSelect(match.path),
65-
})),
66-
[props.onSelect, resolvedTheme, result.entries, result.matchedQuery],
67-
);
55+
const items: CommandPaletteActionItem[] = getProjectFilePickerMatches(
56+
result.entries,
57+
result.matchedQuery,
58+
).map((match) => ({
59+
kind: "action",
60+
value: `project-favicon:${match.path}`,
61+
searchTerms: [match.name, match.path],
62+
title: match.name,
63+
description: match.path,
64+
icon: <PierreEntryIcon pathValue={match.path} kind="file" theme={resolvedTheme} />,
65+
run: async () => onSelect(match.path),
66+
}));
6867

6968
return (
7069
<CommandDialog open={props.open} onOpenChange={props.onOpenChange}>
@@ -89,7 +88,7 @@ export function ProjectFaviconPickerDialog(props: {
8988
.then((path) => {
9089
if (!path) return;
9190
props.onOpenChange(false);
92-
props.onSelect(path);
91+
onSelect(path);
9392
})
9493
.catch((error: unknown) => {
9594
toastManager.add({

0 commit comments

Comments
 (0)