feat(storage): confirm the count shown, and say a backup or a missing install id held the cleanup

Confirm sends the count the admin saw and waits for its answer; a stale
count reloads the state. A running backup is named as a skip reason, a
missing installation id and a stale count as errors, and the switch's
hint no longer promises removal right away: deleted files go a day
later, once no undo can bring them back. Strings in all 28 languages.
This commit is contained in:
Maurice
2026-11-01 18:14:49 +01:00
parent 10ad64d170
commit 9d2ffc91af
40 changed files with 250 additions and 81 deletions
@@ -17,7 +17,9 @@ interface Props {
saving: boolean;
onCheck: () => void;
onDelete: (enabled: boolean) => void;
onConfirm: (category: ReclaimView['lines'][number]['category']) => void;
/** The category whose confirmation is on its way. */
confirming: ReclaimView['lines'][number]['category'] | null;
onConfirm: (request: { category: ReclaimView['lines'][number]['category']; unreferenced: number }) => void;
}
/**
@@ -32,6 +34,7 @@ export default function StorageReclaimSection({
saving,
onCheck,
onDelete,
confirming,
onConfirm,
}: Props): React.ReactElement {
const { t, locale } = useTranslation();
@@ -130,8 +133,12 @@ export default function StorageReclaimSection({
type="button"
className={SETTINGS_BUTTON}
style={fs(12, 'body')}
onClick={() => onConfirm(line.category)}
onClick={() => onConfirm({ category: line.category, unreferenced: line.unreferenced })}
disabled={confirming === line.category}
>
{confirming === line.category && (
<Loader2 size={13} strokeWidth={2.2} className="animate-spin" />
)}
{t('storage.reclaim.confirm')}
</button>
</div>