diff --git a/.Jules/palette.md b/.Jules/palette.md index f61603c8..4c0f8f59 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-05-18 - Add Dynamic Context to Item Action Tooltips and Accessibility Labels +**Learning:** Icon-only action buttons in repeated list rows (e.g. "Edit", "Delete") cause ambiguity for screen readers and tooltips when multiple rows share the identical label (e.g., ten different "Edit" buttons on screen). +**Action:** Always inject dynamic item context into list action buttons by using string interpolation for both tooltips and voiceover labels (e.g. `.help("Edit \(item.name)")` and `.accessibilityLabel("Edit \(item.name)")`). diff --git a/XboxControllerMapper/XboxControllerMapper/Views/Macros/MacroListView.swift b/XboxControllerMapper/XboxControllerMapper/Views/Macros/MacroListView.swift index 211ecb1e..88cd22d2 100644 --- a/XboxControllerMapper/XboxControllerMapper/Views/Macros/MacroListView.swift +++ b/XboxControllerMapper/XboxControllerMapper/Views/Macros/MacroListView.swift @@ -155,8 +155,8 @@ struct SharedMacroRow: View { .foregroundColor(.accentColor) } .buttonStyle(.borderless) - .help("Edit in shared library") - .accessibilityLabel("Edit in shared library") + .help("Edit \(macro.name) in shared library") + .accessibilityLabel("Edit \(macro.name) in shared library") } .padding(.horizontal, 12) .padding(.vertical, 8) @@ -206,16 +206,16 @@ struct MacroRow: View { .foregroundColor(.accentColor) } .buttonStyle(.borderless) - .help("Edit") - .accessibilityLabel("Edit") + .help("Edit \(macro.name)") + .accessibilityLabel("Edit \(macro.name)") Button(action: onDelete) { Image(systemName: "trash") .foregroundColor(.red.opacity(0.8)) } .buttonStyle(.borderless) - .help("Delete") - .accessibilityLabel("Delete") + .help("Delete \(macro.name)") + .accessibilityLabel("Delete \(macro.name)") } } .padding(.horizontal, 12) diff --git a/XboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift b/XboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift index 40c6f5ff..4ed0c100 100644 --- a/XboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift +++ b/XboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift @@ -217,21 +217,23 @@ struct ScriptRow: View { .onTapGesture { onEdit() } HStack(spacing: 12) { + let displayName = script.name.isEmpty ? "Untitled Script" : script.name + Button(action: onEdit) { Image(systemName: "pencil") .foregroundColor(.accentColor) } .buttonStyle(.borderless) - .help("Edit") - .accessibilityLabel("Edit") + .help("Edit \(displayName)") + .accessibilityLabel("Edit \(displayName)") Button(action: onDelete) { Image(systemName: "trash") .foregroundColor(.red.opacity(0.8)) } .buttonStyle(.borderless) - .help("Delete") - .accessibilityLabel("Delete") + .help("Delete \(displayName)") + .accessibilityLabel("Delete \(displayName)") } } .padding(.horizontal, 12) diff --git a/find_failed_tests.py b/find_failed_tests.py new file mode 100644 index 00000000..58869836 --- /dev/null +++ b/find_failed_tests.py @@ -0,0 +1,5 @@ +# The logs show that there was 1 failure out of 1818 tests. +# The error says: "⚠️ MappingEngine: Chord [ControllerKeys.ControllerButton.b, ControllerKeys.ControllerButton.a] detected but no active profile — input ignored" +# And then "Process completed with exit code 1." +# Wait, let's search for "test" or "failure" in the logs... +# Is there a test failure or did xcodebuild crash? diff --git a/find_test_failures.py b/find_test_failures.py new file mode 100644 index 00000000..ed4d35a4 --- /dev/null +++ b/find_test_failures.py @@ -0,0 +1,8 @@ +import re +import urllib.request +import json +import os + +# Instead of fetching from web, let's just grep through tests to see what tests exist +# for the files we changed. We changed ScriptListView.swift and MacroListView.swift. +# Wait, let's look at the CI logs provided.