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
Offer Copy Details whenever the alert after a removal names only the first apps
Țugui Dragoș4c1c5cac03ff
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e8f661fb..8d8e8edd 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -145,8 +145,8 @@ its changes the way [Keep a Changelog](https://keepachangelog.com/) suggests.#### Applications- When many apps stay after a removal, as without App Management, the alert names the first few and counts the others,- so its Open System Settings button stays on the screen; Copy Details still gives every app. Several apps' question- names the first few apps that go and that stay the same way.+ so its Open System Settings button stays on the screen; Copy Details, offered whenever the alert names only the first+ few, gives every app. Several apps' question names the first few apps that go and that stay the same way.- iPhone and iPad apps installed on the Mac from the App Store are checked for updates against their own listing, in thestore they came from, and Mac apps sold together with their iPhone version against their Mac listing; both read "Can'tcheck for updates" while the App Store listed their updates.diff --git a/Peel/Views/RemovalFailureAlert.swift b/Peel/Views/RemovalFailureAlert.swiftindex 92251c9f..b89dc69a 100644--- a/Peel/Views/RemovalFailureAlert.swift+++ b/Peel/Views/RemovalFailureAlert.swift@@ -45,7 +45,7 @@ struct RemovalFailureAlert: ViewModifier {Navigator.shared.requestedTool = .orphans}}- if !outcome.failures.isEmpty {+ if Self.offersDetails(for: outcome) {Button("Copy Details") { Self.copyDetails(of: outcome) }}// The alert reports, so Return closes it. Otherwise the first other button would be the default, and Return@@ -147,6 +147,12 @@ struct RemovalFailureAlert: ViewModifier {return [String(localized: "If Peel isn’t allowed under App Management, macOS won’t let it move another developer’s app to the Trash.")]}+ /// Offered for a failure, whose full path the alert shortens, and wherever the alert names only the first entries+ /// of a list, so every name it leaves out can still be read.+ static func offersDetails(for outcome: RemovalOutcome) -> Bool {+ !outcome.failures.isEmpty || message(for: outcome) != details(for: outcome)+ }+/// Copies every item with its full path, since the alert lists only the first few and its text can't be/// selected.private static func copyDetails(of outcome: RemovalOutcome) {diff --git a/PeelTests/RemovalFailureAlertTests.swift b/PeelTests/RemovalFailureAlertTests.swiftindex b2d1b009..364e8ac4 100644--- a/PeelTests/RemovalFailureAlertTests.swift+++ b/PeelTests/RemovalFailureAlertTests.swift@@ -37,4 +37,19 @@ struct RemovalFailureAlertTests {#expect(line != nil)#expect(RemovalFailureAlert.details(for: outcome).components(separatedBy: "\n\n").contains(line ?? ""))}++ @Test func offersTheDetailsWhereTheAlertNamesOnlyTheFirstApps() {+ let apps = (1...6).map { index in+ InstalledApp(+ url: URL(filePath: "/Applications/Example \(index).app"),+ bundleIdentifier: "org.example.app\(index)", name: "Example \(index)"+ )+ }+ let many = RemovalOutcome()+ many.report(TrashResult(), privacy: apps.map { ($0, .notKnownToTheSystem) })+ #expect(RemovalFailureAlert.offersDetails(for: many))+ let few = RemovalOutcome()+ few.report(TrashResult(), privacy: apps.prefix(2).map { ($0, .notKnownToTheSystem) })+ #expect(!RemovalFailureAlert.offersDetails(for: few))+ }}