From 2d1245e85172b4ac49bef2ca3c9f4ec012019025 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 27 Jun 2026 08:42:54 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Disambiguate=20list?= =?UTF-8?q?=20actions=20with=20dynamic=20accessibility=20labels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated `OnScreenKeyboardSettingsView.swift` to use dynamic properties (`quickText.text`, `item.displayName`, `link.displayName`) in accessibility labels for repeated list items. - Added missing accessibility label to the reset button in `SettingsViews.swift`. - Added learning to `.Jules/palette.md` regarding disambiguating repeated list actions. Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com> --- .Jules/palette.md | 4 ++++ .../MainWindow/OnScreenKeyboardSettingsView.swift | 12 ++++++------ .../Views/MainWindow/SettingsViews.swift | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.Jules/palette.md b/.Jules/palette.md index f61603c8..be0e8646 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -25,3 +25,7 @@ ## 2026-06-23 - [SwiftUI Button Accessibility] **Learning:** Found a pattern where SwiftUI icon-only buttons or minimal UI elements were given `.help()` modifiers for hover tooltips but lacked `.accessibilityLabel()` modifiers for screen readers. **Action:** When adding `.help()` to buttons, always pair it with a corresponding `.accessibilityLabel()` to ensure full accessibility. + +## 2024-06-27 - [Disambiguating List Actions] +**Learning:** In repeated lists (like quick text, apps, or links), icon-only buttons with static accessibility labels (e.g., "Edit app") sound identical to screen reader users, making it impossible to know *which* item is being targeted. +**Action:** Always use dynamic context from the current item in the iteration (e.g., `.accessibilityLabel("Edit \(item.displayName)")`) to disambiguate repeated list actions for assistive technologies. diff --git a/XboxControllerMapper/XboxControllerMapper/Views/MainWindow/OnScreenKeyboardSettingsView.swift b/XboxControllerMapper/XboxControllerMapper/Views/MainWindow/OnScreenKeyboardSettingsView.swift index 8fe6829f..d1b1f6b0 100644 --- a/XboxControllerMapper/XboxControllerMapper/Views/MainWindow/OnScreenKeyboardSettingsView.swift +++ b/XboxControllerMapper/XboxControllerMapper/Views/MainWindow/OnScreenKeyboardSettingsView.swift @@ -116,7 +116,7 @@ struct QuickTextRowView: View { } .buttonStyle(.borderless) .help("Edit quick text") - .accessibilityLabel("Edit quick text") + .accessibilityLabel("Edit \(quickText.text)") Button(action: onDelete) { Image(systemName: "trash") @@ -124,7 +124,7 @@ struct QuickTextRowView: View { } .buttonStyle(.borderless) .help("Delete quick text") - .accessibilityLabel("Delete quick text") + .accessibilityLabel("Delete \(quickText.text)") } } @@ -195,7 +195,7 @@ struct AppBarItemRowView: View { } .buttonStyle(.borderless) .help("Edit app") - .accessibilityLabel("Edit app") + .accessibilityLabel("Edit \(item.displayName)") Button(action: onDelete) { Image(systemName: "trash") @@ -203,7 +203,7 @@ struct AppBarItemRowView: View { } .buttonStyle(.borderless) .help("Delete app") - .accessibilityLabel("Delete app") + .accessibilityLabel("Delete \(item.displayName)") } .padding(.vertical, 4) .padding(.horizontal, 8) @@ -274,7 +274,7 @@ struct WebsiteLinkRowView: View { } .buttonStyle(.borderless) .help("Edit link") - .accessibilityLabel("Edit link") + .accessibilityLabel("Edit \(link.displayName)") Button(action: onDelete) { Image(systemName: "trash") @@ -282,7 +282,7 @@ struct WebsiteLinkRowView: View { } .buttonStyle(.borderless) .help("Delete link") - .accessibilityLabel("Delete link") + .accessibilityLabel("Delete \(link.displayName)") } .padding(.vertical, 4) .padding(.horizontal, 8) diff --git a/XboxControllerMapper/XboxControllerMapper/Views/MainWindow/SettingsViews.swift b/XboxControllerMapper/XboxControllerMapper/Views/MainWindow/SettingsViews.swift index ffe3986e..fecabe8a 100644 --- a/XboxControllerMapper/XboxControllerMapper/Views/MainWindow/SettingsViews.swift +++ b/XboxControllerMapper/XboxControllerMapper/Views/MainWindow/SettingsViews.swift @@ -438,6 +438,7 @@ struct JoystickSettingsView: View { } .buttonStyle(.borderless) .help("Reset to base (inherit)") + .accessibilityLabel("Reset \(label) to inherited") } }