The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 06:45 UTC
perf(web): the project file picker compiles without manual memoization (#20685)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 21:50 UTC
6ad62b8ab1a5bd3fdaa8fe84bf307c4d44a27818
1 file changed
+25
-32
apps/web/src/components/files/ProjectFilePicker.tsx
+25
-32
@@ -1,5 +1,5 @@
1
import { useAtomValue } from "@effect/atom-react";
2
-import { useMemo, useState, type ReactNode } from "react";
2
+import { useState, type ReactNode } from "react";
3
4
import { useActiveProjectTarget, type ActiveProjectTarget } from "~/hooks/useActiveProjectTarget";
5
import { useTheme } from "~/hooks/useTheme";
@@ -80,38 +80,31 @@ function OpenProjectFilePicker(props: ProjectFilePickerProps & { target: ActiveP
80
);
81
const { resolvedTheme } = useTheme();
82
const keybindings = useAtomValue(primaryServerKeybindingsAtom);
83
- const matches = useMemo(
84
- () => getProjectFilePickerMatches(result.entries, result.matchedQuery),
85
- [result.entries, result.matchedQuery],
86
- );
83
+ const matches = getProjectFilePickerMatches(result.entries, result.matchedQuery);
84
const hasMatchedQuery = /\S/.test(result.matchedQuery);
88
- const items = useMemo<CommandPaletteActionItem[]>(
89
- () =>
90
- matches.map((match) => ({
91
- kind: "action",
92
- value: `file:${match.path}`,
93
- searchTerms: [match.name, match.path],
94
- title: (
95
- <HighlightedFuzzyText
96
- active={hasMatchedQuery}
97
- value={match.name}
98
- indices={match.nameMatchIndices}
99
- />
100
- ),
101
- description: (
102
- <HighlightedFuzzyText
103
- active={hasMatchedQuery}
104
- value={match.path}
105
- indices={match.pathMatchIndices}
106
- />
107
- ),
108
- icon: <PierreEntryIcon pathValue={match.path} kind="file" theme={resolvedTheme} />,
109
- run: async () => {
110
- useRightPanelStore.getState().openFile(target.threadRef, match.path);
111
- },
112
- })),
113
- [hasMatchedQuery, matches, resolvedTheme, target.threadRef],
114
- );
85
+ const items: CommandPaletteActionItem[] = matches.map((match) => ({
86
+ kind: "action",
87
+ value: `file:${match.path}`,
88
+ searchTerms: [match.name, match.path],
89
+ title: (
90
+ <HighlightedFuzzyText
91
+ active={hasMatchedQuery}
92
+ value={match.name}
93
+ indices={match.nameMatchIndices}
94
+ />
95
+ ),
96
+ description: (
97
+ <HighlightedFuzzyText
98
+ active={hasMatchedQuery}
99
+ value={match.path}
100
+ indices={match.pathMatchIndices}
101
+ />
102
+ ),
103
+ icon: <PierreEntryIcon pathValue={match.path} kind="file" theme={resolvedTheme} />,
104
+ run: async () => {
105
+ useRightPanelStore.getState().openFile(target.threadRef, match.path);
106
+ },
107
+ }));
108
109
const emptyStateMessage = getEmptyStateMessage(query, result.error, result.isPending);
110