@@ -207,49 +207,55 @@ public final class CleanupCoordinator: @unchecked Sendable {
207207 }
208208
209209 private func parseSkippedFromLog( _ log: String ) -> SkippedCleanupItem ? {
210- let patterns : [ ( label : String , keywords: [ String ] ) ] = [
211- ( " App containers " , [ " App containers " ] ) ,
212- ( " Orphaned remnants " , [ " Orphaned remnants " ] ) ,
213- ( " Orphaned files " , [ " Orphaned files " ] ) ,
214- ( " Large files " , [ " Large files " ] ) ,
215- ( " Dynamic cache discovery " , [ " Dynamic cache discovery " ] ) ,
216- ( " App caches " , [ " App caches " ] ) ,
217- ( " Package managers " , [ " Package managers " ] ) ,
218- ( " Gradle + Maven " , [ " Gradle " ] ) ,
219- ( " Flutter / Dart " , [ " Flutter " ] ) ,
220- ( " Xcode " , [ " Xcode " ] ) ,
221- ( " iOS Simulators " , [ " iOS Simulators " ] ) ,
222- ( " Android caches " , [ " Android caches " ] ) ,
223- ( " Android SDK " , [ " Android SDK " ] ) ,
224- ( " IDE / Electron caches " , [ " IDE " ] ) ,
225- ( " Browser caches " , [ " Browser caches " ] ) ,
226- ( " Messaging / media " , [ " Messaging " ] ) ,
227- ( " Docker " , [ " Docker " ] ) ,
228- ( " Language caches " , [ " Language caches " ] ) ,
229- ( " User logs " , [ " User logs " ] ) ,
230- ( " System caches " , [ " System caches " ] ) ,
231- ( " Dotfile caches " , [ " Dotfile caches " ] ) ,
232- ( " Scattered junk " , [ " Scattered junk " ] ) ,
233- ( " Time Machine Snapshots " , [ " Time Machine " ] ) ,
234- ( " iOS Backups " , [ " iOS Backups " ] ) ,
235- ( " Mail Downloads " , [ " Mail Downloads " ] ) ,
236- ( " Saved Application State " , [ " Saved Application State " ] ) ,
237- ( " Crash Reporter " , [ " Crash Reporter " ] ) ,
238- ( " AssetsV2 " , [ " AssetsV2 " ] ) ,
239- ( " CloudKit Cache " , [ " CloudKit " ] ) ,
240- ( " Swift Package Manager Cache " , [ " SwiftPM " ] ) ,
241- ( " Carthage Cache " , [ " Carthage " ] ) ,
242- ( " Steam Cache " , [ " Steam " ] ) ,
243- ( " Microsoft Teams Cache " , [ " Teams " ] ) ,
244- ( " Adobe Caches " , [ " Adobe " ] ) ,
245- ( " Chrome Extra Caches " , [ " Chrome " ] ) ,
210+ let patterns : [ ( category : CleanupCategory ? , keywords: [ String ] ) ] = [
211+ ( . appContainers , [ " App containers " ] ) ,
212+ ( . orphanedRemnants , [ " Orphaned remnants " ] ) ,
213+ ( . orphanedFiles , [ " Orphaned files " ] ) ,
214+ ( . largeFiles , [ " Large files " ] ) ,
215+ ( . dynamicCacheDiscovery , [ " Dynamic cache discovery " ] ) ,
216+ ( . appCaches , [ " App caches " ] ) ,
217+ ( . packageManagers , [ " Package managers " ] ) ,
218+ ( . gradleMaven , [ " Gradle " ] ) ,
219+ ( . flutterDart , [ " Flutter " ] ) ,
220+ ( . xcode , [ " Xcode " ] ) ,
221+ ( . iosSimulators , [ " iOS Simulators " ] ) ,
222+ ( . androidCaches , [ " Android caches " ] ) ,
223+ ( . androidSDK , [ " Android SDK " ] ) ,
224+ ( . ideCaches , [ " IDE " ] ) ,
225+ ( . browserCaches , [ " Browser caches " ] ) ,
226+ ( . messagingMedia , [ " Messaging " ] ) ,
227+ ( . docker , [ " Docker " ] ) ,
228+ ( . languageCaches , [ " Language caches " ] ) ,
229+ ( . userLogs , [ " User logs " ] ) ,
230+ ( . systemCaches , [ " System caches " ] ) ,
231+ ( . dotfileCaches , [ " Dotfile caches " ] ) ,
232+ ( . scatteredJunk , [ " Scattered junk " ] ) ,
233+ ( . timeMachineSnapshots , [ " Time Machine " ] ) ,
234+ ( . iosBackups , [ " iOS Backups " ] ) ,
235+ ( . mailDownloads , [ " Mail Downloads " ] ) ,
236+ ( . savedAppState , [ " Saved Application State " ] ) ,
237+ ( . crashReporter , [ " Crash Reporter " ] ) ,
238+ ( . assetsV2 , [ " AssetsV2 " ] ) ,
239+ ( . cloudKitCache , [ " CloudKit " ] ) ,
240+ ( . swiftPMCache , [ " SwiftPM " ] ) ,
241+ ( . carthageCache , [ " Carthage " ] ) ,
242+ ( . steamCache , [ " Steam " ] ) ,
243+ ( . teamsCache , [ " Teams " ] ) ,
244+ ( . adobeCaches , [ " Adobe " ] ) ,
245+ ( . chromeExtraCaches , [ " Chrome " ] ) ,
246246 ]
247247
248248 guard let matched = patterns. first ( where: { $0. keywords. contains ( where: { log. contains ( $0) } ) } ) else {
249249 return nil
250250 }
251251
252- // Extract reason — everything between "—" and ", skipped"
252+ let label : String
253+ if let category = matched. category {
254+ label = category. localizedTitle
255+ } else {
256+ label = matched. keywords [ 0 ]
257+ }
258+
253259 let reason : String
254260 if let range = log. range ( of: " — " ) {
255261 let afterDash = log [ range. upperBound... ]
@@ -262,7 +268,7 @@ public final class CleanupCoordinator: @unchecked Sendable {
262268 reason = " unknown "
263269 }
264270
265- return SkippedCleanupItem ( label: matched . label, reason: reason)
271+ return SkippedCleanupItem ( label: label, reason: reason)
266272 }
267273
268274 @MainActor
0 commit comments