Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Leave to a click what Select All could take by mistake

Țugui Dragoșd43e934cffd1
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7810e03d..01517bc1 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -142,8 +142,8 @@ Tests enforce these. If your change makes one of them fail, the rule is right an
Anything shared is shown and left unselected, and nothing is selected for an app that would stay.
- **What may exist nowhere else is never selected for the user.** A folder with a wallet, a signing key, a password
database, or a repository inside, one where an app keeps what may exist only on this Mac, or one Peel could not
- finish reading, is shown with its reason and moves only when the user selects it: Select All asks before it selects
- one, and `peel uninstall`, `peel orphans --remove`, and `peel projects --remove` pass it by. The
+ finish reading, is shown with its reason and moves only when the user selects it with its own click: Select All,
+ `peel uninstall`, `peel orphans --remove`, and `peel projects --remove` pass it by (`SelectableRows.leftToTheClick`). The
one exception is a repository inside a folder its tool tags as a cache (`CACHEDIR.TAG`), such as Swift Package
Manager's `.build`, whose clones the tool makes again.
- **The user's exclusions reach every scanner**, so an excluded item never appears in the first place.
diff --git a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
index c7dade63..2eb8fabb 100644
--- a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
@@ -70,6 +70,12 @@ public struct DeveloperEnvironment: Sendable, Hashable, Identifiable {
public var id: URL { url }
+ /// True when Select All passes the location by: its size is not known, nothing shows the tool made it, a
+ /// workspace may still be in use, or it holds the archives of the apps the person built.
+ public var isLeftToTheClick: Bool {
+ size == nil || !isTheTools || workspace?.mayStillBeInUse == true || kind == .archives
+ }
+
/// Whether Peel selects this location for the user: only content that tools make or fetch again, or
/// logs, and only once measured. Nothing is selected for the user without showing its size.
public var isRecommended: Bool {
@@ -96,7 +102,8 @@ public struct DeveloperEnvironment: Sendable, Hashable, Identifiable {
SelectableRows(
rows: locations.map(\.url),
selectable: locations.map(\.url),
- recommended: locations.filter(\.isRecommended).map(\.url)
+ recommended: locations.filter(\.isRecommended).map(\.url),
+ leftToTheClick: locations.filter(\.isLeftToTheClick).map(\.url)
)
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift b/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift
index 769dc580..35017d82 100644
--- a/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Developer/ProjectArtifacts.swift
@@ -34,7 +34,11 @@ public struct ProjectArtifact: Sendable, Hashable, Identifiable {
extension Collection where Element == ProjectArtifact {
public var selectableRows: SelectableRows<URL> {
- SelectableRows(rows: map(\.url), selectable: map(\.url), recommended: filter(\.isRecommended).map(\.url))
+ SelectableRows(
+ rows: map(\.url), selectable: map(\.url), recommended: filter(\.isRecommended).map(\.url),
+ leftToTheClick: filter { $0.heldBack?.isLeftToTheClick == true || $0.hasGenericName || $0.isEnvironment }
+ .map(\.url)
+ )
}
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swift b/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swift
index 6622808a..5d74518d 100644
--- a/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Leftovers/Leftover.swift
@@ -99,6 +99,20 @@ public enum HoldBack: String, Sendable, Hashable {
|| self == .holdsAnExclusion
}
+ /// True when Select All passes the item by, leaving it to a click: every reason does, as each says the item may
+ /// hold what exists nowhere else, belongs to something else, or is not known, except a crash report, which Peel
+ /// keeps only for the app's developer.
+ public var isLeftToTheClick: Bool {
+ switch self {
+ case .crashReport: false
+ case .holdsRepository, .sharedWithEveryone, .namedLikeTheApp, .holdsAnExclusion, .notMeasured, .couldNotBeRead,
+ .holdsDocuments, .holdsALibrary, .holdsAWallet, .holdsAPasswordDatabase, .holdsLocalMail,
+ .holdsMessageHistory, .holdsPasswordsOrCodes, .holdsVPNConnections, .holdsKeys, .holdsWorkKeptInACache,
+ .insideAnotherAppsFolder, .beyondTheHelper, .keptByMacOS, .openedFromMail, .inTheCloud, .openInAProgram,
+ .changedRecently, .keptByAnApp, .appIsRunning: true
+ }
+ }
+
/// Why what a walk saw leaves a folder to be chosen by hand: a wallet, a signing key, or a repository inside may
/// exist nowhere else, and a folder the walk could not see into is not known to be empty.
static func seen(in contents: FolderContents?) -> HoldBack? {
@@ -151,6 +165,10 @@ public struct LeftoverMatch: Sendable, Hashable {
public var isRecommended: Bool { isTheAppsAlone && heldBack == nil }
+ /// True when Select All passes the item by: held back for what it may hold, only guessed at, or used by another
+ /// app or another copy of this one.
+ public var isLeftToTheClick: Bool { heldBack?.isLeftToTheClick == true || confidence == .possible || isShared }
+
/// Returns the same match, held back for `heldBack`: shown, but never selected.
public func forReview(_ heldBack: HoldBack) -> LeftoverMatch {
LeftoverMatch(
diff --git a/Packages/PeelCore/Sources/PeelCore/Orphans/Orphan.swift b/Packages/PeelCore/Sources/PeelCore/Orphans/Orphan.swift
index e382bcff..94ccbc8b 100644
--- a/Packages/PeelCore/Sources/PeelCore/Orphans/Orphan.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Orphans/Orphan.swift
@@ -64,7 +64,8 @@ public struct OrphanGroup: Sendable, Hashable, Identifiable {
return SelectableRows(
rows: items.map(\.url),
selectable: unlocked.filter { $0.leftAlone == nil }.map(\.url),
- recommended: confidence.level == .unsure ? [] : unlocked.filter { $0.heldBack == nil }.map(\.url)
+ recommended: confidence.level == .unsure ? [] : unlocked.filter { $0.heldBack == nil }.map(\.url),
+ leftToTheClick: items.filter { $0.heldBack?.isLeftToTheClick == true }.map(\.url)
)
}
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/BulkUninstallation.swift b/Packages/PeelCore/Sources/PeelCore/Removal/BulkUninstallation.swift
index 6cf7ee81..6b102372 100644
--- a/Packages/PeelCore/Sources/PeelCore/Removal/BulkUninstallation.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Removal/BulkUninstallation.swift
@@ -34,6 +34,12 @@ public struct BulkUninstallation: Sendable {
public var holdsDamagedSettings = false
public var id: URL { url }
+
+ /// True when Select All passes the item by, as on one app's page (`LeftoverMatch.isLeftToTheClick`), and
+ /// when an app outside the selection, another copy, or macOS uses it.
+ public var isLeftToTheClick: Bool {
+ match?.isLeftToTheClick == true || !sharedWithOthers.isEmpty || !otherCopies.isEmpty || isKeptByMacOS
+ }
public var isApplication: Bool { match == nil }
public var isRecommended: Bool {
guard !isExcluded, !isPeels, !isKeptByMacOS, !isBeyondTheHelper, !isInTheTrash, enclosingPackage == nil
diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/SelectableRows.swift b/Packages/PeelCore/Sources/PeelCore/Removal/SelectableRows.swift
index 8ab7998b..6d775af1 100644
--- a/Packages/PeelCore/Sources/PeelCore/Removal/SelectableRows.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Removal/SelectableRows.swift
@@ -5,15 +5,25 @@ public struct SelectableRows<ID: Hashable> {
public let selectable: [ID]
/// Never a row a click cannot select.
public let recommended: [ID]
+ /// Rows a click can select and Select All passes by: what may exist nowhere else, belongs to something else, or
+ /// is not known, which the person chooses one by one.
+ public let leftToTheClick: [ID]
- public init(rows: [ID], selectable: [ID], recommended: [ID]) {
+ public init(rows: [ID], selectable: [ID], recommended: [ID], leftToTheClick: [ID]) {
self.rows = rows
self.selectable = selectable
self.recommended = recommended.filter(Set(selectable).contains)
+ self.leftToTheClick = leftToTheClick.filter(Set(selectable).contains)
+ }
+
+ /// The rows Select All selects.
+ private var reachedBySelectAll: [ID] {
+ let left = Set(leftToTheClick)
+ return selectable.filter { !left.contains($0) }
}
public func isAllSelected(in selection: Set<ID>) -> Bool {
- selectable.allSatisfy(selection.contains)
+ reachedBySelectAll.allSatisfy(selection.contains)
}
public func isRecommendedSelected(in selection: Set<ID>) -> Bool {
@@ -25,7 +35,7 @@ public struct SelectableRows<ID: Hashable> {
}
public func selectingAll(in selection: Set<ID>) -> Set<ID> {
- selection.union(selectable)
+ selection.union(reachedBySelectAll)
}
public func selectingRecommended(in selection: Set<ID>) -> Set<ID> {
@@ -40,7 +50,7 @@ public struct SelectableRows<ID: Hashable> {
/// What Select All would add that Peel does not recommend, which it asks about first.
public func notRecommendedAdded(by selection: Set<ID>) -> [ID] {
let recommended = Set(recommended)
- return selectable.filter { !recommended.contains($0) && !selection.contains($0) }
+ return reachedBySelectAll.filter { !recommended.contains($0) && !selection.contains($0) }
}
}
@@ -59,7 +69,8 @@ public struct SelectablePages<Page: Hashable, ID: Hashable> {
rows = SelectableRows(
rows: once(pages.flatMap { $0.rows.rows }),
selectable: once(pages.flatMap { $0.rows.selectable }),
- recommended: once(pages.flatMap { $0.rows.recommended })
+ recommended: once(pages.flatMap { $0.rows.recommended }),
+ leftToTheClick: once(pages.flatMap { $0.rows.leftToTheClick })
)
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Space/Installers.swift b/Packages/PeelCore/Sources/PeelCore/Space/Installers.swift
index 87f5851f..20e86a9c 100644
--- a/Packages/PeelCore/Sources/PeelCore/Space/Installers.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Space/Installers.swift
@@ -56,7 +56,8 @@ extension Collection where Element == InstallerItem {
return SelectableRows(
rows: map(\.url),
selectable: open.filter { $0.heldBack?.cannotBeMoved != true }.map(\.url),
- recommended: open.filter { $0.heldBack == nil }.map(\.url)
+ recommended: open.filter { $0.heldBack == nil }.map(\.url),
+ leftToTheClick: filter { $0.heldBack?.isLeftToTheClick == true }.map(\.url)
)
}
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Space/SpaceRemoval.swift b/Packages/PeelCore/Sources/PeelCore/Space/SpaceRemoval.swift
index 393dd110..6d49b62f 100644
--- a/Packages/PeelCore/Sources/PeelCore/Space/SpaceRemoval.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Space/SpaceRemoval.swift
@@ -57,7 +57,8 @@ public enum SpaceRemoval {
return SelectableRows(
rows: removable,
selectable: unlocked.filter { heldBack[$0]?.cannotBeMoved != true },
- recommended: unlocked.filter(suggested.contains)
+ recommended: unlocked.filter(suggested.contains),
+ leftToTheClick: removable.filter { heldBack[$0]?.isLeftToTheClick == true }
)
}
}
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/SelectableRowsTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/SelectableRowsTests.swift
index 800a12d7..9b6d6001 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/SelectableRowsTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/SelectableRowsTests.swift
@@ -11,7 +11,9 @@ struct SelectableRowsTests {
/// A row selected by hand that Select All leaves alone goes with Deselect All too: otherwise it would stay
/// selected unseen and move with the next small file.
@Test func deselectAllTakesOutARowSelectedByHand() {
- let list = SelectableRows(rows: [repository, cache, log], selectable: [cache, log], recommended: [cache, log])
+ let list = SelectableRows(
+ rows: [repository, cache, log], selectable: [cache, log], recommended: [cache, log], leftToTheClick: []
+ )
let selection: Set = [repository, cache, log, elsewhere]
#expect(list.isAllSelected(in: selection))
@@ -19,15 +21,90 @@ struct SelectableRowsTests {
}
@Test func selectAllAddsWhatAClickCanSelect() {
- let list = SelectableRows(rows: [repository, cache, log], selectable: [cache, log], recommended: [cache])
+ let list = SelectableRows(
+ rows: [repository, cache, log], selectable: [cache, log], recommended: [cache], leftToTheClick: []
+ )
#expect(list.selectingAll(in: [elsewhere]) == [cache, log, elsewhere])
#expect(list.isAllSelected(in: [cache, log]))
}
+ /// What may exist nowhere else, belong to something else, or is not known is left to a click: Select All passes
+ /// it by, asks nothing about it, and a click still selects it.
+ @Test func selectAllLeavesToTheClickWhatMayExistNowhereElse() {
+ let list = SelectableRows(
+ rows: [repository, cache, log], selectable: [repository, cache, log], recommended: [cache],
+ leftToTheClick: [repository]
+ )
+
+ #expect(list.selectingAll(in: [elsewhere]) == [cache, log, elsewhere])
+ #expect(list.isAllSelected(in: [cache, log]))
+ #expect(list.notRecommendedAdded(by: []) == [log])
+ #expect(list.selectable.contains(repository))
+ }
+
+ @Test func everyPageLeavesToTheClickWhatItHoldsBack() {
+ func orphan(_ name: String, heldBack: HoldBack?) -> OrphanItem {
+ var item = OrphanItem(
+ url: URL(filePath: "/tmp/\(name)"), kind: .caches, size: 10, modificationDate: nil,
+ requiresPrivileges: false
+ )
+ item.heldBack = heldBack
+ return item
+ }
+ let messages = orphan("org.example.Messages", heldBack: .holdsMessageHistory)
+ let report = orphan("org.example.Report", heldBack: .crashReport)
+ let plain = orphan("org.example.Plain", heldBack: nil)
+ let group = OrphanGroup(identifier: "org.example", items: [messages, report, plain])
+ #expect(group.selectableRows(canUseHelper: true).leftToTheClick == [messages.url])
+
+ let (cache, system) = (URL(filePath: "/tmp/org.example.Cache"), URL(filePath: "/tmp/com.apple.Cache"))
+ let plan = SpaceRemoval.Plan(
+ removable: [cache, system], inUse: [], leftToDeveloper: [], sizes: [cache: 1, system: 1],
+ heldBack: [system: .keptByMacOS], needsTheHelper: []
+ )
+ #expect(plan.selectableRows(canUseHelper: true).leftToTheClick == [system])
+
+ let project = URL(filePath: "/tmp/org.example.Project")
+ func artifact(_ name: String, generic: Bool) -> ProjectArtifact {
+ ProjectArtifact(
+ url: project.appending(path: name), project: project, name: name, tool: "Xcode", size: 10,
+ lastActivity: .now.addingTimeInterval(-ProjectArtifacts.recentlyActive * 2),
+ hasGenericName: generic, isEnvironment: false
+ )
+ }
+ let (derived, build) = (artifact("DerivedData", generic: false), artifact("build", generic: true))
+ #expect([derived, build].selectableRows.leftToTheClick == [build.url])
+
+ let measured = DeveloperEnvironment.Location(
+ url: URL(filePath: "/tmp/org.example.Cache"), kind: .cache, size: 10, source: "https://example.com"
+ )
+ let unknown = DeveloperEnvironment.Location(
+ url: URL(filePath: "/tmp/org.example.Unknown"), kind: .cache, size: nil, source: "https://example.com"
+ )
+ let archive = DeveloperEnvironment.Location(
+ url: URL(filePath: "/tmp/org.example.Archive"), kind: .archives, size: 10, source: "https://example.com"
+ )
+ let tool = DeveloperEnvironment(
+ id: "org.example", name: "Example", systemImage: "hammer", appBundleIdentifiers: [],
+ locations: [measured, unknown, archive]
+ )
+ #expect(tool.selectableRows.leftToTheClick == [unknown.url, archive.url])
+ }
+
+ @Test func aLeftoverPeelGuessesAtOrSharesIsLeftToTheClick() {
+ let certain = LeftoverMatch(reason: .bundleIdentifier, confidence: .certain, sharedWith: [])
+ #expect(!certain.isLeftToTheClick)
+ #expect(LeftoverMatch(reason: .namePrefix, confidence: .possible, sharedWith: []).isLeftToTheClick)
+ #expect(LeftoverMatch(reason: .bundleIdentifier, confidence: .certain, sharedWith: ["org.example.other"]).isLeftToTheClick)
+ #expect(certain.forReview(.holdsMessageHistory).isLeftToTheClick)
+ #expect(!certain.forReview(.crashReport).isLeftToTheClick)
+ }
+
@Test func selectRecommendedTakesOutWhatPeelDoesNotRecommend() {
let list = SelectableRows(
- rows: [repository, cache, log], selectable: [repository, cache, log], recommended: [cache]
+ rows: [repository, cache, log], selectable: [repository, cache, log], recommended: [cache],
+ leftToTheClick: []
)
let selection: Set = [repository, log, elsewhere]
@@ -39,37 +116,50 @@ struct SelectableRowsTests {
@Test func selectAllAsksOnlyAboutWhatPeelDoesNotRecommend() {
let list = SelectableRows(
- rows: [repository, cache, log], selectable: [repository, cache, log], recommended: [cache]
+ rows: [repository, cache, log], selectable: [repository, cache, log], recommended: [cache],
+ leftToTheClick: []
)
#expect(list.notRecommendedAdded(by: []) == [repository, log])
#expect(list.notRecommendedAdded(by: [repository]) == [log])
#expect(list.notRecommendedAdded(by: [repository, log]).isEmpty)
- let everything = SelectableRows(rows: [cache, log], selectable: [cache, log], recommended: [cache, log])
+ let everything = SelectableRows(
+ rows: [cache, log], selectable: [cache, log], recommended: [cache, log], leftToTheClick: []
+ )
#expect(everything.notRecommendedAdded(by: []).isEmpty)
}
@Test func peelNeverRecommendsWhatAClickCannotSelect() {
- let list = SelectableRows(rows: [repository, cache], selectable: [cache], recommended: [repository, cache])
+ let list = SelectableRows(
+ rows: [repository, cache], selectable: [cache], recommended: [repository, cache], leftToTheClick: []
+ )
#expect(list.recommended == [cache])
#expect(list.selectingRecommended(in: []) == [cache])
}
@Test func deselectAllLeavesOtherListsAlone() {
- let list = SelectableRows(rows: [cache, log], selectable: [cache, log], recommended: [cache])
+ let list = SelectableRows(
+ rows: [cache, log], selectable: [cache, log], recommended: [cache], leftToTheClick: []
+ )
#expect(list.isNoneSelected(in: [elsewhere]))
#expect(!list.isNoneSelected(in: [log, elsewhere]))
#expect(list.deselectingAll(in: [log, elsewhere]) == [elsewhere])
- let locked = SelectableRows(rows: [repository, cache], selectable: [cache], recommended: [cache])
+ let locked = SelectableRows(
+ rows: [repository, cache], selectable: [cache], recommended: [cache], leftToTheClick: []
+ )
#expect(!locked.isNoneSelected(in: [repository]))
}
@Test func everyPageSelectsAsOneList() {
- let first = SelectableRows(rows: [repository, cache], selectable: [repository, cache], recommended: [cache])
- let second = SelectableRows(rows: [repository, log], selectable: [repository, log], recommended: [log])
- let locked = SelectableRows(rows: [elsewhere], selectable: [], recommended: [])
+ let first = SelectableRows(
+ rows: [repository, cache], selectable: [repository, cache], recommended: [cache], leftToTheClick: []
+ )
+ let second = SelectableRows(
+ rows: [repository, log], selectable: [repository, log], recommended: [log], leftToTheClick: []
+ )
+ let locked = SelectableRows(rows: [elsewhere], selectable: [], recommended: [], leftToTheClick: [])
let pages = SelectablePages([("first", first), ("second", second), ("locked", locked)])
#expect(pages.rows.rows == [repository, cache, log, elsewhere])
@@ -79,8 +169,12 @@ struct SelectableRowsTests {
}
@Test func aPageCountsOnceSomethingOnItIsSelected() {
- let first = SelectableRows(rows: [repository, cache], selectable: [repository, cache], recommended: [cache])
- let second = SelectableRows(rows: [repository, log], selectable: [repository, log], recommended: [log])
+ let first = SelectableRows(
+ rows: [repository, cache], selectable: [repository, cache], recommended: [cache], leftToTheClick: []
+ )
+ let second = SelectableRows(
+ rows: [repository, log], selectable: [repository, log], recommended: [log], leftToTheClick: []
+ )
let pages = SelectablePages([("first", first), ("second", second)])
#expect(pages.pages(selectedIn: [log, elsewhere]) == ["second"])
@@ -89,9 +183,11 @@ struct SelectableRowsTests {
}
@Test func aRowOnAPageNotSeenYetCountsAsNotSelected() {
- let first = SelectableRows(rows: [cache], selectable: [cache], recommended: [cache])
- let second = SelectableRows(rows: [log, repository], selectable: [log, repository], recommended: [log])
- let shared = SelectableRows(rows: [repository], selectable: [repository], recommended: [])
+ let first = SelectableRows(rows: [cache], selectable: [cache], recommended: [cache], leftToTheClick: [])
+ let second = SelectableRows(
+ rows: [log, repository], selectable: [log, repository], recommended: [log], leftToTheClick: []
+ )
+ let shared = SelectableRows(rows: [repository], selectable: [repository], recommended: [], leftToTheClick: [])
let pages = SelectablePages([("first", first), ("second", second), ("shared", shared)])
let preselected: Set = [cache, log, repository, elsewhere]
diff --git a/Peel/Views/AppDetailView.swift b/Peel/Views/AppDetailView.swift
index 5763a53c..c7f1142d 100644
--- a/Peel/Views/AppDetailView.swift
+++ b/Peel/Views/AppDetailView.swift
@@ -275,7 +275,8 @@ struct AppDetailView: View {
),
movable: plan.recommendedMovable,
list: SelectableRows(
- rows: recommendedRows, selectable: recommendedSelectable, recommended: recommendedSelectable
+ rows: recommendedRows, selectable: recommendedSelectable, recommended: recommendedSelectable,
+ leftToTheClick: []
),
place: Text("Recommended")
)
@@ -310,7 +311,8 @@ struct AppDetailView: View {
list: SelectableRows(
rows: plan.needsReview.map(\.url),
selectable: plan.needsReview.map(\.url).filter(plan.selectable.contains),
- recommended: []
+ recommended: [],
+ leftToTheClick: plan.needsReview.filter(\.match.isLeftToTheClick).map(\.url)
),
place: Text("Review Before Removing")
)
diff --git a/Peel/Views/Cloud/CloudView.swift b/Peel/Views/Cloud/CloudView.swift
index 1d7e76cc..affca533 100644
--- a/Peel/Views/Cloud/CloudView.swift
+++ b/Peel/Views/Cloud/CloudView.swift
@@ -63,7 +63,8 @@ struct CloudView: View {
} actions: {
SelectMenu(
list: SelectableRows(
- rows: listed.map(\.url), selectable: listed.map(\.url), recommended: listed.map(\.url)
+ rows: listed.map(\.url), selectable: listed.map(\.url), recommended: listed.map(\.url),
+ leftToTheClick: []
),
place: Text(Tool.cloud.title),
selection: cloud
diff --git a/Peel/Views/FileSearch/FileSearchList.swift b/Peel/Views/FileSearch/FileSearchList.swift
index 24d37b80..4461bb22 100644
--- a/Peel/Views/FileSearch/FileSearchList.swift
+++ b/Peel/Views/FileSearch/FileSearchList.swift
@@ -45,7 +45,8 @@ struct FileSearchList: View {
list: SelectableRows(
rows: results.files.map(\.url),
selectable: results.files.filter { !$0.requiresPrivileges }.map(\.url),
- recommended: results.files.map(\.url).filter(search.recommendedURLs.contains)
+ recommended: results.files.map(\.url).filter(search.recommendedURLs.contains),
+ leftToTheClick: results.files.filter(\.isInTheCloud).map(\.url)
),
place: Text(Tool.fileSearch.title),
selection: search
diff --git a/Peel/Views/MultipleAppsView.swift b/Peel/Views/MultipleAppsView.swift
index f02d0d20..97adb1a8 100644
--- a/Peel/Views/MultipleAppsView.swift
+++ b/Peel/Views/MultipleAppsView.swift
@@ -223,7 +223,8 @@ struct MultipleAppsView: View {
return SelectableRows(
rows: rows,
selectable: rows.filter(plan.selectable.contains),
- recommended: rows.filter(plan.suggested.contains)
+ recommended: rows.filter(plan.suggested.contains),
+ leftToTheClick: items.filter(\.isLeftToTheClick).map(\.url)
)
}
diff --git a/Peel/Views/Packages/PackageDetailView.swift b/Peel/Views/Packages/PackageDetailView.swift
index 398e6744..a6eb8644 100644
--- a/Peel/Views/Packages/PackageDetailView.swift
+++ b/Peel/Views/Packages/PackageDetailView.swift
@@ -161,7 +161,8 @@ struct PackageDetailView: View {
SelectableRows(
rows: receipt.items.map(\.url),
selectable: receipt.items.filter { !isLocked($0) && !$0.isLeftAlone }.map(\.url),
- recommended: receipt.items.filter { !isLocked($0) && !$0.isLeftAlone && $0.heldBack == nil }.map(\.url)
+ recommended: receipt.items.filter { !isLocked($0) && !$0.isLeftAlone && $0.heldBack == nil }.map(\.url),
+ leftToTheClick: receipt.items.filter { $0.heldBack?.isLeftToTheClick == true }.map(\.url)
)
}
diff --git a/Peel/Views/ResetSheet.swift b/Peel/Views/ResetSheet.swift
index a237faf9..00796ed1 100644
--- a/Peel/Views/ResetSheet.swift
+++ b/Peel/Views/ResetSheet.swift
@@ -141,7 +141,8 @@ struct ResetSheet: View {
list: SelectableRows(
rows: items.map(\.url),
selectable: items.map(\.url),
- recommended: items.map(\.url).filter(plan.suggested.contains)
+ recommended: items.map(\.url).filter(plan.suggested.contains),
+ leftToTheClick: []
),
place: Text(group.title),
selection: plan
diff --git a/Peel/Views/SelectAllButton.swift b/Peel/Views/SelectAllButton.swift
index f2b9a031..8a6d3a3a 100644
--- a/Peel/Views/SelectAllButton.swift
+++ b/Peel/Views/SelectAllButton.swift
@@ -11,7 +11,7 @@ struct SelectAllButton<ID: Hashable>: View {
var body: some View {
if !selectable.isEmpty {
- let list = SelectableRows(rows: rows, selectable: selectable, recommended: selectable)
+ let list = SelectableRows(rows: rows, selectable: selectable, recommended: selectable, leftToTheClick: [])
let isAllSelected = list.isAllSelected(in: selection)
Button {
selection = isAllSelected ? list.deselectingAll(in: selection) : list.selectingAll(in: selection)
diff --git a/README.md b/README.md
index 9a792d3b..27e9c468 100644
--- a/README.md
+++ b/README.md
@@ -81,7 +81,8 @@ Peel is free and open source, and it speaks English and 17 other languages.
a repository, or the app keeps there what may exist only on this Mac: local mail, message history, sign-in codes,
or VPN connections. A file another installed app also uses is shown but never selected, and anything Peel is less
sure of waits under Review Before Removing. A list's Select menu picks what Peel recommends, everything, or
- nothing, and asks before it selects what Peel doesn't recommend.
+ nothing. Select All passes by what Peel holds back, guesses at, or shares with another app, which you select one
+ by one, and asks before it adds anything else Peel doesn't recommend.
- **Several ways in.** Choose an app in the list, drop one on Peel's Dock icon, select several apps at once, or
Control-click an app in Finder and choose Uninstall with Peel. With Watch the Trash on, Peel notices when you
drag an app to the Trash yourself and offers to clear what it left behind. Apps you keep outside the Applications
diff --git a/SAFETY.md b/SAFETY.md
index 0e0ca68c..8a5e7955 100644
--- a/SAFETY.md
+++ b/SAFETY.md
@@ -200,8 +200,11 @@ on its own, such as `target` or `build`, is listed and never selected either.
Orphaned Files selects nothing for you, and `peel orphans --remove` leaves these folders out as well: one in
`/Users/Shared`, one with a repository, a wallet, a signing key, or a password database inside, one that may hold what
-exists only on this Mac, or one Peel could not read or measure in time, moves only when you select it yourself. Select
-All selects such a folder too only after asking, with how many items Peel doesn't recommend removing.
+exists only on this Mac, or one Peel could not read or measure in time, moves only when you select it yourself.
+
+On every list, Select All passes by what Peel holds back for what it may hold, what it only guesses belongs to the
+app, what another app also uses, and macOS's own caches: each is selected only with its own click, after its reason
+has been read. What else Select All adds that Peel doesn't recommend, it asks about first.
In Duplicates, one copy of every group always stays, and a file that changed since the scan is refused. Nothing
inside an app or another package is ever offered, nor a hidden folder, such as a tool's settings in `~/.config`:
@@ -239,8 +242,8 @@ A wallet's keys can be the only way to what they hold, so Peel keeps them in fou
folder, it also looks inside for the names wallets and key tools give their files: anything called
`wallet.dat`, `wallets`, `keystore`, `seed.dat`, `hsm_secret`, or `channel.backup`, anything ending in `.wallet`
or `.keys`, and the others `FileSize.isWallet` lists. A folder with one inside is shown with that reason and
- never selected for you, not by `peel uninstall` or `peel orphans --remove`, and Select All asks before it selects
- one. You can still select it yourself, because a name can mislead: a Java project keeps a `keystore` too.
+ never selected for you, not by `peel uninstall`, `peel orphans --remove`, or Select All. You can still select it
+ yourself, because a name can mislead: a Java project keeps a `keystore` too.
- **A folder Peel could not finish reading is treated the same way**, whether it ran out of time or macOS kept a
folder inside it closed. A coin's data folder, with its blockchain, is the one most likely to be too big to read
in time, and its wallet may be inside.