@devries-cameron20 / t3code-1 / commits / 506955372a
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

perf(web): the server update banner compiles without manual memoization (#20570)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 16, 2026 at 22:05 UTC 506955372a24ec02c5dea6b5803add87ff0107ae
1 file changed +6 -10
apps/web/src/components/chat/useAutoBalanceUpdateBanner.tsx
+6 -10
@@ -1,7 +1,7 @@
1 import { useAtomValue } from "@effect/atom-react";
2 import type { ServerUpdateState } from "@t3tools/client-runtime/state/server";
3 import { Atom } from "effect/reactivity";
4 -import { useMemo, useState } from "react";
4 +import { useState } from "react";
5
6 import type { EnvironmentPresentation } from "~/state/environments";
7 import { serverEnvironment } from "~/state/server";
@@ -29,15 +29,11 @@ import { ComposerServerUpdateIcon } from "./ComposerServerUpdateStatus";
29 export function useAutoBalanceUpdateBanner(
30 environments: readonly EnvironmentPresentation[],
31 ): ComposerBannerStackItem | null {
32 - const statesAtom = useMemo(
33 - () =>
34 - Atom.make((get) =>
35 - environments.map((environment) => ({
36 - environment,
37 - state: get(serverEnvironment.updateStateAtom(environment.environmentId)),
38 - })),
39 - ),
40 - [environments],
32 + const statesAtom = Atom.make((get) =>
33 + environments.map((environment) => ({
34 + environment,
35 + state: get(serverEnvironment.updateStateAtom(environment.environmentId)),
36 + })),
37 );
38 const states = useAtomValue(statesAtom);
39 const [dismissedNotices, setDismissedNotices] = useState<ReadonlySet<string | ServerUpdateState>>(