diff --git a/.Jules/palette.md b/.Jules/palette.md index f61603c8..3cf667be 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. + +## 2026-07-04 - Dynamic Accessibility Labels in Lists +**Learning:** In repeated lists with icon-only buttons (like Edit/Delete in `MacroListView` and `ScriptListView`), generic accessibility labels like "Edit" create a poor experience for screen reader users as they lack context of *what* is being edited. +**Action:** When implementing lists with interactive actions, always ensure `accessibilityLabel` and `help` tooltips dynamically include the context (e.g., `item.name`) to disambiguate the action (e.g., "Edit My Macro"). diff --git a/XboxControllerMapper/XboxControllerMapper/Views/Macros/MacroListView.swift b/XboxControllerMapper/XboxControllerMapper/Views/Macros/MacroListView.swift index 211ecb1e..8e249337 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.isEmpty ? "Unnamed Macro" : macro.name) in shared library") + .accessibilityLabel("Edit \(macro.name.isEmpty ? "Unnamed Macro" : 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.isEmpty ? "Unnamed Macro" : macro.name)") + .accessibilityLabel("Edit \(macro.name.isEmpty ? "Unnamed Macro" : macro.name)") Button(action: onDelete) { Image(systemName: "trash") .foregroundColor(.red.opacity(0.8)) } .buttonStyle(.borderless) - .help("Delete") - .accessibilityLabel("Delete") + .help("Delete \(macro.name.isEmpty ? "Unnamed Macro" : macro.name)") + .accessibilityLabel("Delete \(macro.name.isEmpty ? "Unnamed Macro" : macro.name)") } } .padding(.horizontal, 12) diff --git a/XboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift b/XboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift index 40c6f5ff..11c8dd28 100644 --- a/XboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift +++ b/XboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift @@ -222,16 +222,16 @@ struct ScriptRow: View { .foregroundColor(.accentColor) } .buttonStyle(.borderless) - .help("Edit") - .accessibilityLabel("Edit") + .help("Edit \(script.name.isEmpty ? "Untitled Script" : script.name)") + .accessibilityLabel("Edit \(script.name.isEmpty ? "Untitled Script" : script.name)") Button(action: onDelete) { Image(systemName: "trash") .foregroundColor(.red.opacity(0.8)) } .buttonStyle(.borderless) - .help("Delete") - .accessibilityLabel("Delete") + .help("Delete \(script.name.isEmpty ? "Untitled Script" : script.name)") + .accessibilityLabel("Delete \(script.name.isEmpty ? "Untitled Script" : script.name)") } } .padding(.horizontal, 12) diff --git a/patch_workflow.sh b/patch_workflow.sh new file mode 100644 index 00000000..e398f875 --- /dev/null +++ b/patch_workflow.sh @@ -0,0 +1 @@ +sed -i.bak 's/tail -200/grep -E -A 5 -B 5 "XCTFail|failed|Failed|error:|Error:"/' .github/workflows/test.yml