Skip to content
TypeScript

perf(web): the chat route layout compiles without manual memoization (#20667)

Julius Marminge3ba121e9e843
diff --git a/apps/web/src/routes/_chat.tsx b/apps/web/src/routes/_chat.tsx
index 1850a650790..229b44467b5 100644
--- a/apps/web/src/routes/_chat.tsx
+++ b/apps/web/src/routes/_chat.tsx
@@ -1,7 +1,7 @@
import { AuthPreviewOperateScope } from "@t3tools/contracts";
import { Outlet, createFileRoute, redirect, useParams } from "@tanstack/react-router";
import { useAtomValue } from "@effect/atom-react";
-import { useEffect, useMemo } from "react";
+import { useEffect } from "react";
import { isCommandPaletteOpen } from "../commandPaletteBus";
import { ThreadRouteView } from "../components/ThreadRouteView";
@@ -46,16 +46,12 @@ function ChatRouteGlobalShortcuts() {
const projects = useProjects();
const primaryEnvironmentId = usePrimaryEnvironmentId();
const { scratchEnvironmentId, startScratchThread } = useScratchProject();
- const projectGroupCount = useMemo(
- () =>
- buildSidebarProjectSnapshots({
- projects,
- settings: projectGroupingSettings,
- primaryEnvironmentId,
- resolveEnvironmentLabel: () => null,
- }).length,
- [primaryEnvironmentId, projectGroupingSettings, projects],
- );
+ const projectGroupCount = buildSidebarProjectSnapshots({
+ projects,
+ settings: projectGroupingSettings,
+ primaryEnvironmentId,
+ resolveEnvironmentLabel: () => null,
+ }).length;
const terminalOpen = useTerminalUiStateStore((state) =>
routeThreadRef
? selectThreadTerminalUiState(state.terminalUiStateByThreadKey, routeThreadRef).terminalOpen