Skip to content

Free, open-source macOS cleaner. CleanMyMac alternative with zero telemetry. Native SwiftUI, scheduled auto-cleaning, Xcode/Homebrew/system cache cleanup. MIT licensed.

feat: permanent FDA UX + premium UI overhaul + bump to 2.4.0 (build 8)

moamen09837009c18c
diff --git a/PureMac.xcodeproj/project.pbxproj b/PureMac.xcodeproj/project.pbxproj
index d1f726a..e2ac18b 100644
--- a/PureMac.xcodeproj/project.pbxproj
+++ b/PureMac.xcodeproj/project.pbxproj
@@ -19,6 +19,8 @@
50304378D99F2E9E48B642AF /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 9CC8F66E27BE52A6639E904B /* Sparkle */; };
535B23C0108C06475215B8E8 /* AppTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AB003A7751F05727DBFD1A5 /* AppTheme.swift */; };
59B3096E2AE8ED0397B16798 /* AppLanguagePreferencesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 491771F923C93FD61A263893 /* AppLanguagePreferencesTests.swift */; };
+ 61D285E96DED76FDCD54570F /* PermissionSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 069AAE87E3F9EDE5593AD8B3 /* PermissionSheet.swift */; };
+ 6E72022A661CBB41331A442C /* PermissionCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9DCBD97CC88D77AE8DB01A4 /* PermissionCoordinator.swift */; };
75B5F0401D37F2872B1AD85A /* AppListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60E6BC61614B27C065BB18C9 /* AppListView.swift */; };
76B132F9C499225D33E0D075 /* EmptyStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 424F7B28624C271620E13BBC /* EmptyStateView.swift */; };
826A750D2D7EC14C2AE306A3 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3667D46D8E2004EB4D73835A /* Models.swift */; };
@@ -60,6 +62,7 @@
01B2C5F66B6D812572BD4F05 /* CLI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CLI.swift; sourceTree = "<group>"; };
022D0EAEE2B6E54069FC2CBE /* UpdateService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateService.swift; sourceTree = "<group>"; };
02E502E2B5C6AECC76E5CFEF /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
+ 069AAE87E3F9EDE5593AD8B3 /* PermissionSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PermissionSheet.swift; sourceTree = "<group>"; };
10B0AF194677EAC1D5568785 /* CategoryDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryDetailView.swift; sourceTree = "<group>"; };
155CE1B8CDCCCA6F9FD028C1 /* LocalizationFilesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizationFilesTests.swift; sourceTree = "<group>"; };
1AB003A7751F05727DBFD1A5 /* AppTheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppTheme.swift; sourceTree = "<group>"; };
@@ -103,6 +106,7 @@
EEF15CB1B8EFCA78EF491824 /* ScanError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScanError.swift; sourceTree = "<group>"; };
F31F91226CDCFBB8E303B7DA /* AppConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppConstants.swift; sourceTree = "<group>"; };
F661A0F64CF93E482CB1728F /* DashboardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardView.swift; sourceTree = "<group>"; };
+ F9DCBD97CC88D77AE8DB01A4 /* PermissionCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PermissionCoordinator.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -175,6 +179,7 @@
children = (
2A8DE5D45BA19E2670B57DC5 /* CleaningEngine.swift */,
E866A1541D289C69144A5E62 /* FullDiskAccessManager.swift */,
+ F9DCBD97CC88D77AE8DB01A4 /* PermissionCoordinator.swift */,
A711CDF5285F68775D9B5513 /* ScanEngine.swift */,
28181F034530331A550C6A3D /* SchedulerService.swift */,
022D0EAEE2B6E54069FC2CBE /* UpdateService.swift */,
@@ -204,6 +209,7 @@
92259B3E9F4468865F15DEEC /* AppearancePill.swift */,
1AB003A7751F05727DBFD1A5 /* AppTheme.swift */,
424F7B28624C271620E13BBC /* EmptyStateView.swift */,
+ 069AAE87E3F9EDE5593AD8B3 /* PermissionSheet.swift */,
);
path = Components;
sourceTree = "<group>";
@@ -420,6 +426,8 @@
BC6C800216343438413349A3 /* OnboardingView.swift in Sources */,
FDA30FE6349CA01C8D859F04 /* OrphanListView.swift in Sources */,
A9C3A1F643C26930F442E729 /* OrphanSafetyPolicy.swift in Sources */,
+ 6E72022A661CBB41331A442C /* PermissionCoordinator.swift in Sources */,
+ 61D285E96DED76FDCD54570F /* PermissionSheet.swift in Sources */,
EDEF28CAD23E936FBED1783B /* PureMacApp.swift in Sources */,
D9445C2641A8637B65DA5ACE /* ScanEngine.swift in Sources */,
D50EB059E741011EB2523731 /* ScanError.swift in Sources */,
@@ -509,7 +517,7 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 7;
+ CURRENT_PROJECT_VERSION = 8;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = H3WXHVTP97;
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -531,7 +539,7 @@
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = PureMac/Info.plist;
MACOSX_DEPLOYMENT_TARGET = 13.0;
- MARKETING_VERSION = 2.3.0;
+ MARKETING_VERSION = 2.4.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = NO;
@@ -633,7 +641,7 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 7;
+ CURRENT_PROJECT_VERSION = 8;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = H3WXHVTP97;
ENABLE_NS_ASSERTIONS = NO;
@@ -649,7 +657,7 @@
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = PureMac/Info.plist;
MACOSX_DEPLOYMENT_TARGET = 13.0;
- MARKETING_VERSION = 2.3.0;
+ MARKETING_VERSION = 2.4.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = NO;
diff --git a/PureMac/Services/FullDiskAccessManager.swift b/PureMac/Services/FullDiskAccessManager.swift
index f9b1107..614b00f 100644
--- a/PureMac/Services/FullDiskAccessManager.swift
+++ b/PureMac/Services/FullDiskAccessManager.swift
@@ -58,15 +58,30 @@ final class FullDiskAccessManager {
/// The OS only registers an app in the FDA pane after that app itself
/// makes a TCC-gated syscall. Metadata lookups (fileExists, isReadableFile)
/// don't qualify, and delegating to Finder via AppleScript registers
- /// *Finder* — not PureMac. So at launch we touch a few protected paths
- /// directly. The reads will fail until the user grants access; that's
- /// fine — the failed attempts are what register us.
+ /// *Finder* — not PureMac. So at launch we touch a broad set of protected
+ /// paths directly. The reads will fail until the user grants access;
+ /// that's fine — the failed attempts are what register us. Probing more
+ /// surfaces (Mail, Safari, Messages, HomeKit) widens the set of TCC
+ /// services the OS catalogues against PureMac so the bundle shows up
+ /// reliably the first time the user opens the Privacy pane.
func triggerRegistration() {
DispatchQueue.global(qos: .utility).async {
- _ = self.canActuallyRead(path: "/Library/Application Support/com.apple.TCC/TCC.db")
let home = FileManager.default.homeDirectoryForCurrentUser.path
- _ = self.canActuallyRead(path: "\(home)/Library/Mail")
- _ = self.canActuallyRead(path: "\(home)/Library/Safari/CloudTabs.db")
+ let probePaths = [
+ "/Library/Application Support/com.apple.TCC/TCC.db",
+ "\(home)/Library/Mail",
+ "\(home)/Library/Safari/CloudTabs.db",
+ "\(home)/Library/Safari/Bookmarks.plist",
+ "\(home)/Library/Messages/chat.db",
+ "\(home)/Library/Application Support/AddressBook",
+ "\(home)/Library/Calendars",
+ "\(home)/Library/Application Support/com.apple.TCC",
+ "\(home)/Library/Application Support/MobileSync",
+ "\(home)/Library/Containers",
+ ]
+ for path in probePaths {
+ _ = self.canActuallyRead(path: path)
+ }
}
}
diff --git a/PureMac/Services/PermissionCoordinator.swift b/PureMac/Services/PermissionCoordinator.swift
new file mode 100644
index 0000000..5d0b8f2
--- /dev/null
+++ b/PureMac/Services/PermissionCoordinator.swift
@@ -0,0 +1,169 @@
+import AppKit
+import Combine
+import Foundation
+
+/// Centralized coordinator for Full Disk Access (FDA) prompts and retry flow.
+///
+/// Replaces the bare "Open System Settings" alert with a sheet-driven flow that:
+/// - Auto-opens the Settings pane and reveals PureMac.app in Finder so users can
+/// drag the bundle into the FDA list when macOS hasn't auto-registered it
+/// (common with Homebrew installs that strip the quarantine attribute).
+/// - Polls `FullDiskAccessManager.hasFullDiskAccess` once per second while the
+/// sheet is on-screen and auto-dismisses + invokes the retry callback the
+/// moment the user toggles permission on.
+/// - Carries the failed-item batch across the prompt so the caller can re-run
+/// the clean without the user having to re-select anything.
+@MainActor
+final class PermissionCoordinator: ObservableObject {
+ static let shared = PermissionCoordinator()
+
+ @Published private(set) var isRequesting: Bool = false
+ @Published private(set) var hasFullDiskAccess: Bool = false
+ @Published private(set) var failedItemPaths: [String] = []
+ @Published private(set) var context: PromptContext = .general
+
+ enum PromptContext {
+ case general
+ case cleanup(failedCount: Int)
+ case uninstall(appName: String, failedCount: Int)
+
+ var headline: String {
+ switch self {
+ case .general:
+ return String(localized: "Grant Full Disk Access")
+ case .cleanup(let n):
+ return String(
+ format: String(localized: "%lld item(s) need Full Disk Access"),
+ Int64(n)
+ )
+ case .uninstall(let app, let n):
+ return String(
+ format: String(localized: "Uninstalling %@: %lld file(s) need Full Disk Access"),
+ app,
+ Int64(n)
+ )
+ }
+ }
+ }
+
+ private var pollTimer: Timer?
+ private var onGrantCallback: (() -> Void)?
+
+ private init() {
+ hasFullDiskAccess = FullDiskAccessManager.shared.hasFullDiskAccess
+ }
+
+ /// Begin the request flow. `onGranted` fires exactly once when permission
+ /// is detected, regardless of whether the sheet was open or already closed.
+ func requestAccess(
+ context: PromptContext = .general,
+ failedPaths: [String] = [],
+ onGranted: @escaping () -> Void
+ ) {
+ self.context = context
+ self.failedItemPaths = failedPaths
+ self.onGrantCallback = onGranted
+ self.hasFullDiskAccess = FullDiskAccessManager.shared.hasFullDiskAccess
+
+ if hasFullDiskAccess {
+ // Already granted. Fire immediately and skip the sheet — useful for
+ // retry-button paths where the user may have granted access in
+ // another window between the original failure and the retry tap.
+ onGranted()
+ onGrantCallback = nil
+ return
+ }
+
+ isRequesting = true
+ startPolling()
+ }
+
+ /// Open System Settings AND reveal PureMac.app in Finder so the user can
+ /// drag the bundle directly into the FDA list. Side-by-side windows are
+ /// the fastest path when macOS hasn't auto-registered the app.
+ func openSettingsAndReveal() {
+ FullDiskAccessManager.shared.openFullDiskAccessSettings()
+ // Delay the reveal slightly so Settings is the frontmost window first.
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.6) {
+ FullDiskAccessManager.shared.revealAppInFinder()
+ }
+ }
+
+ /// Reset PureMac's TCC entry and re-prime registration. Use when the user
+ /// reports PureMac doesn't appear in the FDA list (typical after Homebrew
+ /// reinstall replaces the bundle with a different code signature).
+ func resetAndReprime() {
+ _ = FullDiskAccessManager.shared.resetFullDiskAccess()
+ FullDiskAccessManager.shared.triggerRegistration()
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.8) {
+ FullDiskAccessManager.shared.openFullDiskAccessSettings()
+ }
+ }
+
+ func dismiss(callRetry: Bool = false) {
+ stopPolling()
+ let callback = onGrantCallback
+ onGrantCallback = nil
+ isRequesting = false
+ failedItemPaths = []
+ context = .general
+ if callRetry { callback?() }
+ }
+
+ /// Refresh permission status without armed polling. Cheap to call on
+ /// app-becomes-active.
+ func refreshStatus() {
+ Task.detached(priority: .userInitiated) {
+ let granted = FullDiskAccessManager.shared.hasFullDiskAccess
+ await MainActor.run { [weak self] in
+ self?.hasFullDiskAccess = granted
+ }
+ }
+ }
+
+ // MARK: - Polling
+
+ private func startPolling() {
+ stopPolling()
+ pollTimer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { [weak self] _ in
+ Task { @MainActor [weak self] in
+ guard let self else { return }
+ let granted = FullDiskAccessManager.shared.hasFullDiskAccess
+ if granted && !self.hasFullDiskAccess {
+ self.hasFullDiskAccess = true
+ self.handleGrant()
+ } else {
+ self.hasFullDiskAccess = granted
+ }
+ }
+ }
+ // Run once immediately so a user who granted before opening the sheet
+ // doesn't wait a full poll cycle.
+ Task { @MainActor [weak self] in
+ guard let self else { return }
+ if FullDiskAccessManager.shared.hasFullDiskAccess {
+ self.hasFullDiskAccess = true
+ self.handleGrant()
+ }
+ }
+ }
+
+ private func stopPolling() {
+ pollTimer?.invalidate()
+ pollTimer = nil
+ }
+
+ private func handleGrant() {
+ let callback = onGrantCallback
+ onGrantCallback = nil
+ stopPolling()
+ // Give the success state ~1s on screen so the user sees the
+ // confirmation tick before the sheet snaps closed.
+ DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { [weak self] in
+ self?.isRequesting = false
+ self?.failedItemPaths = []
+ self?.context = .general
+ callback?()
+ }
+ }
+}
diff --git a/PureMac/ViewModels/AppState.swift b/PureMac/ViewModels/AppState.swift
index 3c8e4d2..91ed6f3 100644
--- a/PureMac/ViewModels/AppState.swift
+++ b/PureMac/ViewModels/AppState.swift
@@ -37,6 +37,14 @@ final class AppState: ObservableObject {
@Published var hasFullDiskAccess: Bool = true
@Published var fdaBannerDismissed: Bool = false
@Published var cleanError: String?
+ /// True when the most recent clean error is rooted in a TCC/FDA refusal
+ /// (i.e. items survived even the admin pass). MainWindow uses this to
+ /// route the user into the PermissionSheet instead of the generic alert.
+ @Published var cleanErrorIsFDAFixable: Bool = false
+ /// Items that survived the most recent clean attempt — used to re-run the
+ /// operation after the user grants Full Disk Access without forcing them
+ /// to re-select anything.
+ @Published var pendingPermissionRetryItems: [CleanableItem] = []
// MARK: - App Uninstaller State
@@ -278,6 +286,12 @@ final class AppState: ObservableObject {
}
}
+ /// Public bridge so views (e.g. AppFilesView) can build CleanableItem rows
+ /// from raw URLs when retrying via the PermissionCoordinator.
+ func makeUninstallCleanableItem(for url: URL) -> CleanableItem {
+ cleanableUninstallItem(for: url)
+ }
+
private func cleanableUninstallItem(for url: URL) -> CleanableItem {
let values = try? url.resourceValues(forKeys: [
.totalFileAllocatedSizeKey,
@@ -533,6 +547,74 @@ final class AppState: ObservableObject {
FullDiskAccessManager.shared.openFullDiskAccessSettings()
}
+ /// Request Full Disk Access via the rich PermissionCoordinator sheet and
+ /// retry the supplied items once the user grants permission. Used by both
+ /// the cleanup and app-uninstall flows so they share a single UI surface.
+ func requestFullDiskAccessAndRetry(items: [CleanableItem], context: PermissionCoordinator.PromptContext) {
+ pendingPermissionRetryItems = items
+ PermissionCoordinator.shared.requestAccess(
+ context: context,
+ failedPaths: items.map { $0.path }
+ ) { [weak self] in
+ Task { @MainActor [weak self] in
+ guard let self else { return }
+ let pending = self.pendingPermissionRetryItems
+ self.pendingPermissionRetryItems = []
+ self.cleanError = nil
+ self.cleanErrorIsFDAFixable = false
+ guard !pending.isEmpty else { return }
+ await self.retryCleanItems(pending)
+ }
+ }
+ }
+
+ private func retryCleanItems(_ items: [CleanableItem]) async {
+ scanState = .cleaning(progress: 0)
+ cleanProgress = 0
+
+ var result = await cleaningEngine.cleanItems(items) { [weak self] progress in
+ Task { @MainActor [weak self] in
+ self?.cleanProgress = progress
+ self?.scanState = .cleaning(progress: progress)
+ }
+ }
+ if !result.requiresAdmin.isEmpty {
+ let admin = await cleaningEngine.cleanWithAdminPrivileges(items: result.requiresAdmin)
+ result.cleanedPaths.formUnion(admin.cleanedPaths)
+ result.itemsCleaned += admin.itemsCleaned
+ result.freedSpace += admin.freedSpace
+ result.errors.append(contentsOf: admin.errors)
+ }
+
+ totalFreedSpace = result.freedSpace
+ lastCleanedDate = Date()
+
+ for (cat, catResult) in categoryResults {
+ let remaining = catResult.items.filter { !result.cleanedPaths.contains($0.path) }
+ let cleared = catResult.items.filter { result.cleanedPaths.contains($0.path) }
+ for item in cleared {
+ selectedCleanupItems.remove(item.id)
+ deselectedItems.remove(item.id)
+ }
+ if remaining.isEmpty {
+ categoryResults.removeValue(forKey: cat)
+ } else {
+ categoryResults[cat] = CategoryResult(
+ category: cat,
+ items: remaining,
+ totalSize: remaining.reduce(0) { $0 + $1.size }
+ )
+ }
+ }
+ totalJunkSize = categoryResults.values.reduce(0) { $0 + $1.totalSize }
+
+ scanState = .cleaned
+ loadDiskInfo()
+ try? await Task.sleep(nanoseconds: 3_000_000_000)
+ scanState = .idle
+ totalFreedSpace = 0
+ }
+
// MARK: - Disk Info
func loadDiskInfo() {
@@ -624,6 +706,8 @@ final class AppState: ObservableObject {
totalFreedSpace = result.freedSpace
lastCleanedDate = Date()
+ let survivors = itemsToClean.filter { !result.cleanedPaths.contains($0.path) }
+
for (cat, catResult) in categoryResults {
let remaining = catResult.items.filter { !result.cleanedPaths.contains($0.path) }
let cleared = catResult.items.filter { result.cleanedPaths.contains($0.path) }
@@ -643,9 +727,7 @@ final class AppState: ObservableObject {
}
totalJunkSize = categoryResults.values.reduce(0) { $0 + $1.totalSize }
- if !result.errors.isEmpty {
- cleanError = "\(result.errors.count) item\(result.errors.count == 1 ? "" : "s") couldn't be removed. Check the log for details."
- }
+ handleCleanOutcome(errors: result.errors, survivors: survivors)
scanState = .cleaned
loadDiskInfo()
@@ -703,9 +785,8 @@ final class AppState: ObservableObject {
}
totalJunkSize = categoryResults.values.reduce(0) { $0 + $1.totalSize }
- if !cleanResult.errors.isEmpty {
- cleanError = "\(cleanResult.errors.count) item\(cleanResult.errors.count == 1 ? "" : "s") couldn't be removed. Check the log for details."
- }
+ let survivors = selectedItems.filter { !cleanResult.cleanedPaths.contains($0.path) }
+ handleCleanOutcome(errors: cleanResult.errors, survivors: survivors)
scanState = .cleaned
loadDiskInfo()
@@ -716,6 +797,39 @@ final class AppState: ObservableObject {
}
}
+ /// Inspect a clean batch's leftovers and either route the user into the
+ /// PermissionSheet (FDA is the most likely cause) or surface a richer
+ /// error alert that lists actual paths instead of "Check the log".
+ private func handleCleanOutcome(errors: [String], survivors: [CleanableItem]) {
+ guard !errors.isEmpty || !survivors.isEmpty else {
+ cleanError = nil
+ cleanErrorIsFDAFixable = false
+ pendingPermissionRetryItems = []
+ return
+ }
+
+ let fdaGranted = FullDiskAccessManager.shared.hasFullDiskAccess
+ let likelyFDA = !fdaGranted && !survivors.isEmpty
+ cleanErrorIsFDAFixable = likelyFDA
+ pendingPermissionRetryItems = survivors
+
+ if likelyFDA {
+ cleanError = String(
+ format: String(localized: "%lld item(s) need Full Disk Access to remove. Tap Grant Access to fix in one step."),
+ Int64(survivors.count)
+ )
+ } else if !survivors.isEmpty {
+ let preview = survivors.prefix(2).map { ($0.path as NSString).lastPathComponent }.joined(separator: ", ")
+ let extra = survivors.count > 2 ? String(format: String(localized: " and %lld more"), Int64(survivors.count - 2)) : ""
+ cleanError = String(
+ format: String(localized: "Couldn't remove %@%@. They may be in use or protected by macOS."),
+ preview, extra
+ )
+ } else if let first = errors.first {
+ cleanError = first
+ }
+ }
+
// MARK: - Purgeable
func purgePurgeable() {
diff --git a/PureMac/Views/Apps/AppFilesView.swift b/PureMac/Views/Apps/AppFilesView.swift
index 2e2e884..11bd328 100644
--- a/PureMac/Views/Apps/AppFilesView.swift
+++ b/PureMac/Views/Apps/AppFilesView.swift
@@ -93,8 +93,22 @@ struct AppFilesView: View {
.padding()
}
}
+ .onChange(of: appState.removalNeedsFullDiskAccess) { needs in
+ // FDA-fixable removals jump straight into the rich sheet, the
+ // same flow cleanup uses. The user grants permission once and we
+ // re-fire the original selection — no re-checking files.
+ guard needs else { return }
+ let toRetry = Array(appState.selectedFiles)
+ let items = toRetry.map { appState.makeUninstallCleanableItem(for: $0) }
+ appState.removalError = nil
+ appState.removalNeedsFullDiskAccess = false
+ appState.requestFullDiskAccessAndRetry(
+ items: items,
+ context: .uninstall(appName: app.appName, failedCount: items.count)
+ )
+ }
.alert("Removal Failed", isPresented: Binding(
- get: { appState.removalError != nil },
+ get: { appState.removalError != nil && !appState.removalNeedsFullDiskAccess },
set: {
if !$0 {
appState.removalError = nil
@@ -102,13 +116,6 @@ struct AppFilesView: View {
}
}
)) {
- if appState.removalNeedsFullDiskAccess {
- Button("Open System Settings") {
- FullDiskAccessManager.shared.openFullDiskAccessSettings()
- appState.removalError = nil
- appState.removalNeedsFullDiskAccess = false
- }
- }
Button("OK", role: .cancel) {
appState.removalError = nil
appState.removalNeedsFullDiskAccess = false
diff --git a/PureMac/Views/Components/AppTheme.swift b/PureMac/Views/Components/AppTheme.swift
index c7d8051..eb0b671 100644
--- a/PureMac/Views/Components/AppTheme.swift
+++ b/PureMac/Views/Components/AppTheme.swift
@@ -58,40 +58,175 @@ enum Tint {
}
/// Tinted square icon container used in the sidebar and on dashboard cards.
+/// The optional inner gradient + soft shadow give the tile depth rather than
+/// the previous flat color swatch.
struct IconTile: View {
let systemName: String
var tint: Color = Tint.blue
var size: CGFloat = 26
var corner: CGFloat = 7
+ var glow: Bool = false
var body: some View {
ZStack {
RoundedRectangle(cornerRadius: corner, style: .continuous)
- .fill(tint.opacity(0.16))
+ .fill(
+ LinearGradient(
+ colors: [tint.opacity(0.22), tint.opacity(0.10)],
+ startPoint: .topLeading, endPoint: .bottomTrailing
+ )
+ )
+ RoundedRectangle(cornerRadius: corner, style: .continuous)
+ .strokeBorder(tint.opacity(0.18), lineWidth: 0.5)
Image(systemName: systemName)
.font(.system(size: size * 0.52, weight: .semibold))
.foregroundStyle(tint)
}
.frame(width: size, height: size)
+ .shadow(color: glow ? tint.opacity(0.35) : .clear, radius: glow ? 6 : 0, y: 1)
}
}
-/// Card surface used on the dashboard, suggestion list, and detail pages.
+/// Premium card surface used on the dashboard, suggestion list, and detail
+/// pages. Inner gradient fill + dual-layer shadow (ambient + contact) gives
+/// the cards depth without dropping into heavy material that fights the
+/// system look. Optional accent stripe lights up the leading edge so cards
+/// can carry semantic colour without painting the whole surface.
struct CardSurface<Content: View>: View {
var padding: CGFloat = 16
+ var accent: Color? = nil
+ var elevation: CardElevation = .standard
@ViewBuilder var content: Content
var body: some View {
content
.padding(padding)
.background(
- RoundedRectangle(cornerRadius: 14, style: .continuous)
- .fill(Color(nsColor: .controlBackgroundColor))
+ ZStack {
+ RoundedRectangle(cornerRadius: 14, style: .continuous)
+ .fill(Color(nsColor: .controlBackgroundColor))
+ RoundedRectangle(cornerRadius: 14, style: .continuous)
+ .fill(
+ LinearGradient(
+ colors: [
+ Color.white.opacity(0.04),
+ Color.clear,
+ ],
+ startPoint: .top, endPoint: .bottom
+ )
+ )
+ if let accent {
+ HStack(spacing: 0) {
+ Rectangle()
+ .fill(
+ LinearGradient(
+ colors: [accent.opacity(0.85), accent.opacity(0.35)],
+ startPoint: .top, endPoint: .bottom
+ )
+ )
+ .frame(width: 3)
+ Spacer(minLength: 0)
+ }
+ .clipShape(RoundedRectangle(cornerRadius: 14, style: .continuous))
+ }
+ }
)
.overlay(
RoundedRectangle(cornerRadius: 14, style: .continuous)
- .strokeBorder(Color.primary.opacity(0.06), lineWidth: 0.5)
+ .strokeBorder(Color.primary.opacity(0.07), lineWidth: 0.5)
)
- .shadow(color: .black.opacity(0.06), radius: 6, y: 2)
+ .shadow(color: .black.opacity(elevation.ambient), radius: elevation.ambientRadius, y: elevation.ambientY)
+ .shadow(color: .black.opacity(elevation.contact), radius: 1, y: 0.5)
+ }
+}
+
+enum CardElevation {
+ case flat, standard, raised
+
+ var ambient: Double {
+ switch self {
+ case .flat: return 0.02
+ case .standard: return 0.06
+ case .raised: return 0.10
+ }
+ }
+
+ var ambientRadius: CGFloat {
+ switch self {
+ case .flat: return 2
+ case .standard: return 6
+ case .raised: return 14
+ }
+ }
+
+ var ambientY: CGFloat {
+ switch self {
+ case .flat: return 1
+ case .standard: return 2
+ case .raised: return 6
+ }
+ }
+
+ var contact: Double { 0.05 }
+}
+
+/// Pill-shaped chip used for inline status pills (severity, counts, etc.).
+struct StatusChip: View {
+ let label: String
+ var systemImage: String? = nil
+ var tint: Color = Tint.blue
+
+ var body: some View {
+ HStack(spacing: 4) {
+ if let systemImage {
+ Image(systemName: systemImage)
+ .font(.system(size: 9, weight: .bold))
+ }
+ Text(label)
+ .font(.system(size: 11, weight: .semibold))
+ .monospacedDigit()
+ }
+ .padding(.horizontal, 8)
+ .padding(.vertical, 3)
+ .background(
+ Capsule()
+ .fill(
+ LinearGradient(
+ colors: [tint.opacity(0.22), tint.opacity(0.12)],
+ startPoint: .topLeading, endPoint: .bottomTrailing
+ )
+ )
+ )
+ .overlay(
+ Capsule().strokeBorder(tint.opacity(0.25), lineWidth: 0.5)
+ )
+ .foregroundStyle(tint)
+ }
+}
+
+/// Modifier that bumps an element on hover and shrinks it on press. Cheap way
+/// to give cards and rows a tactile feel without writing per-call animations.
+struct PressableScale: ViewModifier {
+ @State private var hovering = false
+ @State private var pressing = false
+ var hoverScale: CGFloat = 1.012
+
+ func body(content: Content) -> some View {
+ content
+ .scaleEffect(pressing ? 0.985 : (hovering ? hoverScale : 1.0))
+ .animation(.spring(response: 0.22, dampingFraction: 0.75), value: hovering)
+ .animation(.easeOut(duration: 0.08), value: pressing)
+ .onHover { hovering = $0 }
+ .simultaneousGesture(
+ DragGesture(minimumDistance: 0)
+ .onChanged { _ in pressing = true }
+ .onEnded { _ in pressing = false }
+ )
+ }
+}
+
+extension View {
+ func pressable(hoverScale: CGFloat = 1.012) -> some View {
+ modifier(PressableScale(hoverScale: hoverScale))
}
}
diff --git a/PureMac/Views/Components/PermissionSheet.swift b/PureMac/Views/Components/PermissionSheet.swift
new file mode 100644
index 0000000..2885342
--- /dev/null
+++ b/PureMac/Views/Components/PermissionSheet.swift
@@ -0,0 +1,371 @@
+import SwiftUI
+
+/// Premium Full Disk Access prompt that replaces the bare permission-denied
+/// alert. Auto-polls FDA state, auto-retries the failed operation on grant,
+/// and offers escape hatches for the "PureMac isn't in the list" case.
+struct PermissionSheet: View {
+ @ObservedObject private var coordinator = PermissionCoordinator.shared
+ @State private var appeared = false
+ @State private var pulse = false
+ @State private var showAdvanced = false
+
+ var body: some View {
+ VStack(spacing: 0) {
+ header
+ Divider().opacity(0.4)
+ body_
+ Divider().opacity(0.4)
+ footer
+ }
+ .frame(width: 560)
+ .background(
+ ZStack {
+ Color(nsColor: .windowBackgroundColor)
+ LinearGradient(
+ colors: [Tint.blue.opacity(0.06), Tint.purple.opacity(0.04), .clear],
+ startPoint: .topLeading, endPoint: .bottomTrailing
+ )
+ }
+ )
+ .onAppear {
+ withAnimation(.easeOut(duration: 0.5)) { appeared = true }
+ withAnimation(.easeInOut(duration: 1.2).repeatForever(autoreverses: true)) {
+ pulse = true
+ }
+ }
+ }
+
+ // MARK: - Header
+
+ private var header: some View {
+ HStack(spacing: 14) {
+ ZStack {
+ Circle()
+ .fill(
+ LinearGradient(
+ colors: coordinator.hasFullDiskAccess
+ ? [Tint.green, Color(red: 0.10, green: 0.65, blue: 0.40)]
+ : [Tint.blue, Tint.purple],
+ startPoint: .topLeading, endPoint: .bottomTrailing
+ )
+ )
+ .frame(width: 44, height: 44)
+ .shadow(
+ color: (coordinator.hasFullDiskAccess ? Tint.green : Tint.blue)
+ .opacity(pulse ? 0.45 : 0.15),
+ radius: pulse ? 14 : 6
+ )
+ headerIcon
+ }
+
+ VStack(alignment: .leading, spacing: 2) {
+ Text(coordinator.context.headline)
+ .font(.system(size: 16, weight: .bold))
+ Text(coordinator.hasFullDiskAccess
+ ? "Access granted. Retrying…"
+ : "1-tap setup. We'll detect the change automatically.")
+ .font(.system(size: 12))
+ .foregroundStyle(.secondary)
+ }
+
+ Spacer()
+ }
+ .padding(.horizontal, 22)
+ .padding(.vertical, 18)
+ .opacity(appeared ? 1 : 0)
+ .offset(y: appeared ? 0 : -6)
+ }
+
+ @ViewBuilder
+ private var headerIcon: some View {
+ let name = coordinator.hasFullDiskAccess ? "checkmark.shield.fill" : "lock.shield.fill"
+ let base = Image(systemName: name)
+ .font(.system(size: 20, weight: .semibold))
+ .foregroundStyle(.white)
+ if #available(macOS 14.0, *) {
+ base.contentTransition(.symbolEffect(.replace))
+ } else {
+ base
+ }
+ }
+
+ // MARK: - Body
+
+ @ViewBuilder
+ private var body_: some View {
+ if coordinator.hasFullDiskAccess {
+ grantedBody
+ } else {
+ requestBody
+ }
+ }
+
+ private var requestBody: some View {
+ VStack(alignment: .leading, spacing: 18) {
+ // Primary action row
+ Button {
+ coordinator.openSettingsAndReveal()
+ } label: {
+ HStack(spacing: 12) {
+ Image(systemName: "gear.badge")
+ .font(.system(size: 18, weight: .semibold))
+ VStack(alignment: .leading, spacing: 1) {
+ Text("Open Settings & reveal PureMac")
+ .font(.system(size: 13.5, weight: .semibold))
+ Text("We'll open both windows side-by-side.")
+ .font(.system(size: 11))
+ .opacity(0.85)
+ }
+ Spacer()
+ Image(systemName: "arrow.up.right")
+ .font(.system(size: 11, weight: .bold))
+ .opacity(0.7)
+ }
+ .foregroundStyle(.white)
+ .padding(.horizontal, 16)
+ .padding(.vertical, 14)
+ .background(
+ LinearGradient(
+ colors: [Tint.blue, Tint.purple],
+ startPoint: .leading, endPoint: .trailing
+ )
+ )
+ .clipShape(RoundedRectangle(cornerRadius: 12, style: .continuous))
+ .shadow(color: Tint.blue.opacity(0.35), radius: 10, y: 4)
+ }
+ .buttonStyle(.plain)
+ .keyboardShortcut(.defaultAction)
+
+ // Step-by-step strip
+ HStack(spacing: 0) {
+ stepCell(number: 1, title: "Turn on PureMac",
+ caption: "Toggle the row that appears.")
+ stepDivider
+ stepCell(number: 2, title: "Authenticate",
+ caption: "Touch ID or password.")
+ stepDivider
+ stepCell(number: 3, title: "Done",
+ caption: "We auto-retry — no need to come back.")
+ }
+ .padding(.vertical, 4)
+ .background(
+ RoundedRectangle(cornerRadius: 10, style: .continuous)
+ .fill(Color.primary.opacity(0.04))
+ )
+
+ // Listening indicator
+ HStack(spacing: 8) {
+ ZStack {
+ Circle()
+ .stroke(Tint.blue.opacity(0.3), lineWidth: 1.5)
+ .frame(width: 10, height: 10)
+ Circle()
+ .fill(Tint.blue)
+ .frame(width: 6, height: 6)
+ .scaleEffect(pulse ? 1.4 : 0.8)
+ .opacity(pulse ? 0.4 : 1)
+ }
+ Text("Watching for permission change…")
+ .font(.system(size: 11.5))
+ .foregroundStyle(.secondary)
+ Spacer()
+ Button(showAdvanced ? "Hide help" : "PureMac not in the list?") {
+ withAnimation(.easeInOut(duration: 0.25)) { showAdvanced.toggle() }
+ }
+ .buttonStyle(.link)
+ .font(.system(size: 11.5))
+ }
+
+ if showAdvanced {
+ advancedPanel
+ .transition(.opacity.combined(with: .move(edge: .top)))
+ }
+
+ if !coordinator.failedItemPaths.isEmpty {
+ blockedList
+ }
+ }
+ .padding(.horizontal, 22)
+ .padding(.vertical, 18)
+ .opacity(appeared ? 1 : 0)
+ }
+
+ private var advancedPanel: some View {
+ VStack(alignment: .leading, spacing: 10) {
+ Text("Try this if PureMac doesn't appear:")
+ .font(.system(size: 11.5, weight: .semibold))
+ .foregroundStyle(.secondary)
+
+ HStack(spacing: 8) {
+ advancedButton(
+ icon: "folder.badge.gearshape",
+ title: "Reveal app",
+ subtitle: "Drag PureMac.app into the list"
+ ) {
+ FullDiskAccessManager.shared.revealAppInFinder()
+ }
+ advancedButton(
+ icon: "arrow.clockwise.circle",
+ title: "Reset + reprompt",
+ subtitle: "Clear stale TCC entry"
+ ) {
+ coordinator.resetAndReprime()
+ }
+ }
+ }
+ .padding(12)
+ .background(
+ RoundedRectangle(cornerRadius: 10, style: .continuous)
+ .fill(Color.primary.opacity(0.04))
+ )
+ .overlay(
+ RoundedRectangle(cornerRadius: 10, style: .continuous)
+ .strokeBorder(Color.primary.opacity(0.06), lineWidth: 0.5)
+ )
+ }
+
+ private func advancedButton(icon: String, title: LocalizedStringKey,
+ subtitle: LocalizedStringKey,
+ action: @escaping () -> Void) -> some View {
+ Button(action: action) {
+ HStack(spacing: 10) {
+ IconTile(systemName: icon, tint: Tint.orange, size: 30, corner: 7)
+ VStack(alignment: .leading, spacing: 1) {
+ Text(title)
+ .font(.system(size: 12.5, weight: .semibold))
+ .foregroundStyle(.primary)
+ Text(subtitle)
+ .font(.system(size: 10.5))
+ .foregroundStyle(.secondary)
+ }
+ Spacer(minLength: 0)
+ }
+ .padding(.horizontal, 10)
+ .padding(.vertical, 8)
+ .background(
+ RoundedRectangle(cornerRadius: 8, style: .continuous)
+ .fill(Color(nsColor: .controlBackgroundColor))
+ )
+ .overlay(
+ RoundedRectangle(cornerRadius: 8, style: .continuous)
+ .strokeBorder(Color.primary.opacity(0.08), lineWidth: 0.5)
+ )
+ }
+ .buttonStyle(.plain)
+ }
+
+ private var blockedList: some View {
+ DisclosureGroup {
+ VStack(alignment: .leading, spacing: 4) {
+ ForEach(coordinator.failedItemPaths.prefix(6), id: \.self) { path in
+ Text(path)
+ .font(.system(size: 10.5, design: .monospaced))
+ .foregroundStyle(.secondary)
+ .lineLimit(1)
+ .truncationMode(.middle)
+ }
+ if coordinator.failedItemPaths.count > 6 {
+ Text(remainingText(coordinator.failedItemPaths.count - 6))
+ .font(.system(size: 10.5))
+ .foregroundStyle(.tertiary)
+ }
+ }
+ .padding(.top, 4)
+ } label: {
+ Text(blockedHeaderText(coordinator.failedItemPaths.count))
+ .font(.system(size: 11.5, weight: .semibold))
+ .foregroundStyle(.secondary)
+ }
+ }
+
+ private func remainingText(_ count: Int) -> String {
+ String(format: String(localized: "+ %lld more"), Int64(count))
+ }
+
+ private func blockedHeaderText(_ count: Int) -> String {
+ String(
+ format: String(localized: "%lld blocked path(s)"),
+ Int64(count)
+ )
+ }
+
+ private func stepCell(number: Int, title: LocalizedStringKey,
+ caption: LocalizedStringKey) -> some View {
+ HStack(alignment: .top, spacing: 8) {
+ Text("\(number)")
+ .font(.system(size: 11, weight: .bold))
+ .foregroundStyle(.white)
+ .frame(width: 18, height: 18)
+ .background(Circle().fill(Tint.blue))
+ VStack(alignment: .leading, spacing: 1) {
+ Text(title)
+ .font(.system(size: 11.5, weight: .semibold))
+ Text(caption)
+ .font(.system(size: 10))
+ .foregroundStyle(.secondary)
+ .lineLimit(2)
+ }
+ Spacer(minLength: 0)
+ }
+ .padding(.horizontal, 12)
+ .padding(.vertical, 10)
+ .frame(maxWidth: .infinity, alignment: .leading)
+ }
+
+ private var stepDivider: some View {
+ Rectangle()
+ .fill(Color.primary.opacity(0.08))
+ .frame(width: 0.5)
+ .padding(.vertical, 6)
+ }
+
+ private var grantedBody: some View {
+ VStack(spacing: 10) {
+ ZStack {
+ Circle()
+ .fill(Tint.green.opacity(0.15))
+ .frame(width: 72, height: 72)
+ .scaleEffect(pulse ? 1.05 : 0.95)
+ Image(systemName: "checkmark.seal.fill")
+ .font(.system(size: 36, weight: .bold))
+ .foregroundStyle(Tint.green)
+ }
+ Text("Access granted")
+ .font(.system(size: 15, weight: .bold))
+ Text("Retrying the operation now.")
+ .font(.system(size: 11.5))
+ .foregroundStyle(.secondary)
+ }
+ .frame(maxWidth: .infinity)
+ .padding(.vertical, 28)
+ }
+
+ // MARK: - Footer
+
+ private var footer: some View {
+ HStack(spacing: 12) {
+ Button("Skip for now") {
+ coordinator.dismiss(callRetry: false)
+ }
+ .buttonStyle(.link)
+ .foregroundStyle(.secondary)
+
+ Spacer()
+
+ if !coordinator.hasFullDiskAccess {
+ Button("I granted it — retry") {
+ coordinator.refreshStatus()
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
+ if coordinator.hasFullDiskAccess {
+ coordinator.dismiss(callRetry: true)
+ }
+ }
+ }
+ .buttonStyle(.borderedProminent)
+ .controlSize(.regular)
+ }
+ }
+ .padding(.horizontal, 22)
+ .padding(.vertical, 14)
+ }
+}
diff --git a/PureMac/Views/DashboardView.swift b/PureMac/Views/DashboardView.swift
index 5872f98..dd88a9b 100644
--- a/PureMac/Views/DashboardView.swift
+++ b/PureMac/Views/DashboardView.swift
@@ -68,21 +68,40 @@ struct DashboardView: View {
let used = appState.diskInfo.usedSpace
let free = appState.diskInfo.freeSpace
let percentUsed = total > 0 ? Double(used) / Double(total) : 0
+ let stress = percentUsed > 0.85
- return CardSurface(padding: 24) {
+ return CardSurface(padding: 24, accent: stress ? Tint.orange : Tint.blue, elevation: .raised) {
HStack(alignment: .center, spacing: 28) {
StorageGauge(percentUsed: percentUsed)
.frame(width: 180, height: 180)
- VStack(alignment: .leading, spacing: 12) {
- HStack(alignment: .firstTextBaseline) {
- VStack(alignment: .leading, spacing: 2) {
- Text("Storage")
- .font(.system(size: 13, weight: .semibold))
- .foregroundStyle(.secondary)
+ VStack(alignment: .leading, spacing: 14) {
+ HStack(alignment: .top) {
+ VStack(alignment: .leading, spacing: 4) {
+ HStack(spacing: 8) {
+ Text("Storage")
+ .font(.system(size: 13, weight: .semibold))
+ .foregroundStyle(.secondary)
+ .textCase(.uppercase)
+ .tracking(0.6)
+ if stress {
+ StatusChip(label: String(localized: "Low space"),
+ systemImage: "exclamationmark.triangle.fill",
+ tint: Tint.orange)
+ }
+ }
Text(ByteCountFormatter.string(fromByteCount: free, countStyle: .file))
- .font(.system(size: 30, weight: .bold))
+ .font(.system(size: 34, weight: .bold))
.monospacedDigit()
+ .contentTransition(.numericText())
+ .foregroundStyle(
+ LinearGradient(
+ colors: stress
+ ? [Tint.orange, Tint.red]
+ : [Color.primary, Color.primary.opacity(0.85)],
+ startPoint: .top, endPoint: .bottom
+ )
+ )
Text(freeOfText(total: total))
.font(.system(size: 12))
.foregroundStyle(.secondary)
@@ -92,10 +111,11 @@ struct DashboardView: View {
appState.startSmartScan()
} label: {
Label("Smart Scan", systemImage: "sparkles")
- .font(.system(size: 12.5, weight: .semibold))
+ .font(.system(size: 13, weight: .semibold))
+ .padding(.horizontal, 4)
}
- .buttonStyle(.bordered)
- .controlSize(.regular)
+ .buttonStyle(.borderedProminent)
+ .controlSize(.large)
}
storageBreakdown(used: used, total: total)
@@ -259,20 +279,24 @@ struct DashboardView: View {
// MARK: - Scanning state
private var scanningHero: some View {
- CardSurface(padding: 24) {
+ CardSurface(padding: 24, accent: Tint.blue, elevation: .raised) {
HStack(alignment: .center, spacing: 28) {
ScanningGauge(progress: appState.scanProgress)
.frame(width: 180, height: 180)
- VStack(alignment: .leading, spacing: 8) {
- Text("Scanning your Mac")
- .font(.system(size: 22, weight: .bold))
+ VStack(alignment: .leading, spacing: 10) {
+ HStack(spacing: 8) {
+ sparklesIcon
+ Text("Scanning your Mac")
+ .font(.system(size: 22, weight: .bold))
+ }
Text(currentlyInText)
.font(.system(size: 13))
.foregroundStyle(.secondary)
ProgressView(value: appState.scanProgress)
.progressViewStyle(.linear)
+ .tint(Tint.blue)
.frame(maxWidth: 320)
- .padding(.top, 4)
+ .padding(.top, 2)
}
Spacer(minLength: 0)
}
@@ -313,26 +337,35 @@ struct DashboardView: View {
// MARK: - Completed state
private var completedHero: some View {
- CardSurface(padding: 24) {
+ let isClean = appState.totalJunkSize <= 0
+ return CardSurface(padding: 24, accent: isClean ? Tint.green : Tint.orange, elevation: .raised) {
VStack(alignment: .leading, spacing: 14) {
HStack(alignment: .firstTextBaseline) {
- if appState.totalJunkSize > 0 {
+ if !isClean {
Text(ByteCountFormatter.string(fromByteCount: appState.totalJunkSize, countStyle: .file))
- .font(.system(size: 36, weight: .bold))
+ .font(.system(size: 40, weight: .bold))
.monospacedDigit()
+ .contentTransition(.numericText())
+ .foregroundStyle(
+ LinearGradient(colors: [Tint.orange, Tint.red],
+ startPoint: .top, endPoint: .bottom)
+ )
Text("found")
.font(.system(size: 16))
.foregroundStyle(.secondary)
} else {
- Label("Your Mac is clean", systemImage: "checkmark.seal.fill")
- .font(.system(size: 22, weight: .bold))
- .foregroundStyle(Tint.green)
+ HStack(spacing: 10) {
+ cleanSealIcon
+ Text("Your Mac is clean")
+ .font(.system(size: 22, weight: .bold))
+ .foregroundStyle(Tint.green)
+ }
}
Spacer()
Button("Scan Again") { appState.startSmartScan() }
.controlSize(.large)
}
- if appState.totalJunkSize > 0 {
+ if !isClean {
HStack {
if appState.totalSelectedSize > 0 {
Button {
@@ -376,10 +409,50 @@ struct DashboardView: View {
}
}
+ @ViewBuilder
+ private var cleanSealIcon: some View {
+ let base = Image(systemName: "checkmark.seal.fill")
+ .font(.system(size: 26, weight: .bold))
+ .foregroundStyle(Tint.green)
+ if #available(macOS 14.0, *) {
+ base.symbolEffect(.bounce, value: appState.totalJunkSize)
+ } else {
+ base
+ }
+ }
+
+ @ViewBuilder
+ private var bigCheckmark: some View {
+ let base = Image(systemName: "checkmark")
+ .font(.system(size: 60, weight: .bold))
+ .foregroundStyle(Tint.green)
+ .shadow(color: Tint.green.opacity(0.5), radius: 12)
+ if #available(macOS 14.0, *) {
+ base.symbolEffect(.bounce, value: appState.totalFreedSpace)
+ } else {
+ base
+ }
+ }
+
+ @ViewBuilder
+ private var sparklesIcon: some View {
+ let base = Image(systemName: "sparkles")
+ .font(.system(size: 18, weight: .semibold))
+ .foregroundStyle(
+ LinearGradient(colors: [Tint.blue, Tint.purple],
+ startPoint: .topLeading, endPoint: .bottomTrailing)
+ )
+ if #available(macOS 14.0, *) {
+ base.symbolEffect(.variableColor.iterative, options: .repeating)
+ } else {
+ base
+ }
+ }
+
private var cleaningHero: some View {
- CardSurface(padding: 24) {
+ CardSurface(padding: 24, accent: Tint.orange, elevation: .raised) {
HStack(alignment: .center, spacing: 28) {
- ScanningGauge(progress: appState.cleanProgress, tint: Tint.orange)
+ ScanningGauge(progress: appState.cleanProgress, tint: Tint.orange, label: "CLEANING")
.frame(width: 180, height: 180)
VStack(alignment: .leading, spacing: 8) {
Text("Cleaning…")
@@ -398,20 +471,32 @@ struct DashboardView: View {
}
private var cleanedHero: some View {
- CardSurface(padding: 24) {
+ CardSurface(padding: 24, accent: Tint.green, elevation: .raised) {
HStack(alignment: .center, spacing: 28) {
ZStack {
- Circle().fill(Tint.green.opacity(0.18))
- Image(systemName: "checkmark")
- .font(.system(size: 60, weight: .bold))
- .foregroundStyle(Tint.green)
+ Circle()
+ .fill(Tint.green.opacity(0.12))
+ .blur(radius: 20)
+ Circle()
+ .fill(
+ LinearGradient(colors: [Tint.green.opacity(0.30), Tint.green.opacity(0.10)],
+ startPoint: .topLeading, endPoint: .bottomTrailing)
+ )
+ Circle()
+ .strokeBorder(Tint.green.opacity(0.30), lineWidth: 2)
+ bigCheckmark
}
.frame(width: 140, height: 140)
VStack(alignment: .leading, spacing: 6) {
Text(ByteCountFormatter.string(fromByteCount: appState.totalFreedSpace, countStyle: .file))
- .font(.system(size: 36, weight: .bold))
+ .font(.system(size: 40, weight: .bold))
.monospacedDigit()
+ .contentTransition(.numericText())
+ .foregroundStyle(
+ LinearGradient(colors: [Tint.green, Color(red: 0.10, green: 0.65, blue: 0.40)],
+ startPoint: .top, endPoint: .bottom)
+ )
Text("freed")
.font(.system(size: 14))
.foregroundStyle(.secondary)
@@ -444,17 +529,20 @@ private struct StatCard: View {
let delta: String?
var body: some View {
- CardSurface(padding: 14) {
+ CardSurface(padding: 14, accent: tint) {
VStack(alignment: .leading, spacing: 6) {
HStack(spacing: 8) {
- IconTile(systemName: icon, tint: tint, size: 26)
+ IconTile(systemName: icon, tint: tint, size: 28, glow: true)
Text(label)
- .font(.system(size: 12))
+ .font(.system(size: 12, weight: .medium))
.foregroundStyle(.secondary)
+ .textCase(.uppercase)
+ .tracking(0.4)
}
Text(value)
.font(.system(size: 22, weight: .bold))
.monospacedDigit()
+ .contentTransition(.numericText())
.lineLimit(1)
.minimumScaleFactor(0.6)
if let delta {
@@ -464,6 +552,7 @@ private struct StatCard: View {
}
}
}
+ .pressable(hoverScale: 1.018)
}
}
@@ -479,29 +568,27 @@ private struct Suggestion: Identifiable {
private struct SuggestionRow: View {
let suggestion: Suggestion
var body: some View {
- CardSurface(padding: 14) {
+ CardSurface(padding: 14, accent: suggestion.tint) {
HStack(spacing: 14) {
- IconTile(systemName: suggestion.icon, tint: suggestion.tint, size: 36, corner: 10)
+ IconTile(systemName: suggestion.icon, tint: suggestion.tint,
+ size: 38, corner: 10, glow: true)
VStack(alignment: .leading, spacing: 2) {
Text(suggestion.title)
- .font(.system(size: 13.5, weight: .semibold))
+ .font(.system(size: 14, weight: .semibold))
Text(suggestion.subtitle)
.font(.system(size: 12))
.foregroundStyle(.secondary)
}
Spacer()
if let pill = suggestion.pill {
- Text(pill)
- .font(.system(size: 12, weight: .semibold))
- .padding(.horizontal, 10)
- .padding(.vertical, 4)
- .background(
- Capsule().fill(suggestion.tint.opacity(0.15))
- )
- .foregroundStyle(suggestion.tint)
+ StatusChip(label: pill, tint: suggestion.tint)
}
+ Image(systemName: "chevron.right")
+ .font(.system(size: 11, weight: .semibold))
+ .foregroundStyle(.tertiary)
}
}
+ .pressable(hoverScale: 1.01)
}
}
@@ -509,39 +596,66 @@ private struct SuggestionRow: View {
private struct StorageGauge: View {
let percentUsed: Double // 0...1
+ @State private var glow = false
var body: some View {
let pct = max(0, min(1, percentUsed))
let displayPercent = Int(round(pct * 100))
let stress = pct > 0.85
+ let primaryGradient: [Color] = stress
+ ? [Tint.orange, Tint.red]
+ : [Tint.blue, Tint.purple]
+
ZStack {
+ // Soft outer halo to give the ring depth.
+ Circle()
+ .fill(primaryGradient.first!.opacity(glow ? 0.18 : 0.10))
+ .blur(radius: 24)
+ .scaleEffect(0.95)
+
Circle()
- .stroke(Color.primary.opacity(0.10), lineWidth: 14)
+ .stroke(Color.primary.opacity(0.08), lineWidth: 14)
+
Circle()
.trim(from: 0, to: CGFloat(pct))
.stroke(
- AngularGradient(
- colors: stress
- ? [Tint.orange, Tint.red]
- : [Tint.blue, Tint.purple],
- center: .center
- ),
+ AngularGradient(colors: primaryGradient + [primaryGradient.first!], center: .center),
style: StrokeStyle(lineWidth: 14, lineCap: .round)
)
.rotationEffect(.degrees(-90))
- .shadow(color: (stress ? Tint.orange : Tint.blue).opacity(0.35), radius: 8, y: 2)
+ .shadow(color: primaryGradient.first!.opacity(0.45), radius: 10, y: 2)
.animation(.easeOut(duration: 0.8), value: pct)
+
+ // Pulsing dot at the arc tip — adds life without distracting.
+ Circle()
+ .fill(Color.white)
+ .frame(width: 8, height: 8)
+ .overlay(Circle().fill(primaryGradient.last!).frame(width: 4, height: 4))
+ .shadow(color: primaryGradient.last!.opacity(0.6), radius: 4)
+ .offset(y: -80)
+ .rotationEffect(.degrees(360 * pct))
+ .opacity(pct > 0.02 ? 1 : 0)
+ .animation(.easeOut(duration: 0.8), value: pct)
+
VStack(spacing: 2) {
Text("\(displayPercent)%")
- .font(.system(size: 44, weight: .bold))
+ .font(.system(size: 46, weight: .bold))
.monospacedDigit()
.contentTransition(.numericText())
+ .foregroundStyle(
+ LinearGradient(colors: primaryGradient, startPoint: .top, endPoint: .bottom)
+ )
Text("USED")
.font(.system(size: 10, weight: .semibold))
.tracking(0.6)
.foregroundStyle(.secondary)
}
}
+ .onAppear {
+ withAnimation(.easeInOut(duration: 1.8).repeatForever(autoreverses: true)) {
+ glow = true
+ }
+ }
}
}
@@ -568,31 +682,52 @@ private struct LegendDot: View {
private struct ScanningGauge: View {
let progress: Double
var tint: Color = Tint.blue
+ var label: LocalizedStringKey = "SCANNING"
@State private var rotate = false
+ @State private var shimmer = false
var body: some View {
ZStack {
+ // Halo
+ Circle()
+ .fill(tint.opacity(shimmer ? 0.20 : 0.10))
+ .blur(radius: 24)
+ .scaleEffect(0.95)
+
Circle()
- .stroke(Color.primary.opacity(0.10), lineWidth: 14)
+ .stroke(Color.primary.opacity(0.08), lineWidth: 14)
+
+ // Progress arc
Circle()
.trim(from: 0, to: CGFloat(max(0.05, min(0.95, progress))))
.stroke(
- AngularGradient(colors: [tint, Tint.green], center: .center),
+ AngularGradient(colors: [tint, Tint.green, tint], center: .center),
style: StrokeStyle(lineWidth: 14, lineCap: .round)
)
.rotationEffect(.degrees(rotate ? 360 : 0))
+ .shadow(color: tint.opacity(0.45), radius: 10, y: 2)
.animation(.linear(duration: 4).repeatForever(autoreverses: false), value: rotate)
+
VStack(spacing: 2) {
Text("\(Int(progress * 100))%")
- .font(.system(size: 36, weight: .bold))
+ .font(.system(size: 38, weight: .bold))
.monospacedDigit()
- Text("SCANNING")
+ .contentTransition(.numericText())
+ .foregroundStyle(
+ LinearGradient(colors: [tint, Tint.green], startPoint: .top, endPoint: .bottom)
+ )
+ Text(label)
.font(.system(size: 10, weight: .semibold))
.tracking(0.6)
.foregroundStyle(.secondary)
}
}
- .onAppear { rotate = true }
+ .onAppear {
+ rotate = true
+ withAnimation(.easeInOut(duration: 1.4).repeatForever(autoreverses: true)) {
+ shimmer = true
+ }
+ }
}
}
diff --git a/PureMac/Views/MainWindow.swift b/PureMac/Views/MainWindow.swift
index 7511b15..d43f7e2 100644
--- a/PureMac/Views/MainWindow.swift
+++ b/PureMac/Views/MainWindow.swift
@@ -3,6 +3,7 @@ import SwiftUI
struct MainWindow: View {
@EnvironmentObject var appState: AppState
@EnvironmentObject var theme: ThemeManager
+ @ObservedObject private var permission = PermissionCoordinator.shared
@State private var selectedSection: AppSection? = .cleaning(.smartScan)
@State private var columnVisibility: NavigationSplitViewVisibility = .all
@@ -21,19 +22,35 @@ struct MainWindow: View {
}
.onReceive(NotificationCenter.default.publisher(for: NSApplication.didBecomeActiveNotification)) { _ in
appState.checkFullDiskAccess()
+ permission.refreshStatus()
+ }
+ .onChange(of: appState.cleanErrorIsFDAFixable) { isFDAFixable in
+ // Auto-route FDA-fixable clean errors straight into the rich
+ // sheet — skip the generic alert entirely so the user gets
+ // 1-tap remediation instead of "Check the log for details".
+ guard isFDAFixable else { return }
+ let pending = appState.pendingPermissionRetryItems
+ appState.cleanError = nil
+ appState.cleanErrorIsFDAFixable = false
+ appState.requestFullDiskAccessAndRetry(
+ items: pending,
+ context: .cleanup(failedCount: pending.count)
+ )
}
.alert("Couldn't clean everything", isPresented: Binding(
- get: { appState.cleanError != nil },
+ get: { appState.cleanError != nil && !appState.cleanErrorIsFDAFixable },
set: { if !$0 { appState.cleanError = nil } }
)) {
- Button("Open System Settings") {
- FullDiskAccessManager.shared.openFullDiskAccessSettings()
- appState.cleanError = nil
- }
Button("OK", role: .cancel) { appState.cleanError = nil }
} message: {
Text(appState.cleanError ?? "")
}
+ .sheet(isPresented: Binding(
+ get: { permission.isRequesting },
+ set: { if !$0 { permission.dismiss(callRetry: false) } }
+ )) {
+ PermissionSheet()
+ }
}
// MARK: - Sidebar
@@ -82,24 +99,28 @@ struct MainWindow: View {
private func navRow(section: AppSection, label: LocalizedStringKey, icon: String,
tint: Color, badge: String?) -> some View {
- HStack(spacing: 10) {
- IconTile(systemName: icon, tint: tint, size: 24)
+ let isSelected = selectedSection == section
+ return HStack(spacing: 10) {
+ IconTile(systemName: icon, tint: tint, size: 24, glow: isSelected)
Text(label)
- .font(.system(size: 13))
+ .font(.system(size: 13, weight: isSelected ? .semibold : .regular))
Spacer()
if let badge {
Text(badge)
- .font(.system(size: 11, weight: .medium))
+ .font(.system(size: 11, weight: .semibold))
.monospacedDigit()
- .foregroundStyle(.secondary)
+ .foregroundStyle(isSelected ? tint : .secondary)
.padding(.horizontal, 7)
.padding(.vertical, 2)
.background(
- Capsule().fill(Color.primary.opacity(0.06))
+ Capsule().fill(
+ (isSelected ? tint : Color.primary).opacity(isSelected ? 0.15 : 0.06)
+ )
)
}
}
- .padding(.vertical, 1)
+ .padding(.vertical, 2)
+ .contentShape(Rectangle())
.tag(section)
}
@@ -115,23 +136,41 @@ struct MainWindow: View {
}
private var healthFooter: some View {
- HStack(spacing: 10) {
- Circle()
- .fill(appState.hasFullDiskAccess ? Tint.green : Tint.orange)
- .frame(width: 8, height: 8)
- .background(
- Circle()
- .fill((appState.hasFullDiskAccess ? Tint.green : Tint.orange).opacity(0.25))
- .frame(width: 18, height: 18)
- )
+ let ok = appState.hasFullDiskAccess
+ let tint = ok ? Tint.green : Tint.orange
+ return HStack(spacing: 10) {
+ PulsingDot(tint: tint, isPulsing: !ok)
+
VStack(alignment: .leading, spacing: 1) {
- Text(LocalizedStringKey(appState.hasFullDiskAccess ? "Ready to clean" : "Limited access"))
+ Text(LocalizedStringKey(ok ? "Ready to clean" : "Limited access"))
.font(.system(size: 12, weight: .semibold))
- Text(LocalizedStringKey(appState.hasFullDiskAccess ? "Full Disk Access granted" : "Grant FDA in Settings"))
+ Text(LocalizedStringKey(ok ? "Full Disk Access granted" : "Grant FDA in Settings"))
.font(.system(size: 10.5))
.foregroundStyle(.secondary)
}
Spacer()
+ if !ok {
+ Button {
+ permission.requestAccess(context: .general) {
+ appState.checkFullDiskAccess()
+ }
+ } label: {
+ Image(systemName: "wrench.and.screwdriver.fill")
+ .font(.system(size: 11, weight: .semibold))
+ .foregroundStyle(.white)
+ .padding(.horizontal, 9)
+ .padding(.vertical, 5)
+ .background(
+ Capsule().fill(
+ LinearGradient(colors: [Tint.orange, Color(red: 1, green: 0.42, blue: 0.0)],
+ startPoint: .topLeading, endPoint: .bottomTrailing)
+ )
+ )
+ .shadow(color: Tint.orange.opacity(0.45), radius: 5, y: 2)
+ }
+ .buttonStyle(.plain)
+ .help("Fix permission")
+ }
}
.padding(.horizontal, 14)
.padding(.vertical, 10)
@@ -182,36 +221,47 @@ struct MainWindow: View {
}
}
- // Card-shaped FDA toast that matches the dashboard surface aesthetic
- // rather than the flat orange bar.
+ @ViewBuilder
+ private var pulsingLockIcon: some View {
+ pulsingLockIconView()
+ }
+
+ // Premium FDA toast — gradient backdrop, glow, primary action plus a
+ // subtle dismiss. Visually distinct enough that users actually notice
+ // and act on it without it screaming.
private var fdaToast: some View {
HStack(spacing: 14) {
ZStack {
- RoundedRectangle(cornerRadius: 9, style: .continuous)
- .fill(Color.white.opacity(0.18))
- Image(systemName: "exclamationmark.shield.fill")
- .font(.system(size: 16, weight: .semibold))
- .foregroundStyle(.white)
+ RoundedRectangle(cornerRadius: 10, style: .continuous)
+ .fill(Color.white.opacity(0.22))
+ pulsingLockIcon
}
- .frame(width: 34, height: 34)
+ .frame(width: 40, height: 40)
VStack(alignment: .leading, spacing: 2) {
Text("Full Disk Access required")
- .font(.system(size: 13.5, weight: .bold))
+ .font(.system(size: 14, weight: .bold))
.foregroundStyle(.white)
- Text("macOS blocks PureMac from cleaning caches and uninstalling apps until you grant access.")
+ Text("1-tap setup. We'll auto-retry what failed.")
.font(.system(size: 11.5))
.foregroundStyle(.white.opacity(0.92))
}
Spacer()
- Button("Grant Access") {
- FullDiskAccessManager.shared.openFullDiskAccessSettings()
+ Button {
+ permission.requestAccess(context: .general) {
+ appState.checkFullDiskAccess()
+ }
+ } label: {
+ Label("Quick Setup", systemImage: "sparkles")
+ .font(.system(size: 12.5, weight: .semibold))
+ .padding(.horizontal, 6)
}
.buttonStyle(.borderedProminent)
.tint(.white)
.foregroundStyle(Tint.orange)
+ .controlSize(.large)
Button {
appState.fdaBannerDismissed = true
@@ -219,18 +269,71 @@ struct MainWindow: View {
Image(systemName: "xmark")
.font(.system(size: 11, weight: .bold))
.foregroundStyle(.white.opacity(0.85))
- .padding(6)
+ .padding(8)
+ .background(Circle().fill(Color.white.opacity(0.10)))
}
.buttonStyle(.plain)
+ .help("Dismiss")
}
- .padding(14)
+ .padding(.horizontal, 16)
+ .padding(.vertical, 12)
.background(
- RoundedRectangle(cornerRadius: 14, style: .continuous)
- .fill(
- LinearGradient(colors: [Tint.orange, Color(red: 1.0, green: 0.42, blue: 0.0)],
- startPoint: .topLeading, endPoint: .bottomTrailing)
- )
+ ZStack {
+ RoundedRectangle(cornerRadius: 14, style: .continuous)
+ .fill(
+ LinearGradient(colors: [Tint.orange, Color(red: 1.0, green: 0.42, blue: 0.0)],
+ startPoint: .topLeading, endPoint: .bottomTrailing)
+ )
+ RoundedRectangle(cornerRadius: 14, style: .continuous)
+ .strokeBorder(Color.white.opacity(0.18), lineWidth: 0.5)
+ }
)
- .shadow(color: Tint.orange.opacity(0.35), radius: 12, y: 4)
+ .shadow(color: Tint.orange.opacity(0.45), radius: 14, y: 6)
+ }
+}
+
+@ViewBuilder
+private func pulsingLockIconView() -> some View {
+ let base = Image(systemName: "lock.shield.fill")
+ .font(.system(size: 18, weight: .semibold))
+ .foregroundStyle(.white)
+ if #available(macOS 14.0, *) {
+ base.symbolEffect(.pulse.byLayer, options: .repeating)
+ } else {
+ base
+ }
+}
+
+/// Small reusable status dot with optional pulse. Used in the sidebar health
+/// footer and other "system status" surfaces.
+private struct PulsingDot: View {
+ let tint: Color
+ var isPulsing: Bool = false
+ @State private var pulse = false
+
+ var body: some View {
+ ZStack {
+ if isPulsing {
+ Circle()
+ .stroke(tint.opacity(pulse ? 0.0 : 0.6), lineWidth: 2)
+ .frame(width: 18, height: 18)
+ .scaleEffect(pulse ? 1.6 : 0.8)
+ } else {
+ Circle()
+ .fill(tint.opacity(0.20))
+ .frame(width: 16, height: 16)
+ }
+ Circle()
+ .fill(tint)
+ .frame(width: 8, height: 8)
+ .shadow(color: tint.opacity(0.6), radius: 3)
+ }
+ .frame(width: 18, height: 18)
+ .onAppear {
+ guard isPulsing else { return }
+ withAnimation(.easeOut(duration: 1.4).repeatForever(autoreverses: false)) {
+ pulse = true
+ }
+ }
}
}
diff --git a/PureMac/ar.lproj/Localizable.strings b/PureMac/ar.lproj/Localizable.strings
index 9f887a5..4196c0e 100644
--- a/PureMac/ar.lproj/Localizable.strings
+++ b/PureMac/ar.lproj/Localizable.strings
@@ -262,3 +262,42 @@
/* Notifications */
"Found %@ of junk files." = "تم العثور على %@ من الملفات غير المرغوبة.";
+
+/* Permission Sheet */
+"Grant Full Disk Access" = "منح الوصول الكامل إلى القرص";
+"%lld item(s) need Full Disk Access" = "%lld عنصر يحتاج إلى الوصول الكامل إلى القرص";
+"Uninstalling %@: %lld file(s) need Full Disk Access" = "إلغاء تثبيت %@: %lld ملف يحتاج إلى الوصول الكامل إلى القرص";
+"%lld item(s) need Full Disk Access to remove. Tap Grant Access to fix in one step." = "%lld عنصر يحتاج إلى الوصول الكامل لحذفه. اضغط منح الوصول لإصلاحه بخطوة واحدة.";
+"Couldn't remove %@%@. They may be in use or protected by macOS." = "تعذّر حذف %@%@. قد تكون قيد الاستخدام أو محمية بواسطة macOS.";
+" and %lld more" = " و%lld أخرى";
+"Access granted. Retrying…" = "تم منح الوصول. جارٍ إعادة المحاولة…";
+"1-tap setup. We'll detect the change automatically." = "إعداد بضغطة واحدة. سنكتشف التغيير تلقائيًا.";
+"Open Settings & reveal PureMac" = "فتح الإعدادات وإظهار PureMac";
+"We'll open both windows side-by-side." = "سنفتح النافذتين جنبًا إلى جنب.";
+"Turn on PureMac" = "تفعيل PureMac";
+"Toggle the row that appears." = "بدّل الصف الذي يظهر.";
+"Authenticate" = "المصادقة";
+"Touch ID or password." = "Touch ID أو كلمة المرور.";
+"We auto-retry — no need to come back." = "سنعيد المحاولة تلقائيًا - لا حاجة للعودة.";
+"Watching for permission change…" = "ننتظر تغيير الإذن…";
+"PureMac not in the list?" = "PureMac غير موجود في القائمة؟";
+"Hide help" = "إخفاء التعليمات";
+"Try this if PureMac doesn't appear:" = "جرّب هذا إن لم يظهر PureMac:";
+"Reveal app" = "إظهار التطبيق";
+"Drag PureMac.app into the list" = "اسحب PureMac.app إلى القائمة";
+"Reset + reprompt" = "إعادة تعيين + إعادة المطالبة";
+"Clear stale TCC entry" = "حذف إدخال TCC القديم";
+"+ %lld more" = "+ %lld أخرى";
+"%lld blocked path(s)" = "%lld مسار محظور";
+"Access granted" = "تم منح الوصول";
+"Retrying the operation now." = "جارٍ إعادة العملية الآن.";
+"Skip for now" = "تخطي الآن";
+"I granted it — retry" = "لقد منحت الإذن - أعد المحاولة";
+
+/* Dashboard polish */
+"Low space" = "مساحة منخفضة";
+"CLEANING" = "جارٍ التنظيف";
+"Quick Setup" = "إعداد سريع";
+"1-tap setup. We'll auto-retry what failed." = "إعداد بضغطة واحدة. سنعيد المحاولة تلقائيًا.";
+"Fix permission" = "إصلاح الإذن";
+"Dismiss" = "تجاهل";
diff --git a/PureMac/en.lproj/Localizable.strings b/PureMac/en.lproj/Localizable.strings
index 6c0e9a7..a870a16 100644
--- a/PureMac/en.lproj/Localizable.strings
+++ b/PureMac/en.lproj/Localizable.strings
@@ -20,6 +20,45 @@
"macOS blocks PureMac from cleaning caches and uninstalling apps until you grant access." = "macOS blocks PureMac from cleaning caches and uninstalling apps until you grant access.";
"Grant Access" = "Grant Access";
+/* Permission Sheet */
+"Grant Full Disk Access" = "Grant Full Disk Access";
+"%lld item(s) need Full Disk Access" = "%lld item(s) need Full Disk Access";
+"Uninstalling %@: %lld file(s) need Full Disk Access" = "Uninstalling %@: %lld file(s) need Full Disk Access";
+"%lld item(s) need Full Disk Access to remove. Tap Grant Access to fix in one step." = "%lld item(s) need Full Disk Access to remove. Tap Grant Access to fix in one step.";
+"Couldn't remove %@%@. They may be in use or protected by macOS." = "Couldn't remove %@%@. They may be in use or protected by macOS.";
+" and %lld more" = " and %lld more";
+"Access granted. Retrying…" = "Access granted. Retrying…";
+"1-tap setup. We'll detect the change automatically." = "1-tap setup. We'll detect the change automatically.";
+"Open Settings & reveal PureMac" = "Open Settings & reveal PureMac";
+"We'll open both windows side-by-side." = "We'll open both windows side-by-side.";
+"Turn on PureMac" = "Turn on PureMac";
+"Toggle the row that appears." = "Toggle the row that appears.";
+"Authenticate" = "Authenticate";
+"Touch ID or password." = "Touch ID or password.";
+"We auto-retry — no need to come back." = "We auto-retry — no need to come back.";
+"Watching for permission change…" = "Watching for permission change…";
+"PureMac not in the list?" = "PureMac not in the list?";
+"Hide help" = "Hide help";
+"Try this if PureMac doesn't appear:" = "Try this if PureMac doesn't appear:";
+"Reveal app" = "Reveal app";
+"Drag PureMac.app into the list" = "Drag PureMac.app into the list";
+"Reset + reprompt" = "Reset + reprompt";
+"Clear stale TCC entry" = "Clear stale TCC entry";
+"+ %lld more" = "+ %lld more";
+"%lld blocked path(s)" = "%lld blocked path(s)";
+"Access granted" = "Access granted";
+"Retrying the operation now." = "Retrying the operation now.";
+"Skip for now" = "Skip for now";
+"I granted it — retry" = "I granted it — retry";
+
+/* Dashboard polish */
+"Low space" = "Low space";
+"CLEANING" = "CLEANING";
+"Quick Setup" = "Quick Setup";
+"1-tap setup. We'll auto-retry what failed." = "1-tap setup. We'll auto-retry what failed.";
+"Fix permission" = "Fix permission";
+"Dismiss" = "Dismiss";
+
/* Dashboard */
"Storage" = "Storage";
"Smart Scan" = "Smart Scan";
diff --git a/PureMac/es.lproj/Localizable.strings b/PureMac/es.lproj/Localizable.strings
index 3ae5f3f..e091c0d 100644
--- a/PureMac/es.lproj/Localizable.strings
+++ b/PureMac/es.lproj/Localizable.strings
@@ -262,3 +262,42 @@
/* Notifications */
"Found %@ of junk files." = "Se encontraron %@ de archivos basura.";
+
+/* Permission Sheet */
+"Grant Full Disk Access" = "Conceder acceso a todo el disco";
+"%lld item(s) need Full Disk Access" = "%lld elemento(s) necesitan acceso a todo el disco";
+"Uninstalling %@: %lld file(s) need Full Disk Access" = "Desinstalando %@: %lld archivo(s) necesitan acceso a todo el disco";
+"%lld item(s) need Full Disk Access to remove. Tap Grant Access to fix in one step." = "%lld elemento(s) requieren acceso a todo el disco. Toca Conceder acceso para resolverlo en un paso.";
+"Couldn't remove %@%@. They may be in use or protected by macOS." = "No se pudo eliminar %@%@. Pueden estar en uso o protegidos por macOS.";
+" and %lld more" = " y %lld más";
+"Access granted. Retrying…" = "Acceso concedido. Reintentando…";
+"1-tap setup. We'll detect the change automatically." = "Configuración en un toque. Detectaremos el cambio automáticamente.";
+"Open Settings & reveal PureMac" = "Abrir Ajustes y mostrar PureMac";
+"We'll open both windows side-by-side." = "Abriremos ambas ventanas lado a lado.";
+"Turn on PureMac" = "Activar PureMac";
+"Toggle the row that appears." = "Activa la fila que aparezca.";
+"Authenticate" = "Autenticar";
+"Touch ID or password." = "Touch ID o contraseña.";
+"We auto-retry — no need to come back." = "Reintentamos automáticamente, no necesitas volver.";
+"Watching for permission change…" = "Esperando el cambio de permiso…";
+"PureMac not in the list?" = "¿PureMac no aparece en la lista?";
+"Hide help" = "Ocultar ayuda";
+"Try this if PureMac doesn't appear:" = "Prueba esto si PureMac no aparece:";
+"Reveal app" = "Mostrar app";
+"Drag PureMac.app into the list" = "Arrastra PureMac.app a la lista";
+"Reset + reprompt" = "Restablecer y volver a pedir";
+"Clear stale TCC entry" = "Borrar entrada antigua de TCC";
+"+ %lld more" = "+ %lld más";
+"%lld blocked path(s)" = "%lld ruta(s) bloqueada(s)";
+"Access granted" = "Acceso concedido";
+"Retrying the operation now." = "Reintentando la operación ahora.";
+"Skip for now" = "Omitir por ahora";
+"I granted it — retry" = "Ya lo concedí - reintentar";
+
+/* Dashboard polish */
+"Low space" = "Poco espacio";
+"CLEANING" = "LIMPIANDO";
+"Quick Setup" = "Configuración rápida";
+"1-tap setup. We'll auto-retry what failed." = "Configuración en un toque. Reintentaremos automáticamente lo que falle.";
+"Fix permission" = "Arreglar permiso";
+"Dismiss" = "Descartar";
diff --git a/PureMac/ja.lproj/Localizable.strings b/PureMac/ja.lproj/Localizable.strings
index 5ba9b85..8a517cd 100644
--- a/PureMac/ja.lproj/Localizable.strings
+++ b/PureMac/ja.lproj/Localizable.strings
@@ -262,3 +262,42 @@
/* Notifications */
"Found %@ of junk files." = "%@ のジャンクファイルが見つかりました。";
+
+/* Permission Sheet */
+"Grant Full Disk Access" = "フルディスクアクセスを付与";
+"%lld item(s) need Full Disk Access" = "%lld 件にフルディスクアクセスが必要です";
+"Uninstalling %@: %lld file(s) need Full Disk Access" = "%@ のアンインストール: %lld 個のファイルにフルディスクアクセスが必要です";
+"%lld item(s) need Full Disk Access to remove. Tap Grant Access to fix in one step." = "%lld 件の削除にはフルディスクアクセスが必要です。「アクセスを許可」をタップすると一手で解決します。";
+"Couldn't remove %@%@. They may be in use or protected by macOS." = "%@%@ を削除できませんでした。使用中か macOS によって保護されている可能性があります。";
+" and %lld more" = " 他 %lld 件";
+"Access granted. Retrying…" = "アクセスが許可されました。再試行中…";
+"1-tap setup. We'll detect the change automatically." = "ワンタップ設定。変更は自動的に検出されます。";
+"Open Settings & reveal PureMac" = "設定を開き PureMac を表示";
+"We'll open both windows side-by-side." = "両方のウインドウを並べて開きます。";
+"Turn on PureMac" = "PureMac をオンにする";
+"Toggle the row that appears." = "表示された行をオンに切り替えてください。";
+"Authenticate" = "認証";
+"Touch ID or password." = "Touch ID またはパスワード。";
+"We auto-retry — no need to come back." = "自動的に再試行します - 戻る必要はありません。";
+"Watching for permission change…" = "権限の変更を待機中…";
+"PureMac not in the list?" = "PureMac がリストに表示されない?";
+"Hide help" = "ヘルプを隠す";
+"Try this if PureMac doesn't appear:" = "PureMac が表示されない場合はこれを試してください:";
+"Reveal app" = "アプリを表示";
+"Drag PureMac.app into the list" = "PureMac.app をリストにドラッグ";
+"Reset + reprompt" = "リセットして再表示";
+"Clear stale TCC entry" = "古い TCC エントリを削除";
+"+ %lld more" = "+ %lld 件";
+"%lld blocked path(s)" = "%lld 件のブロックされたパス";
+"Access granted" = "アクセス許可済み";
+"Retrying the operation now." = "操作を再試行しています。";
+"Skip for now" = "今はスキップ";
+"I granted it — retry" = "許可したので再試行";
+
+/* Dashboard polish */
+"Low space" = "空き容量不足";
+"CLEANING" = "クリーニング中";
+"Quick Setup" = "クイックセットアップ";
+"1-tap setup. We'll auto-retry what failed." = "ワンタップ設定。失敗した処理は自動的に再試行します。";
+"Fix permission" = "権限を修正";
+"Dismiss" = "閉じる";
diff --git a/PureMac/pt-BR.lproj/Localizable.strings b/PureMac/pt-BR.lproj/Localizable.strings
index dd4ee0f..6f68e16 100644
--- a/PureMac/pt-BR.lproj/Localizable.strings
+++ b/PureMac/pt-BR.lproj/Localizable.strings
@@ -262,3 +262,42 @@
/* Notifications */
"Found %@ of junk files." = "Foram encontrados %@ de arquivos de lixo.";
+
+/* Permission Sheet */
+"Grant Full Disk Access" = "Conceder acesso total ao disco";
+"%lld item(s) need Full Disk Access" = "%lld item(ns) precisam de acesso total ao disco";
+"Uninstalling %@: %lld file(s) need Full Disk Access" = "Desinstalando %@: %lld arquivo(s) precisam de acesso total ao disco";
+"%lld item(s) need Full Disk Access to remove. Tap Grant Access to fix in one step." = "%lld item(ns) precisam de acesso total ao disco para serem removidos. Toque em Conceder Acesso para resolver em um passo.";
+"Couldn't remove %@%@. They may be in use or protected by macOS." = "Não foi possível remover %@%@. Podem estar em uso ou protegidos pelo macOS.";
+" and %lld more" = " e mais %lld";
+"Access granted. Retrying…" = "Acesso concedido. Tentando novamente…";
+"1-tap setup. We'll detect the change automatically." = "Configuração em 1 toque. Detectaremos a mudança automaticamente.";
+"Open Settings & reveal PureMac" = "Abrir Ajustes e mostrar PureMac";
+"We'll open both windows side-by-side." = "Abriremos as duas janelas lado a lado.";
+"Turn on PureMac" = "Ativar PureMac";
+"Toggle the row that appears." = "Ative a linha que aparecer.";
+"Authenticate" = "Autenticar";
+"Touch ID or password." = "Touch ID ou senha.";
+"We auto-retry — no need to come back." = "Tentamos de novo automaticamente - você não precisa voltar.";
+"Watching for permission change…" = "Aguardando alteração de permissão…";
+"PureMac not in the list?" = "PureMac não aparece na lista?";
+"Hide help" = "Ocultar ajuda";
+"Try this if PureMac doesn't appear:" = "Tente isto se o PureMac não aparecer:";
+"Reveal app" = "Mostrar app";
+"Drag PureMac.app into the list" = "Arraste PureMac.app para a lista";
+"Reset + reprompt" = "Redefinir e pedir de novo";
+"Clear stale TCC entry" = "Limpar entrada TCC desatualizada";
+"+ %lld more" = "+ %lld mais";
+"%lld blocked path(s)" = "%lld caminho(s) bloqueado(s)";
+"Access granted" = "Acesso concedido";
+"Retrying the operation now." = "Tentando a operação novamente.";
+"Skip for now" = "Pular por ora";
+"I granted it — retry" = "Já concedi - tentar de novo";
+
+/* Dashboard polish */
+"Low space" = "Pouco espaço";
+"CLEANING" = "LIMPANDO";
+"Quick Setup" = "Configuração rápida";
+"1-tap setup. We'll auto-retry what failed." = "Configuração em 1 toque. Tentaremos de novo o que falhar.";
+"Fix permission" = "Corrigir permissão";
+"Dismiss" = "Dispensar";
diff --git a/PureMac/zh-Hans.lproj/Localizable.strings b/PureMac/zh-Hans.lproj/Localizable.strings
index 0700864..6e2644f 100644
--- a/PureMac/zh-Hans.lproj/Localizable.strings
+++ b/PureMac/zh-Hans.lproj/Localizable.strings
@@ -262,3 +262,42 @@
/* Notifications */
"Found %@ of junk files." = "发现 %@ 的垃圾文件。";
+
+/* Permission Sheet */
+"Grant Full Disk Access" = "授予完全磁盘访问权限";
+"%lld item(s) need Full Disk Access" = "%lld 个项目需要完全磁盘访问权限";
+"Uninstalling %@: %lld file(s) need Full Disk Access" = "卸载 %@:%lld 个文件需要完全磁盘访问权限";
+"%lld item(s) need Full Disk Access to remove. Tap Grant Access to fix in one step." = "%lld 个项目需要完全磁盘访问权限才能删除。轻点「授予访问权限」一步解决。";
+"Couldn't remove %@%@. They may be in use or protected by macOS." = "无法删除 %@%@。它们可能正在使用或受 macOS 保护。";
+" and %lld more" = " 还有 %lld 个";
+"Access granted. Retrying…" = "已授予访问权限。正在重试…";
+"1-tap setup. We'll detect the change automatically." = "一键设置。我们将自动检测更改。";
+"Open Settings & reveal PureMac" = "打开“设置”并显示 PureMac";
+"We'll open both windows side-by-side." = "我们会并排打开两个窗口。";
+"Turn on PureMac" = "开启 PureMac";
+"Toggle the row that appears." = "打开出现的那一行。";
+"Authenticate" = "验证身份";
+"Touch ID or password." = "Touch ID 或密码。";
+"We auto-retry — no need to come back." = "我们会自动重试 - 无需返回。";
+"Watching for permission change…" = "正在监视权限变更…";
+"PureMac not in the list?" = "PureMac 不在列表中?";
+"Hide help" = "隐藏帮助";
+"Try this if PureMac doesn't appear:" = "如果 PureMac 没有出现,请尝试:";
+"Reveal app" = "显示 App";
+"Drag PureMac.app into the list" = "将 PureMac.app 拖入列表";
+"Reset + reprompt" = "重置并重新提示";
+"Clear stale TCC entry" = "清除过时的 TCC 条目";
+"+ %lld more" = "+ 还有 %lld 个";
+"%lld blocked path(s)" = "%lld 个被阻止的路径";
+"Access granted" = "已授予访问权限";
+"Retrying the operation now." = "正在重试此操作。";
+"Skip for now" = "暂时跳过";
+"I granted it — retry" = "我已授予 - 重试";
+
+/* Dashboard polish */
+"Low space" = "空间不足";
+"CLEANING" = "正在清理";
+"Quick Setup" = "快速设置";
+"1-tap setup. We'll auto-retry what failed." = "一键设置。我们会自动重试失败的操作。";
+"Fix permission" = "修复权限";
+"Dismiss" = "忽略";
diff --git a/PureMac/zh-Hant.lproj/Localizable.strings b/PureMac/zh-Hant.lproj/Localizable.strings
index ed60aa0..53c8b78 100644
--- a/PureMac/zh-Hant.lproj/Localizable.strings
+++ b/PureMac/zh-Hant.lproj/Localizable.strings
@@ -262,3 +262,42 @@
/* Notifications */
"Found %@ of junk files." = "找到 %@ 的垃圾檔案。";
+
+/* Permission Sheet */
+"Grant Full Disk Access" = "授予完整磁碟存取權限";
+"%lld item(s) need Full Disk Access" = "%lld 個項目需要完整磁碟存取權限";
+"Uninstalling %@: %lld file(s) need Full Disk Access" = "解除安裝 %@:%lld 個檔案需要完整磁碟存取權限";
+"%lld item(s) need Full Disk Access to remove. Tap Grant Access to fix in one step." = "%lld 個項目需要完整磁碟存取權限才能移除。輕點「授予存取權限」一步解決。";
+"Couldn't remove %@%@. They may be in use or protected by macOS." = "無法移除 %@%@。它們可能正在使用或受 macOS 保護。";
+" and %lld more" = " 還有 %lld 個";
+"Access granted. Retrying…" = "已授予存取權限。正在重試…";
+"1-tap setup. We'll detect the change automatically." = "一鍵設定。我們會自動偵測變更。";
+"Open Settings & reveal PureMac" = "開啟「系統設定」並顯示 PureMac";
+"We'll open both windows side-by-side." = "我們會並排開啟兩個視窗。";
+"Turn on PureMac" = "開啟 PureMac";
+"Toggle the row that appears." = "打開出現的那一列。";
+"Authenticate" = "驗證身分";
+"Touch ID or password." = "Touch ID 或密碼。";
+"We auto-retry — no need to come back." = "我們會自動重試 - 不需返回。";
+"Watching for permission change…" = "正在等待權限變更…";
+"PureMac not in the list?" = "PureMac 不在清單裡?";
+"Hide help" = "隱藏說明";
+"Try this if PureMac doesn't appear:" = "如果 PureMac 沒有出現,請嘗試:";
+"Reveal app" = "顯示 App";
+"Drag PureMac.app into the list" = "將 PureMac.app 拖到清單";
+"Reset + reprompt" = "重設並重新提示";
+"Clear stale TCC entry" = "清除過時的 TCC 條目";
+"+ %lld more" = "+ 還有 %lld 個";
+"%lld blocked path(s)" = "%lld 個被封鎖的路徑";
+"Access granted" = "已授予存取權限";
+"Retrying the operation now." = "正在重試此操作。";
+"Skip for now" = "暫時略過";
+"I granted it — retry" = "我已授予 - 重試";
+
+/* Dashboard polish */
+"Low space" = "空間不足";
+"CLEANING" = "正在清理";
+"Quick Setup" = "快速設定";
+"1-tap setup. We'll auto-retry what failed." = "一鍵設定。我們會自動重試失敗的操作。";
+"Fix permission" = "修正權限";
+"Dismiss" = "略過";
diff --git a/project.yml b/project.yml
index 7d6d391..f7db3be 100644
--- a/project.yml
+++ b/project.yml
@@ -23,8 +23,8 @@ settings:
CODE_SIGN_ENTITLEMENTS: "PureMac/PureMac.entitlements"
INFOPLIST_FILE: "PureMac/Info.plist"
PRODUCT_BUNDLE_IDENTIFIER: "com.puremac.app"
- MARKETING_VERSION: "2.3.0"
- CURRENT_PROJECT_VERSION: "7"
+ MARKETING_VERSION: "2.4.0"
+ CURRENT_PROJECT_VERSION: "8"
GENERATE_INFOPLIST_FILE: "NO"
ASSETCATALOG_COMPILER_APPICON_NAME: "AppIcon"
COMBINE_HIDPI_IMAGES: "YES"