From b4f6b3850793386ce2286040ecf62b7ec1ab9ab5 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 06:21:42 +0000 Subject: [PATCH] Add accessibility labels and tooltips to icon-only controls Added `.accessibilityLabel` and `.help` modifiers to the process action menu in `ProcessesView.swift` and the open window button in `MenuBarView.swift`. This fixes accessibility issues where VoiceOver could not read the elements and mouse users had no context. Co-authored-by: acebytes <2820910+acebytes@users.noreply.github.com> --- .jules/palette.md | 3 +++ Sources/Cacheout/Views/MenuBarView.swift | 1 + Sources/Cacheout/Views/ProcessesView.swift | 2 ++ 3 files changed, 6 insertions(+) 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()