Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
## 2024-05-24 - Empty States in Process Lists
**Learning:** Users can misinterpret an empty dynamic list (like processes) as a broken UI or a frozen app if there's no visual feedback indicating that the list is intentionally empty.
**Action:** Always provide a clear, empty state with an icon and brief text for dynamic lists that might temporarily yield no results, preventing user confusion.

## 2024-05-25 - Dynamic Button Labels and Contextual Disabled Help
**Learning:** In async operations or disabled button states, static text like "Clean Selected" leaves the user guessing why a button is disabled (e.g. no selection) or if an action is currently running.
**Action:** Use conditional labels (e.g., `viewModel.isScanning ? "Scanning..." : "Scan"`) and add `.help()` tooltips explaining exactly why a button is disabled (e.g. "Select items to clean") to provide immediate, clear feedback.
6 changes: 4 additions & 2 deletions Sources/Cacheout/Views/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,21 @@ struct ContentView: View {
Button {
Task { await viewModel.scan() }
} label: {
Label("Scan", systemImage: "arrow.clockwise")
Label(viewModel.isScanning ? "Scanning..." : "Scan", systemImage: "arrow.clockwise")
}
.disabled(viewModel.isScanning)
.help(viewModel.isScanning ? "Scan in progress" : "Scan for caches")

// Clean button
Button {
viewModel.showCleanConfirmation = true
} label: {
Label("Clean Selected", systemImage: "trash")
Label(viewModel.isCleaning ? "Cleaning..." : "Clean Selected", systemImage: "trash")
}
.buttonStyle(.borderedProminent)
.tint(.red)
.disabled(!viewModel.hasSelection || viewModel.isCleaning)
.help(!viewModel.hasSelection ? "Select items to clean" : (viewModel.isCleaning ? "Cleaning in progress" : "Clean selected items"))
}
.padding(.horizontal)
.padding(.vertical, 10)
Expand Down