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: cleanup-completion confetti + permission-flow final hardening + bump to 2.6.1 (build 13)

moamenf5f6ecda56ba
diff --git a/PureMac.xcodeproj/project.pbxproj b/PureMac.xcodeproj/project.pbxproj
index 04b10f7..c82ca72 100644
--- a/PureMac.xcodeproj/project.pbxproj
+++ b/PureMac.xcodeproj/project.pbxproj
@@ -533,7 +533,7 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 12;
+ CURRENT_PROJECT_VERSION = 13;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = H3WXHVTP97;
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -555,7 +555,7 @@
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = PureMac/Info.plist;
MACOSX_DEPLOYMENT_TARGET = 13.0;
- MARKETING_VERSION = 2.6.0;
+ MARKETING_VERSION = 2.6.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = NO;
@@ -657,7 +657,7 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 12;
+ CURRENT_PROJECT_VERSION = 13;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = H3WXHVTP97;
ENABLE_NS_ASSERTIONS = NO;
@@ -673,7 +673,7 @@
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = PureMac/Info.plist;
MACOSX_DEPLOYMENT_TARGET = 13.0;
- MARKETING_VERSION = 2.6.0;
+ MARKETING_VERSION = 2.6.1;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = NO;
diff --git a/PureMac/Services/PermissionCoordinator.swift b/PureMac/Services/PermissionCoordinator.swift
index 8d129aa..bec4c66 100644
--- a/PureMac/Services/PermissionCoordinator.swift
+++ b/PureMac/Services/PermissionCoordinator.swift
@@ -133,11 +133,23 @@ final class PermissionCoordinator: ObservableObject {
/// Refresh permission status without armed polling. Cheap to call on
/// app-becomes-active.
+ ///
+ /// If a request is in flight and we just observed the grant, route
+ /// through `handleGrant` so the sheet dismisses and the callback fires.
+ /// Without this, refreshStatus would flip `hasFullDiskAccess` to true
+ /// and the next poll tick's `granted && !hasFullDiskAccess` guard
+ /// would skip `handleGrant` — the sheet would sit open in a granted
+ /// state and never fire the retry.
func refreshStatus() {
Task.detached(priority: .userInitiated) {
let granted = FullDiskAccessManager.shared.hasFullDiskAccess
await MainActor.run { [weak self] in
- self?.hasFullDiskAccess = granted
+ guard let self else { return }
+ let wasGranted = self.hasFullDiskAccess
+ self.hasFullDiskAccess = granted
+ if granted && !wasGranted && self.isRequesting {
+ self.handleGrant()
+ }
}
}
}
diff --git a/PureMac/ViewModels/AppState.swift b/PureMac/ViewModels/AppState.swift
index da167c3..8734b32 100644
--- a/PureMac/ViewModels/AppState.swift
+++ b/PureMac/ViewModels/AppState.swift
@@ -156,12 +156,17 @@ final class AppState: ObservableObject {
func removeSelectedFiles() {
// Re-entrance guard: if a previous removal is still resolving and
- // the FDA sheet hasn't dismissed yet, a second call would race-
+ // the FDA sheet/retry hasn't finished, a second call would race-
// overwrite `lastFailedRemovalURLs` before the first batch's retry
- // closure read it. Refuse the new request until the user dismisses
- // (or grants and retries) the active sheet.
- guard !removalNeedsFullDiskAccess else {
- Logger.shared.log("Refused duplicate removeSelectedFiles while FDA prompt is active", level: .info)
+ // closure read it. We can't gate on `removalNeedsFullDiskAccess`
+ // alone — AppFilesView clears that flag the moment it hands off to
+ // the coordinator, leaving a window where a second remove call
+ // would pass the guard while the coordinator is still polling.
+ // PermissionCoordinator.isRequesting covers the full sheet-open +
+ // retry-pending span.
+ guard !removalNeedsFullDiskAccess,
+ !PermissionCoordinator.shared.isRequesting else {
+ Logger.shared.log("Refused duplicate removeSelectedFiles while FDA flow is active", level: .info)
return
}
// Safety guard: never allow a high-risk home dotpath (listed in
diff --git a/PureMac/Views/DashboardView.swift b/PureMac/Views/DashboardView.swift
index e28e88b..d803cbe 100644
--- a/PureMac/Views/DashboardView.swift
+++ b/PureMac/Views/DashboardView.swift
@@ -7,41 +7,65 @@ import SwiftUI
struct DashboardView: View {
@EnvironmentObject var appState: AppState
@State private var showConfirmation = false
+ @State private var fireCleanConfetti = false
+ @State private var lastCleanedScanState: Bool = false
var body: some View {
- ScrollView {
- VStack(alignment: .leading, spacing: 20) {
- switch appState.scanState {
- case .idle:
- hero
- stats
- if !suggestionRows.isEmpty {
- sectionHeader("Suggested for you")
- suggestions
- }
- case .scanning:
- scanningHero
- if !appState.allResults.isEmpty {
- sectionHeader("Found so far")
- liveResults
- }
- case .completed:
- completedHero
- if appState.totalJunkSize > 0 {
- sectionHeader("By category")
- resultsList
+ ZStack {
+ ScrollView {
+ VStack(alignment: .leading, spacing: 20) {
+ switch appState.scanState {
+ case .idle:
+ hero
+ stats
+ if !suggestionRows.isEmpty {
+ sectionHeader("Suggested for you")
+ suggestions
+ }
+ case .scanning:
+ scanningHero
+ if !appState.allResults.isEmpty {
+ sectionHeader("Found so far")
+ liveResults
+ }
+ case .completed:
+ completedHero
+ if appState.totalJunkSize > 0 {
+ sectionHeader("By category")
+ resultsList
+ }
+ case .cleaning:
+ cleaningHero
+ case .cleaned:
+ cleanedHero
}
- case .cleaning:
- cleaningHero
- case .cleaned:
- cleanedHero
}
+ .padding(.horizontal, 28)
+ .padding(.vertical, 24)
+ .frame(maxWidth: 920, alignment: .leading)
}
- .padding(.horizontal, 28)
- .padding(.vertical, 24)
- .frame(maxWidth: 920, alignment: .leading)
+
+ // Celebratory burst when a clean cycle finishes with something
+ // freed. Pinned to the whole dashboard so particles cover the
+ // hero card. allowsHitTesting=false keeps Done clickable through
+ // falling confetti.
+ ConfettiView(trigger: fireCleanConfetti)
+ .allowsHitTesting(false)
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
+ .onChange(of: appState.scanState) { newState in
+ // Fire only on the rising edge of .cleaned with freed > 0 so
+ // the burst doesn't replay when the user navigates back to the
+ // dashboard while .cleaned is still on screen.
+ let isCleaned: Bool = {
+ if case .cleaned = newState { return true }
+ return false
+ }()
+ if isCleaned && !lastCleanedScanState && appState.totalFreedSpace > 0 {
+ fireCleanConfetti.toggle()
+ }
+ lastCleanedScanState = isCleaned
+ }
.confirmationDialog(
cleanConfirmationTitle,
isPresented: $showConfirmation,
diff --git a/PureMac/Views/OnboardingView.swift b/PureMac/Views/OnboardingView.swift
index 4ae8cdd..b17a788 100644
--- a/PureMac/Views/OnboardingView.swift
+++ b/PureMac/Views/OnboardingView.swift
@@ -404,6 +404,7 @@ private struct ReadyScene: View {
let hasFda: Bool
@State private var bounce = false
@State private var fireConfetti = false
+ @State private var confettiWork: DispatchWorkItem?
@AppStorage("PureMac.HasSeenWelcomeConfetti") private var hasSeenConfetti = false
var body: some View {
@@ -433,18 +434,22 @@ private struct ReadyScene: View {
bounce = true
}
// Fire the welcome confetti exactly once per install.
- // Subsequent onboarding re-entries (e.g. after a Reset)
- // get a clean ready scene without the celebration.
- // hasSeenConfetti is recorded the moment the burst
- // fires (not after it finishes) so a fast user who
- // clicks Start within the first second still gets the
- // once-per-install guarantee.
+ // The work item is cancelled in onDisappear so a fast
+ // user who clicks Start within the 0.35s delay doesn't
+ // burn the once-per-install flag without ever seeing the
+ // celebration.
guard !hasSeenConfetti else { return }
- DispatchQueue.main.asyncAfter(deadline: .now() + 0.35) {
+ let work = DispatchWorkItem {
fireConfetti = true
hasSeenConfetti = true
Haptics.success()
}
+ confettiWork = work
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.35, execute: work)
+ }
+ .onDisappear {
+ confettiWork?.cancel()
+ confettiWork = nil
}
VStack(spacing: 10) {
diff --git a/project.yml b/project.yml
index 7a62fd1..ccb459c 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.6.0"
- CURRENT_PROJECT_VERSION: "12"
+ MARKETING_VERSION: "2.6.1"
+ CURRENT_PROJECT_VERSION: "13"
GENERATE_INFOPLIST_FILE: "NO"
ASSETCATALOG_COMPILER_APPICON_NAME: "AppIcon"
COMBINE_HIDPI_IMAGES: "YES"