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 env mode selector compiles without manual memoization (#20572)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 22:05 UTC
ef2d631a556318be0b0342262a4b6224323efc8e
1 file changed
+11
-14
apps/web/src/components/BranchToolbarEnvModeSelector.tsx
+11
-14
@@ -1,7 +1,7 @@
1
import { ComposerSelectControl } from "./chat/ComposerControl";
2
import { ComposerContextLabel } from "./ComposerContextLabel";
3
import { FolderGit2Icon, FolderGitIcon, FolderIcon } from "lucide-react";
4
-import { memo, useMemo, type MouseEvent as ReactMouseEvent } from "react";
4
+import { memo, type MouseEvent as ReactMouseEvent } from "react";
5
6
import {
7
resolveCurrentWorkspaceLabel,
@@ -46,19 +46,16 @@ export const BranchToolbarEnvModeSelector = memo(function BranchToolbarEnvModeSe
46
}: BranchToolbarEnvModeSelectorProps) {
47
const composerFloatingLayerProps = useComposerMenuProps();
48
const showPreviousWorktree = Boolean(previousWorktreeLabel && onUsePreviousWorktree);
49
- const envModeItems = useMemo(
50
- () => [
51
- {
52
- value: "local",
53
- label: resolveCurrentWorkspaceLabel(activeWorktreePath),
54
- },
55
- { value: "worktree", label: resolveEnvModeLabel("worktree") },
56
- ...(showPreviousWorktree && previousWorktreeLabel
57
- ? [{ value: PREVIOUS_WORKTREE_SELECT_VALUE, label: previousWorktreeLabel }]
58
- : []),
59
- ],
60
- [activeWorktreePath, previousWorktreeLabel, showPreviousWorktree],
61
- );
49
+ const envModeItems = [
50
+ {
51
+ value: "local",
52
+ label: resolveCurrentWorkspaceLabel(activeWorktreePath),
53
+ },
54
+ { value: "worktree", label: resolveEnvModeLabel("worktree") },
55
+ ...(showPreviousWorktree && previousWorktreeLabel
56
+ ? [{ value: PREVIOUS_WORKTREE_SELECT_VALUE, label: previousWorktreeLabel }]
57
+ : []),
58
+ ];
59
60
const stopContextMenuMouseDown = (event: ReactMouseEvent) => {
61
if (event.button !== 0 || event.ctrlKey) {