feat(storage): show unreferenced files in Admin > Storage, with the switch and a check

Desktop and phone show what the last check found (can be freed, unused for
less than a week, freed), why a category was skipped, the switch that lets
the nightly run delete and a report-only check on demand, through the
shared storage panel hook. All 28 languages, and the Admin-Storage wiki
page explains the check, the week's wait and when to leave it off.
This commit is contained in:
Maurice
2026-11-01 14:30:01 +01:00
parent b31666d1c9
commit a1d9cdc8f2
42 changed files with 1179 additions and 3 deletions
@@ -17,6 +17,7 @@ import MToggle from '../../components/MToggle'
import MStorageTestResult from '../../components/MStorageTestResult'
import MSetPickerSheet from '../settings/MSetPickerSheet'
import MConfirmSheet from '../settings/MConfirmSheet'
import MStorageReclaimCard from './MStorageReclaimCard'
import { MSetSelectRow } from '../settings/MSettingsUi'
import { MAdminButton, MAdminCard, MAdminCardHead, MAdminField, MAdminInput, MAdminSecretInput } from './MAdminUi'
@@ -172,6 +173,7 @@ export default function MAdminStoragePanel(): React.ReactElement {
const {
admin, editing, setEditing, confirmRemove, setConfirmRemove, syncPrompt, setSyncPrompt, migratePrompt,
handleCancelMigration, handleRefreshStats, handleStartBackfill, handleCancelBackfill, loaded,
reclaim, reclaimChecking, handleReclaimCheck, handleReclaimDelete,
} = useStoragePanel()
const [categoryPicker, setCategoryPicker] = useState<StorageCategory | null>(null)
@@ -565,6 +567,13 @@ export default function MAdminStoragePanel(): React.ReactElement {
</div>
)}
<MStorageReclaimCard
reclaim={reclaim}
checking={reclaimChecking}
onCheck={() => void handleReclaimCheck()}
onDelete={(enabled) => void handleReclaimDelete(enabled)}
/>
<MConfirmSheet
open={confirmRemove !== null}
onClose={() => setConfirmRemove(null)}