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.

Say on a plug-in's page which app it came with

Țugui Dragoșf596c16b8e46
diff --git a/GUIDE.md b/GUIDE.md
index 498539da..3253ca72 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -256,8 +256,8 @@ and how many items the others hold.
the choice made for each one, or that macOS decides when nobody chose, and where it is turned on or off: System
Settings for most, Safari > Settings > Extensions for a Safari extension, which Safari alone shows the state of, Edit
Widgets for a widget, and nowhere for what Shortcuts and Siri use.
-- **Plug-ins:** plug-ins of every kind, from audio units to Quick Look, each of which you can move to the Trash,
- after Peel warns that apps using it may stop working.
+- **Plug-ins:** plug-ins of every kind, from audio units to Quick Look, each with the app it came with, as Orphaned
+ Files tells it, and each of which you can move to the Trash, after Peel warns that apps using it may stop working.
- **Package Receipts:** what installer packages other than Apple's put on your Mac, item by item, to move to the Trash.
Nothing is selected for you, and Select Recommended passes by a folder a package made that now holds what something
else put there. Forget Receipt moves the receipt itself to the Trash, through Peel's helper, so macOS no longer counts
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstrings
index d62213eb..560901b1 100644
--- a/Localization/Peel/Localizable.xcstrings
+++ b/Localization/Peel/Localizable.xcstrings
@@ -228,6 +228,220 @@
}
}
},
+ "%@ and other apps that use it may stop working." : {
+ "comment" : "In the question before a plug-in moves to the Trash. %@ is the installed app the plug-in came with.",
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ a další aplikace, které ho používají, mohou přestat fungovat."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "„%@“ und andere Apps, die es verwenden, funktionieren möglicherweise nicht mehr."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Puede que %@ y otras apps que lo usan dejen de funcionar."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ et les autres apps qui l’utilisent peuvent cesser de fonctionner."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ e altre app che lo usano potrebbero smettere di funzionare."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“%@”や、これを使用しているほかのアプリが動作しなくなる場合があります。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "‘%@’ 및 이 항목을 사용하는 다른 앱이 작동을 멈출 수 있습니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ en andere apps die het gebruiken, werken misschien niet meer."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ i inne aplikacje, które z niej korzystają, mogą przestać działać."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ e outros apps que o usam podem parar de funcionar."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ și alte aplicații care îl folosesc pot înceta să funcționeze."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Приложение «%@» и другие приложения, которые его используют, могут перестать работать."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ och andra appar som använder den kan sluta fungera."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ ve onu kullanan diğer uygulamalar çalışmayı durdurabilir."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Програма «%@» та інші програми, які його використовують, можуть перестати працювати."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“%@”和其他使用它的App可能会停止工作。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "「%@」和其他使用它的App可能會停止運作。"
+ }
+ }
+ }
+ },
+ "%@ and other apps that use it may stop working. History can’t put it back, since code is loaded from its folder and it isn’t root’s alone, but you can drag it back out in Finder." : {
+ "comment" : "In the question before a plug-in moves to the Trash through Peel’s helper. %@ is the installed app the plug-in came with.",
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ a další aplikace, které ho používají, mohou přestat fungovat. Historie ho nemůže vrátit zpět, protože se z jeho složky načítá kód a sám nepatří výhradně uživateli root, ale ve Finderu ho můžete přetáhnout zpět ven."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "„%@“ und andere Apps, die es verwenden, funktionieren möglicherweise nicht mehr. Im Verlauf lässt es sich nicht zurücklegen, da aus seinem Ordner Code geladen wird und es nicht ausschließlich root gehört, du kannst es aber im Finder wieder herausziehen."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Puede que %@ y otras apps que lo usan dejen de funcionar. Historial no puede restaurarlo, ya que no pertenece solo a root y desde su carpeta se carga código, pero puedes sacarlo arrastrándolo en el Finder."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ et les autres apps qui l’utilisent peuvent cesser de fonctionner. L’Historique ne peut pas le remettre en place, car du code est chargé depuis son dossier et cet élément n’appartient pas uniquement à root, mais vous pouvez le sortir de la corbeille dans le Finder, en le faisant glisser."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ e altre app che lo usano potrebbero smettere di funzionare. La Cronologia non può ripristinarlo, perché dalla sua cartella viene caricato del codice e l’elemento non appartiene esclusivamente a root, ma puoi trascinarlo fuori nel Finder."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“%@”や、これを使用しているほかのアプリが動作しなくなる場合があります。これがあるフォルダからはコードが読み込まれ、rootだけが所有するものでもないため、履歴から戻すことはできません。ただし、Finderでドラッグして取り出せます。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "‘%@’ 및 이 항목을 사용하는 다른 앱이 작동을 멈출 수 있습니다. 이 항목이 들어 있는 폴더에서 코드가 로드되고 이 항목은 Root 사용자 전용이 아니므로 기록에서 되돌려 놓을 수 없지만, Finder에서 드래그하여 꺼낼 수 있습니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ en andere apps die het gebruiken, werken misschien niet meer. Geschiedenis kan het niet terugzetten, omdat er vanuit de map ervan code wordt geladen en het niet uitsluitend van root is, maar je kunt het in Finder er weer uit slepen."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ i inne aplikacje, które z niej korzystają, mogą przestać działać. Historia nie może jej przywrócić, ponieważ z jej folderu wczytywany jest kod, a ona sama nie należy wyłącznie do użytkownika root, ale możesz przeciągnąć ją z Kosza w Finderze."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ e outros apps que o usam podem parar de funcionar. O Histórico não pode colocá-lo de volta, porque a pasta em que ele está é usada para carregar código e ele não pertence só ao usuário root, mas você pode arrastá-lo para fora no Finder."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ și alte aplicații care îl folosesc pot înceta să funcționeze. Nu îl puteți pune înapoi din Istoric, deoarece din dosarul său se încarcă cod și articolul nu aparține doar utilizatorului Root, însă, în Finder, îl puteți trage afară din Coș."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Приложение «%@» и другие приложения, которые его используют, могут перестать работать. История не сможет его восстановить, поскольку из его папки загружается код, а он принадлежит не только пользователю root, но в Finder его можно перетащить из Корзины обратно."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ och andra appar som använder den kan sluta fungera. Historik kan inte lägga tillbaka den, eftersom kod läses in från dess mapp och den inte enbart tillhör rotanvändaren, men du kan dra ut den igen i Finder."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@ ve onu kullanan diğer uygulamalar çalışmayı durdurabilir. Geçmiş onu yerine koyamaz, çünkü klasöründen kod yüklenir ve tek sahibi root değildir; ancak onu Finder’da sürükleyerek dışarı çıkarabilirsiniz."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Програма «%@» та інші програми, які ним користуються, можуть перестати працювати. Історія не зможе його повернути, бо з його папки завантажується код, а він належить не лише користувачу root, але у Finder його можна перетягнути зі Смітника назад."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“%@”和其他使用它的App可能会停止工作。“历史记录”无法将它放回原处,因为系统会从它所在的文件夹载入代码,而且它并非仅归root所有,不过你可以在“访达”中将它拖出来。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "「%@」和其他使用它的App可能會停止運作。由於系統會從它所在的檔案夾載入程式碼,且它並非只屬於root,「歷史記錄」無法將它還原,但你可以在Finder中將它拖出來。"
+ }
+ }
+ }
+ },
"%@ asks you again for what it was allowed to access. History can’t undo this." : {
"localizations" : {
"cs" : {
@@ -6260,6 +6474,113 @@
}
}
},
+ "%@, no longer on this Mac" : {
+ "comment" : "On a plug-in’s page, beside Installed with: %@ is the app the plug-in came with, which Peel saw installed and then saw go.",
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@, už není v tomto Macu"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@, nicht mehr auf diesem Mac"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@, ya no está en este Mac"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@, qui n’est plus sur ce Mac"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@, non più presente su questo Mac"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@(このMacにはもうありません)"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@, 이 Mac에 더 이상 없음"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@, niet meer op deze Mac"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@, której nie ma już na tym Macu"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@, não está mais neste Mac"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@, nu mai este pe acest Mac"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@, которого больше нет на этом Mac"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@, finns inte längre på den här datorn"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@, artık bu Mac’te değil"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@, якої вже немає на цьому Mac"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@,已不在这台Mac上"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "%@(已不在這部Mac上)"
+ }
+ }
+ }
+ },
"%@, update available: %@" : {
"localizations" : {
"cs" : {
@@ -65874,6 +66195,113 @@
}
}
},
+ "Installed with" : {
+ "comment" : "A row’s label on a plug-in’s page: the app the plug-in came with.",
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Nainstalováno s aplikací"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Installiert mit"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Instalado con"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Installé avec"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Installato con"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "一緒にインストールされたアプリ"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "함께 설치된 앱"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Geïnstalleerd met"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Zainstalowano z aplikacją"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Instalado com"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Instalat cu"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Установлен вместе с приложением"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Installerad med"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Birlikte yüklendiği uygulama"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Інстальовано разом із"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "安装来源"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "隨同安裝的App"
+ }
+ }
+ }
+ },
"Installer Receipt" : {
"localizations" : {
"cs" : {
diff --git a/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift b/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift
index 4ea5e1f9..59127fb3 100644
--- a/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift
@@ -43,6 +43,15 @@ public struct Plugin: Sendable, Hashable, Identifiable {
/// and it isn't root's alone (the helper's `.loadsCode`).
public var staysInTheTrash = false
+ /// The app the plug-in came with, as Orphaned Files tells it.
+ public enum Origin: Sendable, Hashable {
+ case installedApp(name: String)
+ /// An app Peel saw installed and then saw go.
+ case goneApp(name: String)
+ }
+
+ public var origin: Origin?
+
public var id: URL { url }
/// Whether it is an Automator workflow in a Services folder: a Quick Action, which an app may have put there or
@@ -119,6 +128,44 @@ public enum Plugins {
}
}
+ /// An installed app with what the matcher knows of it, made once per scan, since each plug-in is asked about every
+ /// app.
+ struct Claimant: Sendable {
+ let name: String
+ let profile: LeftoverMatcher.Profile
+
+ init(_ app: InstalledApp) {
+ name = app.name
+ profile = LeftoverMatcher.Profile(app)
+ }
+ }
+
+ /// The app a plug-in came with: an installed app that claims it surely, through the identifier it declares or,
+ /// for one that declares none, through its name, since a name its identifier doesn't back says nothing; else the
+ /// app Peel saw go whose identifier it has, extends, or shares a maker with, as Orphaned Files lists it.
+ static func origin(
+ of url: URL, identifier: String?, claimants: [Claimant], goneApps: [RememberedApp]
+ ) -> Plugin.Origin? {
+ let name = LeftoverMatcher.key(from: url.lastPathComponent, kind: .plugIns)
+ let candidate = LeftoverMatcher.Candidate(identifier ?? name)
+ let claims = claimants.compactMap { app in
+ app.profile.claim(for: candidate).map { (name: app.name, evidence: $0) }
+ }
+ let sure = claims.filter { $0.evidence.confidence != .possible }
+ if let app = sure.max(by: { $0.evidence.rank < $1.evidence.rank }) {
+ return .installedApp(name: app.name)
+ }
+ guard let identifier else { return nil }
+ let plugIn = identifier.lowercased()
+ let gone = goneApps.first { app in
+ let own = app.bundleIdentifier.lowercased()
+ return plugIn == own || plugIn.hasPrefix(own + ".")
+ } ?? goneApps.first { app in
+ OrphanScanner.cameWithAnAppThatLeft(identifier, goneApps: [app.bundleIdentifier.lowercased()])
+ }
+ return gone.map { .goneApp(name: $0.name) }
+ }
+
/// Returns the `CFBundleIdentifier` in the plug-in's `Info.plist`. A plug-in is named for what it does, not
/// for who made it, so this is its only identifier. It is only a claim, so callers match it like a file name.
static func declaredIdentifier(at url: URL) -> String? {
@@ -126,20 +173,32 @@ public enum Plugins {
return AppInspector.infoDictionary(in: contents)?["CFBundleIdentifier"] as? String
}
+ /// Reads the plug-ins, each with the app it came with, from the apps in the environment's Applications folders and
+ /// those Peel remembers.
@concurrent
public static func scan(
environment: SearchEnvironment = .current,
exclusions: Exclusions = .none
) async -> PluginScan {
- await scan(environment: environment, exclusions: exclusions, measure: FileSize.measure)
+ await scan(
+ environment: environment,
+ exclusions: exclusions,
+ installedApps: await AppCatalog.installedApps(in: AppCatalog.directories(in: environment)),
+ remembered: await AppMemory(url: AppMemory.url(inHome: environment.homeDirectory)).load(),
+ measure: FileSize.measure
+ )
}
@concurrent
static func scan(
environment: SearchEnvironment,
exclusions: Exclusions,
+ installedApps: [InstalledApp] = [],
+ remembered: [RememberedApp] = [],
measure: @escaping FileSize.Measure
) async -> PluginScan {
+ let (apps, goneApps) = OrphanScanner.split(remembered, installedApps: installedApps)
+ let claimants = apps.map(Claimant.init)
var unreadable: [URL] = []
let found = installed(in: environment, unreadable: &unreadable)
.filter { !exclusions.excludes($0.url) && !exclusions.holds($0.url) }
@@ -165,6 +224,9 @@ public enum Plugins {
)
plugin.staysInTheTrash = requiresPrivileges
&& reach.refusal(ofPuttingBack: item.url, at: item.url) == .loadsCode
+ plugin.origin = origin(
+ of: item.url, identifier: plugin.bundleIdentifier, claimants: claimants, goneApps: goneApps
+ )
return plugin
}
let sorted = plugins.compactMap(\.self).sorted {
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift
index b703cd57..0b64ca37 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift
@@ -65,6 +65,34 @@ struct PluginsTests {
#expect(plugins.first { $0.name == "Own" }?.staysInTheTrash == false)
}
+ /// A plug-in's page says which app it came with, by Orphaned Files' rule: an installed app its declared identifier
+ /// names, one whose name a plug-in that declares none carries, or else an app Peel saw go.
+ @Test func saysWhichAppAPlugInCameWith() {
+ let surge = InstalledApp(
+ url: URL(filePath: "/Applications/Surge XT.app"), bundleIdentifier: "org.example.surgext", name: "Surge XT"
+ )
+ let compressor = InstalledApp(
+ url: URL(filePath: "/Applications/Compressor.app"), bundleIdentifier: "org.example.compressor",
+ name: "Compressor"
+ )
+ let gone = RememberedApp(
+ bundleIdentifier: "com.gonevendor.gone", name: "Gone", teamIdentifier: nil, lastSeen: .now,
+ lastPath: "/Applications/Gone.app"
+ )
+ func origin(_ name: String, _ identifier: String?) -> Plugin.Origin? {
+ Plugins.origin(
+ of: URL(filePath: "/Library/Audio/Plug-Ins/Components/\(name)"), identifier: identifier,
+ claimants: [surge, compressor].map(Plugins.Claimant.init), goneApps: [gone]
+ )
+ }
+
+ #expect(origin("Surge XT.component", "org.example.surgext.au") == .installedApp(name: "Surge XT"))
+ #expect(origin("Compressor.component", nil) == .installedApp(name: "Compressor"))
+ #expect(origin("Compressor.component", "com.othervendor.compressor") == nil)
+ #expect(origin("Gone.component", "com.gonevendor.gone.au") == .goneApp(name: "Gone"))
+ #expect(origin("Nobody.component", "org.nobody.thing") == nil)
+ }
+
@Test func namesAQuickActionAsTheServicesMenuDoes() {
let workflow = URL(filePath: "/org.example/Library/Services/Example - ask.workflow")
let menu: [String: Any] = ["NSServices": [["NSMenuItem": ["default": "Ask Example"]]]]
diff --git a/Peel/Views/Plugins/PluginDetailView.swift b/Peel/Views/Plugins/PluginDetailView.swift
index cd17b986..241e147c 100644
--- a/Peel/Views/Plugins/PluginDetailView.swift
+++ b/Peel/Views/Plugins/PluginDetailView.swift
@@ -45,6 +45,14 @@ struct PluginDetailView: View {
}
.labeledContentStyle(.oneLine)
}
+ if let origin = plugin.origin {
+ LabeledContent("Installed with") {
+ switch origin {
+ case .installedApp(let name): Text(verbatim: name)
+ case .goneApp(let name): Text("\(name), no longer on this Mac")
+ }
+ }
+ }
if let version = plugin.version {
LabeledContent("Version") {
Text(verbatim: version)
@@ -147,9 +155,17 @@ extension Plugin {
case (true, false):
["It leaves the Services menu and Quick Actions, and it may be one someone made in Automator on this Mac."]
case (false, true):
- ["Apps that use it may stop working. History can’t put it back, since code is loaded from its folder and it isn’t root’s alone, but you can drag it back out in Finder."]
+ if case .installedApp(let name) = origin {
+ ["\(name) and other apps that use it may stop working. History can’t put it back, since code is loaded from its folder and it isn’t root’s alone, but you can drag it back out in Finder."]
+ } else {
+ ["Apps that use it may stop working. History can’t put it back, since code is loaded from its folder and it isn’t root’s alone, but you can drag it back out in Finder."]
+ }
case (false, false):
- ["Apps that use it may stop working."]
+ if case .installedApp(let name) = origin {
+ ["\(name) and other apps that use it may stop working."]
+ } else {
+ ["Apps that use it may stop working."]
+ }
}
}
}