@devries-cameron20 / t3code Mirror · read-only / commits / d89076c6d8
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, 08:00 UTC

perf(web): storage settings compile with the React Compiler (#20506)

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

Julius Marminge committed Oct 16, 2026 at 18:53 UTC d89076c6d8df27a9e18eda642096f99a910d18e3
2 files changed +44 -53
apps/web/reactCompiledFiles.ts
+1
@@ -81,4 +81,5 @@ export const REACT_COMPILED_FILES = [
81 "apps/web/src/components/settings/SnapShotSetupDialog.tsx",
82 "apps/web/src/components/settings/NotificationSettings.tsx",
83 "apps/web/src/components/settings/ProviderSetupSection.tsx",
84 + "apps/web/src/components/settings/StorageSettings.tsx",
85 ] as const;
apps/web/src/components/settings/StorageSettings.tsx
+43 -53
@@ -4,7 +4,7 @@ import type {
4 WorktreeCleanupRules,
5 } from "@t3tools/contracts";
6 import { resolveWorktreeCleanup } from "@t3tools/shared/projectSettings";
7 -import { useMemo, useRef, useState } from "react";
7 +import { useRef, useState } from "react";
8 import { useAtomValue } from "@effect/atom-react";
9 import { Atom } from "effect/reactivity";
10 import {
@@ -259,32 +259,28 @@ function CleanupSection() {
259 (environment) => environment.serverConfig?.environment.capabilities.storageCleanupRun === true,
260 );
261 const state = useAtomValue(
262 - useMemo(
263 - () =>
264 - Atom.make((get) =>
265 - connectedEnvironments.flatMap((environment) => {
266 - if (environment.serverConfig?.environment.capabilities.storageCleanupRun !== true)
267 - return [];
268 - const query = get(
269 - serverEnvironment.storageCleanupReport({
270 - environmentId: environment.environmentId,
271 - input: {},
272 - }),
273 - );
274 - return [
275 - {
276 - environmentId: environment.environmentId,
277 - allowed: get(
278 - serverEnvironment.runStorageCleanup.permissionAtom(environment.environmentId),
279 - ),
280 - report: query._tag === "Success" ? query.value : null,
281 - loading: query.waiting,
282 - failed: query._tag === "Failure",
283 - },
284 - ];
262 + Atom.make((get) =>
263 + connectedEnvironments.flatMap((environment) => {
264 + if (environment.serverConfig?.environment.capabilities.storageCleanupRun !== true)
265 + return [];
266 + const query = get(
267 + serverEnvironment.storageCleanupReport({
268 + environmentId: environment.environmentId,
269 + input: {},
270 }),
286 - ),
287 - [connectedEnvironments],
271 + );
272 + return [
273 + {
274 + environmentId: environment.environmentId,
275 + allowed: get(
276 + serverEnvironment.runStorageCleanup.permissionAtom(environment.environmentId),
277 + ),
278 + report: query._tag === "Success" ? query.value : null,
279 + loading: query.waiting,
280 + failed: query._tag === "Failure",
281 + },
282 + ];
283 + }),
284 ),
285 );
286 const hasRules = supported.some((environment) => {
@@ -329,36 +325,30 @@ function CleanupSection() {
325 const deleteNow = async () => {
326 if (pending) return;
327 setPending(true);
332 - try {
333 - await Promise.all(
334 - supported
335 - .filter((environment) =>
336 - state.some(
337 - (entry) => entry.environmentId === environment.environmentId && entry.allowed,
338 - ),
339 - )
340 - .map(async (environment) => {
341 - const result = await run({ environmentId: environment.environmentId, input: {} });
342 - if (result._tag === "Success") {
343 - const failures = result.value.entries.filter((entry) => entry.outcome === "failed");
344 - if (failures.length > 0)
345 - toastManager.add({
346 - type: "error",
347 - title: `Cleanup failed on ${environment.label}`,
348 - description: failures[0]!.reason,
349 - });
350 - } else if (!isAtomCommandInterrupted(result)) {
328 + await Promise.all(
329 + supported
330 + .filter((environment) =>
331 + state.some((entry) => entry.environmentId === environment.environmentId && entry.allowed),
332 + )
333 + .map(async (environment) => {
334 + const result = await run({ environmentId: environment.environmentId, input: {} });
335 + if (result._tag === "Success") {
336 + const failures = result.value.entries.filter((entry) => entry.outcome === "failed");
337 + if (failures.length > 0)
338 toastManager.add({
339 type: "error",
353 - title: `Could not run cleanup on ${environment.label}`,
354 - description: String(squashAtomCommandFailure(result)),
340 + title: `Cleanup failed on ${environment.label}`,
341 + description: failures[0]!.reason,
342 });
356 - }
357 - }),
358 - );
359 - } finally {
360 - setPending(false);
361 - }
343 + } else if (!isAtomCommandInterrupted(result)) {
344 + toastManager.add({
345 + type: "error",
346 + title: `Could not run cleanup on ${environment.label}`,
347 + description: String(squashAtomCommandFailure(result)),
348 + });
349 + }
350 + }),
351 + ).finally(() => setPending(false));
352 };
353 return (
354 <SettingsSection id="storage-cleanup" title="Cleanup" variant="plain">