@devries-cameron20 / t3code Mirror · read-only / commits / 341738b80a
Fork 0

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, 05:30 UTC

refactor(web): the pull request stack hook keeps its caching without "use memo" (#20741)

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

Julius Marminge committed Oct 16, 2026 at 23:19 UTC 341738b80a8824dcaf6fbb2401c860135bc9a043
1 file changed +10 -14
apps/web/src/state/usePullRequestStack.ts
+10 -14
@@ -7,26 +7,22 @@ import { useThreadShells } from "./entities";
7 import { pullRequestStackAtom } from "./pullRequests";
8 import { useEnvironmentQuery } from "./query";
9
10 -function useSavedPullRequestStack(environmentId: EnvironmentId, reference: PullRequestRef | null) {
11 - "use memo";
12 - const threads = useThreadShells();
13 - return reference === null
14 - ? null
15 - : savedPullRequestStack(
16 - threads
17 - .filter((thread) => thread.environmentId === environmentId)
18 - .flatMap((thread) => thread.pullRequests ?? []),
19 - reference,
20 - );
21 -}
22 -
10 export function usePullRequestStack(
11 environmentId: EnvironmentId,
12 reference: PullRequestRef | null,
13 ) {
27 - const saved = useSavedPullRequestStack(environmentId, reference);
14 + const threads = useThreadShells();
15 const query = useEnvironmentQuery(
16 reference === null ? null : pullRequestStackAtom({ environmentId, input: reference }),
17 );
18 + const saved =
19 + reference === null
20 + ? null
21 + : savedPullRequestStack(
22 + threads
23 + .filter((thread) => thread.environmentId === environmentId)
24 + .flatMap((thread) => thread.pullRequests ?? []),
25 + reference,
26 + );
27 return { ...query, ...pullRequestStackView(query, saved) };
28 }