diff --git a/.jules/palette.md b/.jules/palette.md index 4a583f7..c23e25c 100644 --- a/.jules/palette.md +++ b/.jules/palette.md @@ -1,3 +1,6 @@ ## 2024-04-30 - Clickable List Rows and Accessibility **Learning:** In SwiftUI lists, adding a `Button` only around a checkbox creates a tiny hit target that is hard to tap and poorly reported by VoiceOver. **Action:** Wrap the entire row's `HStack` in a `Button`, apply `.contentShape(Rectangle())` to make empty space clickable, use `.buttonStyle(.plain)` to prevent unintended text styling, and apply `.accessibilityElement(children: .combine)` along with `.accessibilityAddTraits(.isSelected)` for optimal VoiceOver experience. +## 2024-05-04 - Icon-only Control Accessibility +**Learning:** Icon-only `Menu` and `Button` controls in SwiftUI require both an explicit `.accessibilityLabel` for VoiceOver support and a `.help` modifier for mouse hover tooltips, as they lack textual context. +**Action:** Always apply `.accessibilityLabel` and `.help` modifiers to interactive controls that only use an `Image` label. diff --git a/Sources/Cacheout/Views/MenuBarView.swift b/Sources/Cacheout/Views/MenuBarView.swift index dddcacd..237911d 100644 --- a/Sources/Cacheout/Views/MenuBarView.swift +++ b/Sources/Cacheout/Views/MenuBarView.swift @@ -251,6 +251,7 @@ struct MenuBarView: View { } label: { Image(systemName: "macwindow") .font(.caption) + .accessibilityLabel("Open full window") } .buttonStyle(.bordered) .help("Open full window") diff --git a/Sources/Cacheout/Views/ProcessesView.swift b/Sources/Cacheout/Views/ProcessesView.swift index 1ed5d16..2da313f 100644 --- a/Sources/Cacheout/Views/ProcessesView.swift +++ b/Sources/Cacheout/Views/ProcessesView.swift @@ -164,6 +164,8 @@ struct ProcessesView: View { Image(systemName: "ellipsis.circle") .font(.callout) .foregroundStyle(.secondary) + .accessibilityLabel("Process Actions") + .help("Process Actions") } .menuStyle(.borderlessButton) .fixedSize()