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
Act on no background job while the exclusions aren't known
Țugui Dragoșf9f11ae8a12d
diff --git a/Packages/PeelCore/Sources/PeelCore/BackgroundItems/BackgroundItem.swift b/Packages/PeelCore/Sources/PeelCore/BackgroundItems/BackgroundItem.swiftindex afd40387..3b30ad09 100644--- a/Packages/PeelCore/Sources/PeelCore/BackgroundItems/BackgroundItem.swift+++ b/Packages/PeelCore/Sources/PeelCore/BackgroundItems/BackgroundItem.swift@@ -72,6 +72,8 @@ public struct BackgroundItem: Sendable, Hashable, Identifiable {public var isFileGone = false/// True for a job of an app the person excluded in Settings, which Peel lists and never acts on.public var isExcluded = false+ /// True while the exclusions aren't known: any job may be an excluded app's, so none is acted on.+ public var exclusionsAreNotKnown = false/// True for a job its app gave launchd itself, as an update's installer is given, rather than registered with/// ServiceManagement: System Settings doesn't list it, and launchd forgets it at the next logout or restart.public var isSubmittedByItsApp = false@@ -114,7 +116,7 @@ public struct BackgroundItem: Sendable, Hashable, Identifiable {/// extension or for an excluded app, an agent only under a label `launchctl` reads whole, and a daemon only under a/// label the helper takes, which also leaves out the helper itself.public var canBeControlled: Bool {- !usesALabelOfMacOS && !isSystemExtension && !isExcluded+ !usesALabelOfMacOS && !isSystemExtension && !isExcluded && !exclusionsAreNotKnown&& (requiresPrivileges ? PrivilegedPathPolicy.allowsDaemon(label) : isReadWholeByLaunchctl)}diff --git a/Packages/PeelCore/Sources/PeelCore/BackgroundItems/BackgroundItems.swift b/Packages/PeelCore/Sources/PeelCore/BackgroundItems/BackgroundItems.swiftindex 7cd9d514..6d13b17a 100644--- a/Packages/PeelCore/Sources/PeelCore/BackgroundItems/BackgroundItems.swift+++ b/Packages/PeelCore/Sources/PeelCore/BackgroundItems/BackgroundItems.swift@@ -128,6 +128,7 @@ public enum BackgroundItems {.map { item invar item = itemitem.isExcluded = item.isOfAnApp(excludedBy: exclusions)+ item.exclusionsAreNotKnown = !exclusions.isKnownreturn item}.sorted { $0.label.localizedStandardCompare($1.label) == .orderedAscending }diff --git a/Packages/PeelCore/Tests/PeelCoreTests/BackgroundItemActionsTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/BackgroundItemActionsTests.swiftindex 4581403a..692ce1f5 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/BackgroundItemActionsTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/BackgroundItemActionsTests.swift@@ -88,6 +88,18 @@ struct BackgroundItemActionsTests {#expect(rows.map(\.canMoveToTrash) == [false, true])}+ @Test func nothingIsControlledWhileTheExclusionsAreNotKnown() {+ let job = item(state: .running(pid: 42), plist: URL(filePath: "/Users/me/Library/LaunchAgents/job.plist"))+ for exclusions in [Exclusions.unreadable, .notYetRead] {+ let row = BackgroundItems.rows([job], exclusions: exclusions)[0]++ #expect(!row.canBeControlled)+ #expect(!row.offersControls)+ #expect(BackgroundItemActions.refusal(for: row) != nil)+ }+ #expect(BackgroundItems.rows([job], exclusions: .none)[0].canBeControlled)+ }+@Test func aJobIsExcludedWithAnAppExcludedByItsPlace() async throws {let vendor = URL(filePath: "/Applications/Vendor", directoryHint: .isDirectory)let plist = URL(filePath: "/Users/x/Library/LaunchAgents/org.example.vendor.agent.plist")diff --git a/Peel/Views/BackgroundItems/BackgroundItemDetailView.swift b/Peel/Views/BackgroundItems/BackgroundItemDetailView.swiftindex eaf555f2..4f4abab8 100644--- a/Peel/Views/BackgroundItems/BackgroundItemDetailView.swift+++ b/Peel/Views/BackgroundItems/BackgroundItemDetailView.swift@@ -106,6 +106,12 @@ struct BackgroundItemDetailView: View {}}+ if ExclusionsStore.shared.exclusions.isUnreadable, !item.canMoveToTrash {+ Section {+ RemovalsHeldBanner(recordsInHistory: false)+ }+ }+if item.isExcluded {Section {Notice(diff --git a/Peel/Views/BackgroundItems/BackgroundItemList.swift b/Peel/Views/BackgroundItems/BackgroundItemList.swiftindex 7082d1e5..698c2dc4 100644--- a/Peel/Views/BackgroundItems/BackgroundItemList.swift+++ b/Peel/Views/BackgroundItems/BackgroundItemList.swift@@ -12,6 +12,7 @@ struct BackgroundItemList: View {let filtered = filteredItemsList(selection: $backgroundItems.selection) {+ RemovalsHeldBanner(recordsInHistory: false)if let note = backgroundItems.missingNote, !filtered.isEmpty {Notice(title: Text("Part of this list may be missing"), detail: Text(verbatim: note), kind: .note) {}.padding(.vertical, 6)