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.

fix: add Scan button to category views + widen sidebar

moamen3e882076c979
diff --git a/PureMac/Views/CategoryDetailView.swift b/PureMac/Views/CategoryDetailView.swift
index c623d87..7adefa7 100644
--- a/PureMac/Views/CategoryDetailView.swift
+++ b/PureMac/Views/CategoryDetailView.swift
@@ -21,22 +21,29 @@ struct CategoryDetailView: View {
fileList(result)
}
} else {
- EmptyStateView("Not Scanned", systemImage: category.icon, description: "Run a scan to analyze this category.")
+ EmptyStateView("Not Scanned", systemImage: category.icon, description: "Run a scan to analyze this category.", action: { appState.scanSingleCategory(category) }, actionLabel: "Scan Now")
}
}
.searchable(text: $searchText, prompt: "Filter files")
.navigationTitle(category.rawValue)
.toolbar {
- ToolbarItemGroup {
+ ToolbarItem(placement: .automatic) {
+ Button {
+ appState.scanSingleCategory(category)
+ } label: {
+ Label("Scan", systemImage: "arrow.clockwise")
+ }
+ .disabled(appState.scanState.isActive)
+ }
+
+ ToolbarItemGroup(placement: .automatic) {
if let result = result, !result.items.isEmpty {
Button("Select All") {
appState.selectAllInCategory(category)
}
-
Button("Deselect All") {
appState.deselectAllInCategory(category)
}
-
Button(action: { sortDescending.toggle() }) {
Label(
sortDescending ? "Largest First" : "Smallest First",
@@ -45,15 +52,9 @@ struct CategoryDetailView: View {
}
.help(sortDescending ? "Sorted: Largest First" : "Sorted: Smallest First")
}
+ }
- if result == nil || !appState.scanState.isActive {
- Button {
- appState.scanSingleCategory(category)
- } label: {
- Label("Scan", systemImage: "magnifyingglass")
- }
- }
-
+ ToolbarItem(placement: .automatic) {
if let _ = result, !appState.scanState.isActive {
let selectedSize = appState.selectedSizeInCategory(category)
let selectedCount = appState.selectedCountInCategory(category)
@@ -62,7 +63,7 @@ struct CategoryDetailView: View {
showConfirmation = true
} label: {
Label(
- "Clean \(selectedCount) items (\(ByteCountFormatter.string(fromByteCount: selectedSize, countStyle: .file)))",
+ "Clean \(selectedCount) items",
systemImage: "trash"
)
}
diff --git a/PureMac/Views/MainWindow.swift b/PureMac/Views/MainWindow.swift
index ede64b0..5cf21ae 100644
--- a/PureMac/Views/MainWindow.swift
+++ b/PureMac/Views/MainWindow.swift
@@ -11,7 +11,7 @@ struct MainWindow: View {
} detail: {
detailView
}
- .navigationSplitViewColumnWidth(min: 200, ideal: 230, max: 300)
+ .navigationSplitViewColumnWidth(min: 220, ideal: 250, max: 320)
.frame(minWidth: 860, minHeight: 520)
.onReceive(NotificationCenter.default.publisher(for: NSApplication.didBecomeActiveNotification)) { _ in
appState.checkFullDiskAccess()