Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

StorageSettings.tsx

710 lines26.5 KB

1import type {
2 StorageCleanupReport,
3 StorageCleanupSettings,
4 WorktreeCleanupRules,
5} from "@t3tools/contracts";
6import { resolveWorktreeCleanup } from "@t3tools/shared/projectSettings";
7import { useRef, useState } from "react";
8import { useAtomValue } from "@effect/atom-react";
9import {
10 isAtomCommandInterrupted,
11 squashAtomCommandFailure,
12} from "@t3tools/client-runtime/state/runtime";
13import { formatBytes } from "../../lib/formatBytes";
14import { environmentAtomList, environmentIdsKey } from "../../state/environmentAtomList";
15import { serverEnvironment } from "../../state/server";
16import { useAtomCommand } from "../../state/use-atom-command";
17import { formatRelativeTimeLabel } from "../../timestampFormat";
18import { Button } from "../ui/button";
19import { toastManager } from "../ui/toast";
20​
21import { Input } from "../ui/input";
22import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "../ui/select";
23import { Switch } from "../ui/switch";
24import {
25 NumberField,
26 NumberFieldDecrement,
27 NumberFieldGroup,
28 NumberFieldIncrement,
29 NumberFieldInput,
30} from "../ui/number-field";
31import {
32 SettingResetButton,
33 SettingsPageContainer,
34 SettingsRow,
35 SettingsSection,
36 useRelativeTimeTick,
37} from "./settingsLayout";
38import { DatabaseStorageNotice } from "./DatabaseStorageNotice";
39import { SettingsScopeNotice } from "./SettingsScopeNotice";
40import { FoldedSettingsSection } from "./FoldedSettingsSection";
41import { SettingsGroup } from "./SettingsGroup";
42import type { ScopedSettingsTarget } from "./scopedSettings";
43import { useSettingsScope } from "./SettingsScopeContext";
44import { searchableSetting } from "./settingsSearch";
45import {
46 useClearScopedSettings,
47 useScopedSettings,
48 useScopedSettingsMixed,
49 useUpdateScopedSettings,
50} from "./useScopedSettings";
51import { settingsScopeEnvironmentLabel } from "./settingsScopeAxis";
52​
53function WorktreesDirectoryRow() {
54 const { connectedEnvironments, targets } = useSettingsScope();
55 const settings = useScopedSettings();
56 const updateSettings = useUpdateScopedSettings();
57 const mixed = useScopedSettingsMixed(["worktreesDirectory"]);
58 const edited = useRef(false);
59 if (
60 connectedEnvironments.some(
61 (environment) =>
62 environment.serverConfig?.environment.capabilities.worktreesDirectory !== true,
63 )
64 )
65 return null;
66 const scopeKey = targets.map((target) => target.environmentId).join(",");
67​
68 return (
69 <SettingsRow
70 {...searchableSetting("storage-worktrees-location")}
71 description={
72 "Folder where new worktrees are created, on any drive, such as D:\\worktrees or ~/worktrees. Existing worktrees stay where they are. Leave empty to use the T3 home folder."
73 }
74 serverScoped
75 settingKeys={["worktreesDirectory"]}
76 resetAction={
77 mixed || settings.worktreesDirectory !== "" ? (
78 <SettingResetButton
79 label="worktree location"
80 onClick={() => updateSettings({ worktreesDirectory: "" })}
81 />
82 ) : null
83 }
84 control={
85 <Input
86 key={`${scopeKey}:${mixed}:${settings.worktreesDirectory}`}
87 aria-label="Worktree location"
88 autoCapitalize="none"
89 spellCheck={false}
90 placeholder={mixed ? "Mixed" : "Default"}
91 defaultValue={mixed ? "" : settings.worktreesDirectory}
92 onChange={() => {
93 edited.current = true;
94 }}
95 onBlur={(event) => {
96 const value = event.target.value.trim();
97 if (edited.current && (mixed || value !== settings.worktreesDirectory))
98 updateSettings({ worktreesDirectory: value });
99 edited.current = false;
100 }}
101 />
102 }
103 />
104 );
106​
107function RetentionControl({
108 label,
109 value,
110 onChange,
111 minimum = 1,
112}: {
113 label: string;
114 value: number | null;
115 onChange: (value: number | null) => void;
116 minimum?: number;
117}) {
118 const [draft, setDraft] = useState(value);
119 const [savedValue, setSavedValue] = useState(value);
120 if (savedValue !== value) {
121 setSavedValue(value);
122 setDraft(value);
123 }
124​
125 return (
126 <div className="flex items-center gap-3">
127 {value !== null ? (
128 <NumberField
129 value={draft}
130 min={minimum}
131 max={3650}
132 step={1}
133 size="sm"
134 className="w-auto"
135 onValueChange={setDraft}
136 onValueCommitted={(next) => {
137 if (next === null) setDraft(value);
138 else {
139 const days = Math.min(3650, Math.max(minimum, Math.round(next)));
140 setDraft(days);
141 onChange(days);
142 }
143 }}
144 >
145 <NumberFieldGroup>
146 <NumberFieldDecrement aria-label={`Decrease ${label}`} />
147 <NumberFieldInput
148 aria-label={`${label} in days`}
149 size={new Intl.NumberFormat().format(draft ?? value).length}
150 className="field-sizing-content w-auto min-w-[1ch] grow-0 text-right"
151 />
152 <span aria-hidden="true" className="self-center pr-2 text-xs">
153 days
154 </span>
155 <NumberFieldIncrement aria-label={`Increase ${label}`} />
156 </NumberFieldGroup>
157 </NumberField>
158 ) : (
159 <span className="text-xs text-muted-foreground">Off</span>
160 )}
161 <Switch
162 aria-label={label}
163 checked={value !== null}
164 onCheckedChange={(enabled) => onChange(enabled ? 8 : null)}
165 />
166 </div>
167 );
169​
170const KEEP_WHEN_LABELS = {
171 "any-local-files": "Any local files",
172 "uncommitted-changes": "Uncommitted changes",
173 "tracked-changes": "Edited tracked files",
174} as const;
175​
176function lastRunSummary(
177 entries: readonly { readonly label: string; readonly counts: string }[],
178 machineCount: number,
179) {
180 const first = entries[0];
181 if (!first) return "";
182 if (machineCount <= 1) return first.counts;
183 if (entries.length === machineCount && entries.every((entry) => entry.counts === first.counts)) {
184 return `${first.counts} on every machine`;
185 }
186 return entries.map((entry) => `${entry.label}: ${entry.counts}`).join(" · ");
188​
189function CleanupResults({
190 report,
191 environmentLabel,
192}: {
193 report: StorageCleanupReport;
194 environmentLabel: string;
195}) {
196 return (
197 <>
198 {report.entries.map((entry, index) => {
199 const name =
200 entry.kind === "worktree"
201 ? ((entry.threadId === null
202 ? entry.path
203 : entry.path?.split(/[\\/]/).findLast(Boolean)) ?? "Worktrees")
204 : entry.kind === "logs"
205 ? "Rotated logs"
206 : "Browser artifacts";
207 return (
208 <SettingsRow
209 key={`${entry.path ?? entry.kind}:${entry.threadId ?? index}`}
210 title={<span className="wrap-anywhere select-text">{name}</span>}
211 description={
212 <span className="block space-y-2 wrap-anywhere select-text">
213 <span className={`block ${entry.outcome === "failed" ? "text-destructive" : ""}`}>
214 {entry.reason}
215 </span>
216 <span className="grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 border-l border-border/60 pl-3">
217 <span>Machine</span>
218 <span className="text-foreground/80">{environmentLabel}</span>
219 {entry.projectPath && (
220 <>
221 <span>Project</span>
222 <code className="text-foreground/80">{entry.projectPath}</code>
223 </>
224 )}
225 {entry.path && (
226 <>
227 <span>Folder</span>
228 <code className="text-foreground/80">{entry.path}</code>
229 </>
230 )}
231 {entry.threadTitle && (
232 <>
233 <span>Thread</span>
234 <span>{entry.threadTitle}</span>
235 </>
236 )}
237 </span>
238 </span>
239 }
240 control={
241 (entry.outcome === "removed" ||
242 (entry.outcome === "kept" && entry.bytes !== null)) && (
243 <span className="text-xs text-muted-foreground">
244 {[
245 entry.kind !== "worktree" && entry.files !== null
246 ? `${entry.files.toLocaleString()} ${entry.files === 1 ? "file" : "files"}`
247 : null,
248 entry.bytes !== null ? formatBytes(entry.bytes) : null,
249 ]
250 .filter(Boolean)
251 .join(" · ")}
252 </span>
253 )
254 }
255 />
256 );
257 })}
258 {report.omittedCount > 0 && (
259 <p className="px-3 py-2.5 text-xs text-muted-foreground sm:px-4">
260 {environmentLabel}: {report.omittedCount.toLocaleString()} more results.
261 </p>
262 )}
263 {report.entries.length === 0 && report.omittedCount === 0 && (
264 <p className="px-3 py-2.5 text-xs text-muted-foreground sm:px-4">
265 {environmentLabel}: Nothing needed cleanup.
266 </p>
267 )}
268 </>
269 );
271​
272const storageCleanupReportsAtom = environmentAtomList(
273 "web-storage-cleanup-reports",
274 (environmentId) => serverEnvironment.storageCleanupReport({ environmentId, input: {} }),
275);
276const storageCleanupPermissionsAtom = environmentAtomList(
277 "web-storage-cleanup-permissions",
278 serverEnvironment.runStorageCleanup.permissionAtom,
279);
280​
281function CleanupSection() {
282 useRelativeTimeTick(60_000);
283 const { connectedEnvironments } = useSettingsScope();
284 const [pending, setPending] = useState(false);
285 const run = useAtomCommand(serverEnvironment.runStorageCleanup);
286 const supported = connectedEnvironments.filter(
287 (environment) => environment.serverConfig?.environment.capabilities.storageCleanupRun === true,
288 );
289 const supportedIds = supported.map(({ environmentId }) => environmentId);
290 const reports = useAtomValue(storageCleanupReportsAtom(environmentIdsKey(supportedIds)));
291 const permissions = useAtomValue(storageCleanupPermissionsAtom(environmentIdsKey(supportedIds)));
292 const state = supportedIds.map((environmentId, index) => {
293 const query = reports[index]!;
294 return {
295 environmentId,
296 allowed: permissions[index]!,
297 report: query._tag === "Success" ? query.value : null,
298 loading: query.waiting,
299 failed: query._tag === "Failure",
300 };
301 });
302 const hasRules = supported.some((environment) => {
303 const settings = environment.serverConfig?.settings;
304 if (!settings) return false;
305 const enabled = (rules: WorktreeCleanupRules) =>
306 rules.worktreeAfterDays !== null ||
307 rules.worktreeSettledAfterDays !== null ||
308 rules.worktreeOnMerge ||
309 rules.worktreeOnDelete ||
310 rules.worktreeUnchanged;
311 return (
312 settings.storageCleanup.browserArtifactsAfterDays !== null ||
313 settings.storageCleanup.logsAfterDays !== null ||
314 enabled(resolveWorktreeCleanup(settings, null)) ||
315 Object.values(settings.projectSettingsOverrides).some(
316 (override) =>
317 override.worktreeCleanup?.mode === "custom" && enabled(override.worktreeCleanup.rules),
318 )
319 );
320 });
321 if (supported.length === 0) return null;
322 const summaries = supported.map((environment) => {
323 const query = state.find((entry) => entry.environmentId === environment.environmentId);
324 const report = query?.report ?? null;
325 return {
326 environment,
327 report,
328 label: settingsScopeEnvironmentLabel(environment, connectedEnvironments),
329 counts: report
330 ? `${report.counts.removed} removed, ${report.counts.kept} kept${report.counts.failed > 0 ? `, ${report.counts.failed} failed` : ""}`
331 : "",
332 description: report
333 ? `Last run ${formatRelativeTimeLabel(report.finishedAt)}. ${formatBytes(report.bytesFreed)} recovered.${report.counts.failed > 0 ? ` ${report.counts.failed} ${report.counts.failed === 1 ? "item" : "items"} couldn't be removed.` : ""}`
334 : query?.failed
335 ? "Could not load the last run."
336 : query?.loading
337 ? "Loading last run…"
338 : "Cleanup hasn't run yet.",
339 };
340 });
341 const deleteNow = async () => {
342 if (pending) return;
343 setPending(true);
344 await Promise.all(
345 supported
346 .filter((environment) =>
347 state.some((entry) => entry.environmentId === environment.environmentId && entry.allowed),
348 )
349 .map(async (environment) => {
350 const result = await run({ environmentId: environment.environmentId, input: {} });
351 if (result._tag === "Success") {
352 const failures = result.value.entries.filter((entry) => entry.outcome === "failed");
353 if (failures.length > 0)
354 toastManager.add({
355 type: "error",
356 title: `Cleanup failed on ${environment.label}`,
357 description: failures[0]!.reason,
358 });
359 } else if (!isAtomCommandInterrupted(result)) {
360 toastManager.add({
361 type: "error",
362 title: `Could not run cleanup on ${environment.label}`,
363 description: String(squashAtomCommandFailure(result)),
364 });
365 }
366 }),
367 ).finally(() => setPending(false));
368 };
369 return (
370 <SettingsSection id="storage-cleanup" title="Cleanup" variant="plain">
371 <SettingsGroup>
372 <SettingsRow
373 {...searchableSetting("storage-delete-now")}
374 description={
375 <span>
376 {!hasRules
377 ? "Turn on a cleanup rule to use this."
378 : summaries.map(({ environment, label, description }) => (
379 <span key={environment.environmentId} className="block">
380 {supported.length > 1 ? `${label}: ` : ""}
381 {description}
382 </span>
383 ))}
384 </span>
385 }
386 control={
387 <Button
388 variant="outline"
389 size="sm"
390 disabled={pending || !hasRules || !state.some((entry) => entry.allowed)}
391 onClick={() => void deleteNow()}
392 >
393 {pending ? "Deleting…" : "Delete now"}
394 </Button>
395 }
396 />
397 </SettingsGroup>
398 {summaries.some(({ report }) => report !== null) && (
399 <FoldedSettingsSection
400 id="storage-cleanup-last-run"
401 title="Last run"
402 headerPlacement="inside"
403 summary={lastRunSummary(
404 summaries.filter(({ report }) => report !== null),
405 connectedEnvironments.length,
406 )}
407 >
408 {summaries.map(
409 ({ environment, label, report }) =>
410 report && (
411 <CleanupResults
412 key={environment.environmentId}
413 report={report}
414 environmentLabel={label}
415 />
416 ),
417 )}
418 </FoldedSettingsSection>
419 )}
420 </SettingsSection>
421 );
423​
424export function StorageSettingsPanel() {
425 const { scope, environments, connectedEnvironments, targets, target } = useSettingsScope();
426 const scopedSettings = useScopedSettings();
427 const isProjectScope = scope.kind === "project" || scope.kind === "checkout";
428 const settings = {
429 ...scopedSettings.storageCleanup,
430 ...resolveWorktreeCleanup(scopedSettings, null),
431 };
432 const projectMode = (entry: ScopedSettingsTarget | null) =>
433 entry?.sources.worktreeCleanup === "project"
434 ? (entry.settings.worktreeCleanup?.mode ?? "inherit")
435 : "inherit";
436 const mode = projectMode(target);
437 const mixedModes = targets.some((entry) => projectMode(entry) !== mode);
438 const updateSettings = useUpdateScopedSettings();
439 const clearSettings = useClearScopedSettings();
440 const ruleStatus = (key: keyof StorageCleanupSettings) =>
441 targets.some(
442 (target) =>
443 ({ ...target.settings.storageCleanup, ...resolveWorktreeCleanup(target.settings, null) })[
444 key
445 ] !== settings[key],
446 )
447 ? "Mixed across selected machines"
448 : undefined;
449 const update = (patch: Partial<StorageCleanupSettings>) =>
450 updateSettings({ storageCleanup: patch });
451 const updateWorktree = (patch: Partial<WorktreeCleanupRules>) =>
452 isProjectScope
453 ? updateSettings({ worktreeCleanup: { mode: "custom", rules: patch } })
454 : update(patch);
455​
456 if (
457 isProjectScope &&
458 connectedEnvironments.some(
459 (environment) =>
460 environment.serverConfig?.environment.capabilities.projectWorktreeCleanup !== true,
461 )
462 ) {
463 return (
464 <SettingsScopeNotice target="all">
465 Update the selected machines to configure project worktree cleanup.
466 </SettingsScopeNotice>
467 );
468 }
469​
470 if (
471 connectedEnvironments.some(
472 (environment) => environment.serverConfig?.environment.capabilities.storageCleanup !== true,
473 )
474 ) {
475 return (
476 <SettingsScopeNotice
477 target="environment"
478 eligibleEnvironmentIds={connectedEnvironments
479 .filter(
480 (environment) =>
481 environment.serverConfig?.environment.capabilities.storageCleanup === true,
482 )
483 .map((environment) => environment.environmentId)}
484 >
485 Update the selected environments to use storage cleanup, or choose a machine that supports
486 it.
487 </SettingsScopeNotice>
488 );
489 }
490​
491 return (
492 <SettingsPageContainer>
493 {!isProjectScope && (
494 <DatabaseStorageNotice
495 environments={connectedEnvironments.filter(
496 (environment) =>
497 environment.serverConfig?.environment.capabilities.databaseStorage === true,
498 )}
499 />
500 )}
501 <SettingsSection id="storage-worktrees" title="Worktrees">
502 {!isProjectScope && <WorktreesDirectoryRow />}
503 {isProjectScope && (
504 <SettingsRow
505 title="Automatic worktree cleanup"
506 description={
507 mode === "off"
508 ? "Keep this project's worktrees until you delete them manually."
509 : mode === "custom"
510 ? "Use these rules for this project."
511 : "Use each machine's worktree cleanup settings."
512 }
513 serverScoped
514 settingKeys={["worktreeCleanup"]}
515 mixed={mixedModes}
516 control={
517 <Select
518 value={mixedModes ? null : mode}
519 onValueChange={(next) => {
520 if (next === "inherit") clearSettings(["worktreeCleanup"]);
521 else if (next === "off") updateSettings({ worktreeCleanup: { mode: "off" } });
522 else if (next === "custom")
523 updateSettings({ worktreeCleanup: { mode: "custom", rules: {} } });
524 }}
525 >
526 <SelectTrigger size="sm" aria-label="Automatic worktree cleanup">
527 <SelectValue>
528 {mixedModes
529 ? "Mixed"
530 : mode === "inherit"
531 ? "Inherit"
532 : mode === "off"
533 ? "Off"
534 : "Custom"}
535 </SelectValue>
536 </SelectTrigger>
537 <SelectPopup align="end" alignItemWithTrigger={false}>
538 <SelectItem value="inherit">Inherit</SelectItem>
539 <SelectItem value="off">Off</SelectItem>
540 <SelectItem value="custom">Custom</SelectItem>
541 </SelectPopup>
542 </Select>
543 }
544 />
545 )}
546 {(!isProjectScope || (!mixedModes && mode === "custom")) && (
547 <>
548 <SettingsRow
549 title="Delete worktrees with deleted threads"
550 status={ruleStatus("worktreeOnDelete")}
551 description="Remove unused worktrees when active or archived threads are deleted. Worktrees with local changes are kept."
552 serverScoped={!isProjectScope}
553 control={
554 <Switch
555 aria-label="Delete worktrees with deleted threads"
556 checked={settings.worktreeOnDelete}
557 onCheckedChange={(worktreeOnDelete) => updateWorktree({ worktreeOnDelete })}
558 />
559 }
560 />
561 <SettingsRow
562 title="Delete inactive worktrees"
563 status={ruleStatus("worktreeAfterDays")}
564 description="Remove worktrees after their threads have been inactive for this many days. Branches and thread history are kept."
565 serverScoped={!isProjectScope}
566 control={
567 <RetentionControl
568 label="Delete inactive worktrees"
569 value={settings.worktreeAfterDays}
570 onChange={(worktreeAfterDays) => updateWorktree({ worktreeAfterDays })}
571 />
572 }
573 />
574 {connectedEnvironments.length > 0 &&
575 connectedEnvironments.every(
576 (environment) =>
577 environment.serverConfig?.environment.capabilities.settledWorktreeCleanup ===
578 true,
579 ) && (
580 <SettingsRow
581 title="Delete settled worktrees"
582 status={[
583 ruleStatus("worktreeSettledAfterDays"),
584 environments.length > connectedEnvironments.length
585 ? "Offline machines will not get this setting"
586 : undefined,
587 ]
588 .filter(Boolean)
589 .join(". ")}
590 description="Remove worktrees this many days after their thread settles. Set 0 days to remove them at the next cleanup. Branches and thread history are kept."
591 serverScoped={!isProjectScope}
592 control={
593 <RetentionControl
594 label="Delete settled worktrees"
595 value={settings.worktreeSettledAfterDays}
596 minimum={0}
597 onChange={(worktreeSettledAfterDays) =>
598 updateWorktree({ worktreeSettledAfterDays })
599 }
600 />
601 }
602 />
603 )}
604 <SettingsRow
605 title="Delete merged worktrees"
606 status={ruleStatus("worktreeOnMerge")}
607 description="Remove worktrees whose pull request is merged and whose commits are included in the default branch."
608 serverScoped={!isProjectScope}
609 control={
610 <Switch
611 aria-label="Delete merged worktrees"
612 checked={settings.worktreeOnMerge}
613 onCheckedChange={(worktreeOnMerge) => updateWorktree({ worktreeOnMerge })}
614 />
615 }
616 />
617 <SettingsRow
618 title="Delete unchanged worktrees"
619 status={ruleStatus("worktreeUnchanged")}
620 description="Remove worktrees with no commits beyond the default branch."
621 serverScoped={!isProjectScope}
622 control={
623 <Switch
624 aria-label="Delete unchanged worktrees"
625 checked={settings.worktreeUnchanged}
626 onCheckedChange={(worktreeUnchanged) => updateWorktree({ worktreeUnchanged })}
627 />
628 }
629 />
630 {connectedEnvironments.every(
631 (environment) =>
632 environment.serverConfig?.environment.capabilities.storageCleanupRun === true,
633 ) && (
634 <SettingsRow
635 {...searchableSetting("storage-worktree-keep-when")}
636 status={ruleStatus("worktreeKeepWhen")}
637 description={
638 settings.worktreeKeepWhen === "any-local-files"
639 ? "Includes ignored files, except node_modules."
640 : settings.worktreeKeepWhen === "tracked-changes"
641 ? "Deletes untracked and ignored files, including .env."
642 : "Keeps edits and untracked files. Deletes ignored files, including .env."
643 }
644 serverScoped={!isProjectScope}
645 control={
646 <Select
647 value={ruleStatus("worktreeKeepWhen") ? null : settings.worktreeKeepWhen}
648 onValueChange={(next) => {
649 if (
650 next === "any-local-files" ||
651 next === "uncommitted-changes" ||
652 next === "tracked-changes"
653 )
654 updateWorktree({ worktreeKeepWhen: next });
655 }}
656 >
657 <SelectTrigger size="sm" aria-label="Keep worktrees with local changes">
658 <SelectValue>
659 {ruleStatus("worktreeKeepWhen")
660 ? "Mixed"
661 : KEEP_WHEN_LABELS[settings.worktreeKeepWhen]}
662 </SelectValue>
663 </SelectTrigger>
664 <SelectPopup align="end" alignItemWithTrigger={false}>
665 <SelectItem value="any-local-files">Any local files</SelectItem>
666 <SelectItem value="uncommitted-changes">Uncommitted changes</SelectItem>
667 <SelectItem value="tracked-changes">Edited tracked files</SelectItem>
668 </SelectPopup>
669 </Select>
670 }
671 />
672 )}
673 </>
674 )}
675 </SettingsSection>
676​
677 {!isProjectScope && (
678 <SettingsSection id="storage-artifacts" title="Artifacts and logs">
679 <SettingsRow
680 title="Delete old browser artifacts"
681 status={ruleStatus("browserArtifactsAfterDays")}
682 description="Delete saved browser captures after this many days. Older capture links will no longer open."
683 serverScoped
684 control={
685 <RetentionControl
686 label="Delete old browser artifacts"
687 value={settings.browserArtifactsAfterDays}
688 onChange={(browserArtifactsAfterDays) => update({ browserArtifactsAfterDays })}
689 />
690 }
691 />
692 <SettingsRow
693 title="Delete old rotated logs"
694 status={ruleStatus("logsAfterDays")}
695 description="Delete inactive rotated log files after this many days. Current logs are kept."
696 serverScoped
697 control={
698 <RetentionControl
699 label="Delete old rotated logs"
700 value={settings.logsAfterDays}
701 onChange={(logsAfterDays) => update({ logsAfterDays })}
702 />
703 }
704 />
705 </SettingsSection>
706 )}
707 {!isProjectScope && <CleanupSection />}
708 </SettingsPageContainer>
709 );