Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.
Swift cache-cleanercleanerclideveloper-toolsdisk-cleanupdisk-spaceduplicate-finderhomebrewliquid-glassmac-cleanermacosmacos-appmacos-golden-gatemacos-tahoemacos-tweaksswiftswiftuiterminal-themesuninstalluninstaller
Tell why iCloud Drive's list isn't all of it
Țugui Dragoș98b2e3a452fd
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstringsindex 90165022..673f0708 100644--- a/Localization/Peel/Localizable.xcstrings+++ b/Localization/Peel/Localizable.xcstrings@@ -121546,6 +121546,112 @@}}},+ "Peel lists the biggest downloads, up to %@. The next ones show once you remove some of these." : {+ "localizations" : {+ "cs" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel zobrazuje největší stažené kopie, nejvýše %@. Další se zobrazí, až některé z nich odstraníte."+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel zeigt die größten Downloads an, bis zu %@. Die nächsten erscheinen, sobald du einige davon entfernst."+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel muestra las descargas más grandes, hasta un máximo de %@. Las siguientes aparecerán cuando elimines algunas de estas."+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel liste les plus gros téléchargements, jusqu’à %@. Les suivants apparaissent une fois que vous en avez retiré certains."+ }+ },+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel elenca i download più grandi, fino a %@. I successivi compaiono quando ne rimuovi alcuni."+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peelは、ダウンロードしたもののうちサイズの大きいものから順に、最大%@個を表示します。これらの一部を削除すると、次のものが表示されます。"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel은 가장 큰 다운로드를 최대 %@개까지 나열합니다. 이 중 일부를 제거하면 그다음 다운로드가 표시됩니다."+ }+ },+ "nl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel toont de grootste downloads, maximaal %@. De volgende verschijnen zodra je een deel hiervan verwijdert."+ }+ },+ "pl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel wyświetla największe pobrane kopie, maksymalnie %@. Kolejne pojawią się, gdy usuniesz niektóre z nich."+ }+ },+ "pt" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "O Peel lista os maiores downloads, até %@. Os próximos aparecem quando você remover alguns destes."+ }+ },+ "ro" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel listează cele mai mari descărcări, până la %@. Următoarele apar după ce eliminați unele dintre acestea."+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel показывает самые большие загрузки, но не больше %@. Следующие появятся, когда Вы удалите некоторые из этих загрузок."+ }+ },+ "sv" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel listar de största hämtningarna, upp till %@. Fler visas när du har tagit bort några av dem."+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel en büyük indirilenlerden en fazla %@ tanesini listeler. Bunların bir kısmını kaldırdığınızda sonrakiler görünür."+ }+ },+ "uk" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel показує найбільші викачування, не більше %@. Наступні зʼявляться, щойно ви вилучите деякі з них."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel最多列出%@个最大的下载。移除其中一些后,才会显示接下来的下载。"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Peel會列出最大的下載項目,最多%@個。移除其中一些後,就會顯示接下來的項目。"+ }+ }+ }+ },"Peel looks for apps in the Applications folders and in the folders on this list, such as one on another disk. While that disk isn’t connected, its apps still count as installed, so their files aren’t listed as orphaned." : {"localizations" : {"cs" : {@@ -178047,214 +178153,214 @@}}},- "There is more in iCloud Drive than Peel could look at in one go, and nothing in the part it read is big enough to be worth freeing." : {+ "There is more in iCloud Drive than Peel can read in the time it gives a scan, and nothing in the part it read is big enough to be worth freeing." : {"localizations" : {"cs" : {"stringUnit" : {"state" : "translated",- "value" : "Na iCloud Drivu je toho víc, než Peel dokázal projít najednou, a v části, kterou přečetl, není nic tak velkého, aby stálo za uvolnění."+ "value" : "Na iCloud Drivu je toho víc, než Peel dokáže přečíst v čase, který na prohledávání vyhrazuje, a v části, kterou přečetl, není nic tak velkého, aby stálo za uvolnění."}},"de" : {"stringUnit" : {"state" : "translated",- "value" : "In iCloud Drive gibt es mehr, als Peel auf einmal durchsehen konnte, und im gelesenen Teil ist nichts so groß, dass sich das Freigeben lohnt."+ "value" : "In iCloud Drive gibt es mehr, als Peel in der für einen Scan vorgesehenen Zeit lesen kann, und im gelesenen Teil ist nichts so groß, dass sich das Freigeben lohnt."}},"es" : {"stringUnit" : {"state" : "translated",- "value" : "En iCloud Drive hay más de lo que Peel ha podido revisar de una vez, y en la parte que ha leído no hay nada lo bastante grande como para que valga la pena liberarlo."+ "value" : "En iCloud Drive hay más de lo que Peel puede leer en el tiempo que dedica a un análisis, y en la parte que ha leído no hay nada lo bastante grande como para que valga la pena liberarlo."}},"fr" : {"stringUnit" : {"state" : "translated",- "value" : "iCloud Drive contient plus que ce que Peel a pu examiner en une seule fois, et rien dans la partie examinée n’est assez volumineux pour valoir la peine d’être libéré."+ "value" : "iCloud Drive contient plus que ce que Peel peut lire dans le temps qu’il accorde à une analyse, et rien dans la partie lue n’est assez volumineux pour valoir la peine d’être libéré."}},"it" : {"stringUnit" : {"state" : "translated",- "value" : "iCloud Drive contiene più di quanto Peel possa esaminare in una volta sola, e nella parte che ha letto non c’è nulla di abbastanza grande da valere la pena di liberarlo."+ "value" : "iCloud Drive contiene più di quanto Peel riesca a leggere nel tempo che concede a un’analisi, e nella parte che ha letto non c’è nulla di abbastanza grande da valere la pena di liberarlo."}},"ja" : {"stringUnit" : {"state" : "translated",- "value" : "iCloud DriveにはPeelが一度に調べきれないほどの項目があり、読み取った範囲には解放する価値があるほど大きなものはありませんでした。"+ "value" : "iCloud Driveには、Peelが1回のスキャンにかける時間では読み取りきれないほどの項目があり、読み取った範囲には解放する価値があるほど大きなものはありませんでした。"}},"ko" : {"stringUnit" : {"state" : "translated",- "value" : "iCloud Drive에는 Peel이 한 번에 살펴볼 수 있는 것보다 많은 항목이 있으며, 읽은 부분에는 공간을 확보할 만큼 큰 파일이 없습니다."+ "value" : "iCloud Drive에는 Peel이 스캔에 허용하는 시간 안에 읽을 수 있는 것보다 많은 항목이 있으며, 읽은 부분에는 공간을 확보할 만큼 큰 파일이 없습니다."}},"nl" : {"stringUnit" : {"state" : "translated",- "value" : "Er staat meer op iCloud Drive dan Peel in één keer kon bekijken, en in het deel dat Peel heeft gelezen, is niets groot genoeg om de moeite van het vrijmaken waard te zijn."+ "value" : "Er staat meer op iCloud Drive dan Peel kan lezen in de tijd die het voor een scan uittrekt, en in het deel dat Peel heeft gelezen, is niets groot genoeg om de moeite van het vrijmaken waard te zijn."}},"pl" : {"stringUnit" : {"state" : "translated",- "value" : "Na iCloud Drive jest więcej, niż Peel mógł przejrzeć za jednym razem, a w przejrzanej części nie ma nic na tyle dużego, by warto było to zwalniać."+ "value" : "Na iCloud Drive jest więcej, niż Peel może odczytać w czasie przeznaczonym na skanowanie, a w przejrzanej części nie ma nic na tyle dużego, by warto było to zwalniać."}},"pt" : {"stringUnit" : {"state" : "translated",- "value" : "Há mais coisas no iCloud Drive do que o Peel conseguiu examinar de uma só vez, e nada na parte que ele leu é grande o bastante para valer a pena liberar."+ "value" : "Há mais coisas no iCloud Drive do que o Peel consegue ler no tempo que ele reserva para uma análise, e nada na parte que ele leu é grande o bastante para valer a pena liberar."}},"ro" : {"stringUnit" : {"state" : "translated",- "value" : "Pe iCloud Drive există mai mult conținut decât a putut examina Peel într‑o singură trecere, iar în partea pe care a citit‑o nimic nu este destul de mare cât să merite eliberat."+ "value" : "Pe iCloud Drive există mai mult conținut decât poate citi Peel în timpul pe care îl acordă unei scanări, iar în partea pe care a citit‑o nimic nu este destul de mare cât să merite eliberat."}},"ru" : {"stringUnit" : {"state" : "translated",- "value" : "В iCloud Drive больше файлов, чем Peel может просмотреть за один раз, а в просмотренной части нет ничего настолько большого, чтобы его стоило освобождать."+ "value" : "В iCloud Drive больше файлов, чем Peel может прочитать за время, которое он отводит на сканирование, а в просмотренной части нет ничего настолько большого, чтобы его стоило освобождать."}},"sv" : {"stringUnit" : {"state" : "translated",- "value" : "Det finns mer i iCloud Drive än Peel kunde gå igenom på en gång, och inget i den del som Peel läste är tillräckligt stort för att vara värt att frigöra."+ "value" : "Det finns mer i iCloud Drive än Peel hinner läsa under den tid som Peel ger en skanning, och inget i den del som Peel läste är tillräckligt stort för att vara värt att frigöra."}},"tr" : {"stringUnit" : {"state" : "translated",- "value" : "iCloud Drive’da, Peel’in tek seferde bakabileceğinden daha fazlası var ve okuduğu kısımda boşaltmaya değecek kadar büyük bir şey yok."+ "value" : "iCloud Drive’da, Peel’in bir taramaya ayırdığı sürede okuyabileceğinden daha fazlası var ve okuduğu kısımda boşaltmaya değecek kadar büyük bir şey yok."}},"uk" : {"stringUnit" : {"state" : "translated",- "value" : "В iCloud Drive більше, ніж Peel може переглянути за один раз, а в прочитаній частині немає нічого настільки великого, щоб його варто було звільняти."+ "value" : "В iCloud Drive більше, ніж Peel встигає прочитати за час, відведений на сканування, а в прочитаній частині немає нічого настільки великого, щоб його варто було звільняти."}},"zh-Hans" : {"stringUnit" : {"state" : "translated",- "value" : "iCloud云盘中的内容多于Peel一次能查看的量,而在已读取的部分中,没有大到值得释放的文件。"+ "value" : "iCloud云盘中的内容多于Peel在一次扫描的时限内能读取的量,而在已读取的部分中,没有大到值得释放的文件。"}},"zh-Hant" : {"stringUnit" : {"state" : "translated",- "value" : "「iCloud雲碟」中的內容超出Peel一次能查看的範圍,而在它讀取的部分中,沒有任何檔案大到值得釋放。"+ "value" : "「iCloud雲碟」中的內容超出Peel在一次掃描的時限內能讀取的範圍,而在它讀取的部分中,沒有任何檔案大到值得釋放。"}}}},- "There is more in iCloud Drive than Peel could look at in one go, so this list isn’t all of it." : {+ "There is more in iCloud Drive than Peel can read in the time it gives a scan, so this list isn’t all of it." : {"localizations" : {"cs" : {"stringUnit" : {"state" : "translated",- "value" : "Na iCloud Drivu je toho víc, než Peel dokázal projít najednou, takže tento seznam není úplný."+ "value" : "Na iCloud Drivu je toho víc, než Peel dokáže přečíst v čase, který na prohledávání vyhrazuje, takže tento seznam není úplný."}},"de" : {"stringUnit" : {"state" : "translated",- "value" : "In iCloud Drive gibt es mehr, als Peel auf einmal durchsehen konnte, daher ist diese Liste nicht vollständig."+ "value" : "In iCloud Drive gibt es mehr, als Peel in der für einen Scan vorgesehenen Zeit lesen kann, daher ist diese Liste nicht vollständig."}},"es" : {"stringUnit" : {"state" : "translated",- "value" : "En iCloud Drive hay más de lo que Peel ha podido revisar de una vez, así que esta lista no lo incluye todo."+ "value" : "En iCloud Drive hay más de lo que Peel puede leer en el tiempo que dedica a un análisis, así que esta lista no lo incluye todo."}},"fr" : {"stringUnit" : {"state" : "translated",- "value" : "iCloud Drive contient plus que ce que Peel a pu examiner en une seule fois : cette liste n’est donc pas complète."+ "value" : "iCloud Drive contient plus que ce que Peel peut lire dans le temps qu’il accorde à une analyse : cette liste n’est donc pas complète."}},"it" : {"stringUnit" : {"state" : "translated",- "value" : "iCloud Drive contiene più di quanto Peel possa esaminare in una volta sola, quindi questo elenco non è completo."+ "value" : "iCloud Drive contiene più di quanto Peel riesca a leggere nel tempo che concede a un’analisi, quindi questo elenco non è completo."}},"ja" : {"stringUnit" : {"state" : "translated",- "value" : "iCloud DriveにはPeelが一度に調べきれないほどの項目があるため、このリストはすべてではありません。"+ "value" : "iCloud Driveには、Peelが1回のスキャンにかける時間では読み取りきれないほどの項目があるため、このリストはすべてではありません。"}},"ko" : {"stringUnit" : {"state" : "translated",- "value" : "iCloud Drive에는 Peel이 한 번에 살펴볼 수 있는 것보다 많은 항목이 있으므로 이 목록이 전부는 아닙니다."+ "value" : "iCloud Drive에는 Peel이 스캔에 허용하는 시간 안에 읽을 수 있는 것보다 많은 항목이 있으므로 이 목록이 전부는 아닙니다."}},"nl" : {"stringUnit" : {"state" : "translated",- "value" : "Er staat meer op iCloud Drive dan Peel in één keer kon bekijken, dus deze lijst is niet volledig."+ "value" : "Er staat meer op iCloud Drive dan Peel kan lezen in de tijd die het voor een scan uittrekt, dus deze lijst is niet volledig."}},"pl" : {"stringUnit" : {"state" : "translated",- "value" : "Na iCloud Drive jest więcej, niż Peel mógł przejrzeć za jednym razem, więc ta lista nie jest pełna."+ "value" : "Na iCloud Drive jest więcej, niż Peel może odczytać w czasie przeznaczonym na skanowanie, więc ta lista nie jest pełna."}},"pt" : {"stringUnit" : {"state" : "translated",- "value" : "Há mais coisas no iCloud Drive do que o Peel conseguiu examinar de uma só vez, então esta lista não mostra tudo."+ "value" : "Há mais coisas no iCloud Drive do que o Peel consegue ler no tempo que ele reserva para uma análise, então esta lista não mostra tudo."}},"ro" : {"stringUnit" : {"state" : "translated",- "value" : "Pe iCloud Drive există mai mult conținut decât a putut examina Peel într‑o singură trecere, așa că această listă nu este completă."+ "value" : "Pe iCloud Drive există mai mult conținut decât poate citi Peel în timpul pe care îl acordă unei scanări, așa că această listă nu este completă."}},"ru" : {"stringUnit" : {"state" : "translated",- "value" : "В iCloud Drive больше файлов, чем Peel может просмотреть за один раз, поэтому этот список неполный."+ "value" : "В iCloud Drive больше файлов, чем Peel может прочитать за время, которое он отводит на сканирование, поэтому этот список неполный."}},"sv" : {"stringUnit" : {"state" : "translated",- "value" : "Det finns mer i iCloud Drive än Peel kunde gå igenom på en gång, så listan visar inte allt."+ "value" : "Det finns mer i iCloud Drive än Peel hinner läsa under den tid som Peel ger en skanning, så listan visar inte allt."}},"tr" : {"stringUnit" : {"state" : "translated",- "value" : "iCloud Drive’da, Peel’in tek seferde bakabileceğinden daha fazlası var, bu yüzden bu liste hepsini göstermiyor."+ "value" : "iCloud Drive’da, Peel’in bir taramaya ayırdığı sürede okuyabileceğinden daha fazlası var, bu yüzden bu liste hepsini göstermiyor."}},"uk" : {"stringUnit" : {"state" : "translated",- "value" : "В iCloud Drive більше, ніж Peel може переглянути за один раз, тож цей список неповний."+ "value" : "В iCloud Drive більше, ніж Peel встигає прочитати за час, відведений на сканування, тож цей список неповний."}},"zh-Hans" : {"stringUnit" : {"state" : "translated",- "value" : "iCloud云盘中的内容多于Peel一次能查看的量,因此这份列表并不完整。"+ "value" : "iCloud云盘中的内容多于Peel在一次扫描的时限内能读取的量,因此这份列表并不完整。"}},"zh-Hant" : {"stringUnit" : {"state" : "translated",- "value" : "「iCloud雲碟」中的內容超出Peel一次能查看的範圍,因此這個列表並不完整。"+ "value" : "「iCloud雲碟」中的內容超出Peel在一次掃描的時限內能讀取的範圍,因此這個列表並不完整。"}}}diff --git a/Packages/PeelCore/Sources/PeelCore/Space/CloudStorage.swift b/Packages/PeelCore/Sources/PeelCore/Space/CloudStorage.swiftindex 0c9d2384..057744c5 100644--- a/Packages/PeelCore/Sources/PeelCore/Space/CloudStorage.swift+++ b/Packages/PeelCore/Sources/PeelCore/Space/CloudStorage.swift@@ -24,14 +24,21 @@ public struct CloudFile: Sendable, Hashable, Identifiable {/// What one scan of iCloud Drive found, and whether the scan stopped early or could not read the folder.public struct CloudScan: Sendable {public var files: [CloudFile] = []- /// The walk stopped early (it ran out of time, was stopped, or filled the list), so the list may be incomplete.- public var wasCutShort = false+ /// Why the list isn't all there is, and nil when it is.+ public var cutShort: CutShort?/// iCloud Drive could not be read at all, which is what happens without Full Disk Access.public var couldNotRead = false/// How many downloads were left out because another copy on this Mac shares their space: each takes at least/// `CloudStorage.minimumSize` on disk, yet removing it would free less.public var sharedDownloads = 0public var folders: [CloudFolder] = []++ public enum CutShort: Sendable, Equatable {+ /// The walk ran out of time or was stopped before it read everything.+ case ranOutOfTime+ /// The walk read everything and kept the biggest files, `CloudStorage.maximumFiles` of them.+ case listIsFull+ }}/// A file that was not freed, and why.@@ -65,7 +72,7 @@ public enum CloudStorage {public static let minimumSize: Int64 = 1_000_000/// The most files listed. The walk goes on past it, keeping the biggest files it finds, so a big file read late/// is not left out for smaller ones read first.- static let maximumFiles = 5_000+ public static let maximumFiles = 5_000/// How long the walk may take, in seconds. A folder iCloud manages can stall a directory read for minutes,/// and this walk also reads the sync state of every file.public static let budget: TimeInterval = 20@@ -128,7 +135,7 @@ public enum CloudStorage {let collected = collector.collectedreturn CloudScan(files: collected.files.sorted { $0.size > $1.size },- wasCutShort: finished == nil || collected.wasCutShort,+ cutShort: finished == nil ? .ranOutOfTime : collected.cutShort,couldNotRead: collected.couldNotRead,sharedDownloads: collected.sharedDownloads,folders: folders(of: collected.files, home: home)@@ -140,7 +147,7 @@ public enum CloudStorage {final class Collector: Sendable {struct Collected {var files: [CloudFile] = []- var wasCutShort = false+ var cutShort: CloudScan.CutShort?var couldNotRead = falsevar sharedDownloads = 0}@@ -164,7 +171,7 @@ public enum CloudStorage {Self.siftUp(&collected.files, from: collected.files.count - 1)return}- collected.wasCutShort = true+ if collected.cutShort == nil { collected.cutShort = .listIsFull }guard let smallest = collected.files.first, file.size > smallest.size else { return }collected.files[0] = fileSelf.siftDown(&collected.files, from: 0)@@ -194,8 +201,8 @@ public enum CloudStorage {}}- func cutShort() {- state.withLock { $0.wasCutShort = true }+ func ranOutOfTime() {+ state.withLock { $0.cutShort = .ranOutOfTime }}func unreadable() {@@ -250,7 +257,7 @@ public enum CloudStorage {var isICloudDrive = falsefor case let url as URL in enumerator {guard !stopped() else {- collector.cutShort()+ collector.ranOutOfTime()return}scan?.add(1)@@ -283,7 +290,7 @@ public enum CloudStorage {: package(url, values, exclusions: exclusions, countingFor: scan, unless: stopped)guard let measured else {if stopped() {- collector.cutShort()+ collector.ranOutOfTime()return}continuediff --git a/Packages/PeelCore/Tests/PeelCoreTests/CloudStorageTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/CloudStorageTests.swiftindex b7fa37ed..fcc7870e 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/CloudStorageTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/CloudStorageTests.swift@@ -243,7 +243,7 @@ struct CloudStorageTests {let scan = await CloudStorage.downloaded(home: directory.url)#expect(scan.files.isEmpty, "an ordinary file was offered as an iCloud one")#expect(!scan.couldNotRead)- #expect(!scan.wasCutShort)+ #expect(scan.cutShort == nil)}/// Without Full Disk Access, iCloud Drive cannot be read. The scan then says so, rather than reporting@@ -287,7 +287,7 @@ struct CloudStorageTests {let scan = await CloudStorage.downloaded(home: directory.url, within: 0)- #expect(scan.wasCutShort)+ #expect(scan.cutShort == .ranOutOfTime)}/// A full list keeps the biggest files the walk finds, wherever they are, and still says it is not all of it.@@ -304,7 +304,25 @@ struct CloudStorageTests {)#expect(Set(collector.collected.files.map(\.name)) == ["last.bin", "second.bin"])- #expect(collector.collected.wasCutShort)+ #expect(collector.collected.cutShort == .listIsFull)+ }++ @Test func aListThatFilledBeforeTheTimeRanOutSaysTheTimeRanOut() {+ let collector = CloudStorage.Collector(maximum: 1)+ for name in ["a.bin", "b.bin"] {+ collector.add(CloudFile(+ url: URL(filePath: "/org.example/\(name)"), name: name, container: "iCloud Drive", size: 2_000_000,+ modified: nil+ ))+ }+ #expect(collector.collected.cutShort == .listIsFull)++ collector.ranOutOfTime()+ collector.add(CloudFile(+ url: URL(filePath: "/org.example/c.bin"), name: "c.bin", container: "iCloud Drive", size: 3_000_000,+ modified: nil+ ))+ #expect(collector.collected.cutShort == .ranOutOfTime)}/// A walk past its deadline stops on its own, without waiting for the timer that gives up on it. That timer@@ -327,7 +345,7 @@ struct CloudStorageTests {unless: { false })- #expect(collector.collected.wasCutShort)+ #expect(collector.collected.cutShort == .ranOutOfTime)#expect(collector.collected.files.isEmpty)}diff --git a/Peel/Model/CloudLibrary.swift b/Peel/Model/CloudLibrary.swiftindex fba4c1d6..3854b0e4 100644--- a/Peel/Model/CloudLibrary.swift+++ b/Peel/Model/CloudLibrary.swift@@ -29,8 +29,8 @@ final class CloudLibrary {let freeing = MoveProgress()@ObservationIgnored private var freeingTask: Task<CloudFreeing, Never>?private(set) var refusals: [CloudRefusal] = []- /// `wasCutShort`: there is more than the list shows. `couldNotRead`: iCloud Drive couldn't be read at all.- private(set) var wasCutShort = false+ /// `cutShort`: why there is more than the list shows. `couldNotRead`: iCloud Drive couldn't be read at all.+ private(set) var cutShort: CloudScan.CutShort?private(set) var couldNotRead = false/// The downloads left out because another copy on this Mac shares their space, so removing them frees nothing.private(set) var sharedDownloads = 0@@ -48,7 +48,7 @@ final class CloudLibrary {/// nil until iCloud Drive has been read.var total: SizeTotal? {guard let files, !couldNotRead else { return nil }- return SizeTotal(known: files.map(\.size).cappedSum, isComplete: !wasCutShort)+ return SizeTotal(known: files.map(\.size).cappedSum, isComplete: cutShort == nil)}/// The files whose folder or path holds `query`, every file for an empty one.@@ -87,7 +87,7 @@ final class CloudLibrary {else { return }folders = scan.foldersfiles = scan.files- wasCutShort = scan.wasCutShort+ cutShort = scan.cutShortcouldNotRead = scan.couldNotReadsharedDownloads = scan.sharedDownloadsselectedURLs.formIntersection(Set(scan.files.map(\.url)))diff --git a/Peel/Views/Cloud/CloudView.swift b/Peel/Views/Cloud/CloudView.swiftindex 5ec35e97..a754a44c 100644--- a/Peel/Views/Cloud/CloudView.swift+++ b/Peel/Views/Cloud/CloudView.swift@@ -99,10 +99,15 @@ struct CloudView: View {SelectMenu(list: selectableRows(listed), place: Text(Tool.cloud.title), selection: cloud)}} footer: {- if cloud.wasCutShort || cloud.sharedDownloads > 0 {+ if cloud.cutShort != nil || cloud.sharedDownloads > 0 {VStack(alignment: .leading, spacing: 6) {- if cloud.wasCutShort {- Text("There is more in iCloud Drive than Peel could look at in one go, so this list isn’t all of it.")+ switch cloud.cutShort {+ case .listIsFull:+ Text("Peel lists the biggest downloads, up to \(CloudStorage.maximumFiles.formatted()). The next ones show once you remove some of these.")+ case .ranOutOfTime:+ Text("There is more in iCloud Drive than Peel can read in the time it gives a scan, so this list isn’t all of it.")+ case nil:+ EmptyView()}sharedDownloadsNote}@@ -127,13 +132,13 @@ struct CloudView: View {} actions: {Button("Open System Settings") { home.openFullDiskAccessSettings() }}- } else if cloud.files?.isEmpty == true, cloud.wasCutShort {+ } else if cloud.files?.isEmpty == true, cloud.cutShort != nil {// The scan stopped early, so an empty list does not mean there is nothing to free.ContentUnavailableView {Label("Nothing Found So Far", systemImage: "icloud")} description: {VStack(spacing: 8) {- Text("There is more in iCloud Drive than Peel could look at in one go, and nothing in the part it read is big enough to be worth freeing.")+ Text("There is more in iCloud Drive than Peel can read in the time it gives a scan, and nothing in the part it read is big enough to be worth freeing.")sharedDownloadsNote}}@@ -184,7 +189,7 @@ struct CloudView: View {.announcesScan(cloud.isScanning,found: cloud.summary,- couldNotLook: cloud.couldNotRead ? "iCloud Drive Couldn’t Be Read" : nil,+ couldNotLook: couldNotLook,wasStopped: cloud.scanRun.wasStopped).navigationTitle(Text(Tool.cloud.title))@@ -260,6 +265,12 @@ struct CloudView: View {}}+ private var couldNotLook: LocalizedStringResource? {+ if cloud.couldNotRead { return "iCloud Drive Couldn’t Be Read" }+ if cloud.files?.isEmpty == true, cloud.cutShort != nil { return "Nothing Found So Far" }+ return nil+ }+private func phase(listed: [CloudFile]) -> ScanPhase {if cloud.files == nil { return cloud.scanRun.wasStopped ? .stopped : .scanning(.walk) }if !searchText.isEmpty, cloud.files?.isEmpty == false, listed.isEmpty { return .message }