Skip to content

Commit 6b477d4

Browse files
perf(web): the chat route layout compiles without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 70d60e0 commit 6b477d4

2 files changed

Lines changed: 8 additions & 11 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/routes/_chat.tsx",
99100
] as const;

‎apps/web/src/routes/_chat.tsx‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { AuthPreviewOperateScope } from "@t3tools/contracts";
22
import { Outlet, createFileRoute, redirect, useParams } from "@tanstack/react-router";
33
import { useAtomValue } from "@effect/atom-react";
4-
import { useEffect, useMemo } from "react";
4+
import { useEffect } from "react";
55

66
import { isCommandPaletteOpen } from "../commandPaletteBus";
77
import { ThreadRouteView } from "../components/ThreadRouteView";
@@ -46,16 +46,12 @@ function ChatRouteGlobalShortcuts() {
4646
const projects = useProjects();
4747
const primaryEnvironmentId = usePrimaryEnvironmentId();
4848
const { scratchEnvironmentId, startScratchThread } = useScratchProject();
49-
const projectGroupCount = useMemo(
50-
() =>
51-
buildSidebarProjectSnapshots({
52-
projects,
53-
settings: projectGroupingSettings,
54-
primaryEnvironmentId,
55-
resolveEnvironmentLabel: () => null,
56-
}).length,
57-
[primaryEnvironmentId, projectGroupingSettings, projects],
58-
);
49+
const projectGroupCount = buildSidebarProjectSnapshots({
50+
projects,
51+
settings: projectGroupingSettings,
52+
primaryEnvironmentId,
53+
resolveEnvironmentLabel: () => null,
54+
}).length;
5955
const terminalOpen = useTerminalUiStateStore((state) =>
6056
routeThreadRef
6157
? selectThreadTerminalUiState(state.terminalUiStateByThreadKey, routeThreadRef).terminalOpen

0 commit comments

Comments
 (0)