Skip to content

Commit 96aabaa

Browse files
committed
fix(web): keep retention controls stable while editing days
1 parent f6d3700 commit 96aabaa

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

‎apps/web/src/components/settings/StorageSettings.tsx‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ function RetentionControl({
142142
<NumberFieldDecrement aria-label={`Decrease ${label}`} />
143143
<NumberFieldInput
144144
aria-label={`${label} in days`}
145-
size={new Intl.NumberFormat().format(draft ?? value).length}
146-
className="field-sizing-content w-auto min-w-[1ch] grow-0 text-right"
145+
size={5}
146+
className="w-auto grow-0 text-right"
147147
/>
148148
<span aria-hidden="true" className="self-center pr-2 text-xs">
149149
days
@@ -696,10 +696,15 @@ export function StorageCleanupSections() {
696696
const updateSettings = useUpdateScopedSettings();
697697
if (scope.kind === "project" || scope.kind === "checkout") return null;
698698
const settings = scopedSettings.storageCleanup;
699-
const ruleStatus = (key: "browserArtifactsAfterDays" | "logsAfterDays") =>
700-
targets.some((target) => target.settings.storageCleanup[key] !== settings[key])
701-
? "Mixed across selected machines"
702-
: undefined;
699+
const ruleStatus = (key: "browserArtifactsAfterDays" | "logsAfterDays") => {
700+
if (targets.length < 2) return undefined;
701+
const mixed = targets.some((target) => target.settings.storageCleanup[key] !== settings[key]);
702+
return (
703+
<span className={mixed ? undefined : "invisible"} aria-hidden={!mixed}>
704+
Mixed across selected machines
705+
</span>
706+
);
707+
};
703708
const update = (patch: Partial<StorageCleanupSettings>) =>
704709
updateSettings({ storageCleanup: patch });
705710
const databaseStorageNotice = (

0 commit comments

Comments
 (0)