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-24 - Dynamic Labels and Disabled State Tooltips
**Learning:** Users can be confused when a primary action button is disabled without explanation, and static labels during async operations fail to provide immediate status feedback.
**Action:** Enhance button UX by using dynamic labels (e.g., 'Scanning...') during async operations, and add `.help()` tooltips to disabled buttons to explain the required state to enable them.
5 changes: 3 additions & 2 deletions Sources/Cacheout/Views/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,20 @@ 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)

// 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" : "")
}
.padding(.horizontal)
.padding(.vertical, 10)
Expand Down