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 sidebar update capsule compiles without manual memoization (#20687)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 21:49 UTC
9e88a4f5935369eb24ecaaea43148ee9f5fe955e
1 file changed
+14
-21
apps/web/src/components/sidebar/SidebarUpdateCapsule.tsx
+14
-21
@@ -1,6 +1,6 @@
1
import { useAtomValue } from "@effect/atom-react";
2
import { Atom } from "effect/reactivity";
3
-import { type ReactNode, useCallback, useMemo, useSyncExternalStore } from "react";
3
+import { type ReactNode, useSyncExternalStore } from "react";
4
5
import { cn } from "~/lib/utils";
6
import { serverEnvironment } from "~/state/server";
@@ -24,31 +24,24 @@ import {
24
25
function useNow(intervalMs: number | null): number {
26
const step = intervalMs ?? 60_000;
27
- const subscribe = useCallback(
28
- (onChange: () => void) => {
29
- if (intervalMs === null) return () => {};
30
- const timer = setInterval(onChange, intervalMs);
31
- return () => clearInterval(timer);
32
- },
33
- [intervalMs],
34
- );
27
+ const subscribe = (onChange: () => void) => {
28
+ if (intervalMs === null) return () => {};
29
+ const timer = setInterval(onChange, intervalMs);
30
+ return () => clearInterval(timer);
31
+ };
32
return useSyncExternalStore(subscribe, () => Math.floor(Date.now() / step) * step);
33
}
34
35
function useUpdateRunMachineViews(run: UpdateEverythingRun): ReadonlyArray<UpdateRunMachineView> {
39
- const viewsAtom = useMemo(
40
- () =>
41
- Atom.make((get) =>
42
- run.machines.map((machine) => ({
43
- machine,
44
- status: resolveUpdateRunMachineStatus(
45
- machine,
46
- run.phase,
47
- get(serverEnvironment.updateStateAtom(machine.environmentId)),
48
- ),
49
- })),
36
+ const viewsAtom = Atom.make((get) =>
37
+ run.machines.map((machine) => ({
38
+ machine,
39
+ status: resolveUpdateRunMachineStatus(
40
+ machine,
41
+ run.phase,
42
+ get(serverEnvironment.updateStateAtom(machine.environmentId)),
43
),
51
- [run],
44
+ })),
45
);
46
return useAtomValue(viewsAtom);
47
}