🎨 Palette: Disambiguate list actions with dynamic accessibility labels#67
🎨 Palette: Disambiguate list actions with dynamic accessibility labels#67NSEvent wants to merge 1 commit into
Conversation
- 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, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
📝 WalkthroughWalkthroughUpdates accessibility labels for repeated list actions so each edit/delete control includes the affected item’s text or display name. Also adds an accessibility label to the inherited reset button in the layer override slider and records the label pattern in the palette. ChangesAccessibility labels for list actions and reset control
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@XboxControllerMapper/XboxControllerMapper/Views/MainWindow/OnScreenKeyboardSettingsView.swift`:
- Around line 119-127: The accessibility labels for the edit/delete buttons in
OnScreenKeyboardSettingsView currently interpolate QuickText.text,
AppBarItem.displayName, and WebsiteLink.displayName directly, which can produce
blank announcements when those values are empty. Update the label-building logic
around the affected Button/accessibilityLabel calls so it keeps the dynamic name
when present but falls back to the old noun (for example, the item type like
quick text/app bar item/website link) when the interpolated display name is
empty. Apply the same fallback behavior to all three label pairs in this view,
including the other Edit/Delete sections referenced by the review.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6b4501e5-ecff-46b7-be88-9d728ddcef30
📒 Files selected for processing (3)
.Jules/palette.mdXboxControllerMapper/XboxControllerMapper/Views/MainWindow/OnScreenKeyboardSettingsView.swiftXboxControllerMapper/XboxControllerMapper/Views/MainWindow/SettingsViews.swift
| .accessibilityLabel("Edit \(quickText.text)") | ||
|
|
||
| Button(action: onDelete) { | ||
| Image(systemName: "trash") | ||
| .foregroundColor(.red) | ||
| } | ||
| .buttonStyle(.borderless) | ||
| .help("Delete quick text") | ||
| .accessibilityLabel("Delete quick text") | ||
| .accessibilityLabel("Delete \(quickText.text)") |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Add a fallback label when the item name is blank.
QuickText.text, AppBarItem.displayName, and WebsiteLink.displayName all default to an empty string upstream, so blank or migrated rows will announce labels like Edit / Delete instead of a meaningful control name. Keep the dynamic form, but fall back to the old noun when the interpolated value is empty.
💡 Example fix
- .accessibilityLabel("Edit \(quickText.text)")
+ .accessibilityLabel(quickText.text.isEmpty ? "Edit quick text" : "Edit \(quickText.text)")
- .accessibilityLabel("Delete \(item.displayName)")
+ .accessibilityLabel(item.displayName.isEmpty ? "Delete app" : "Delete \(item.displayName)")
- .accessibilityLabel("Edit \(link.displayName)")
+ .accessibilityLabel(link.displayName.isEmpty ? "Edit link" : "Edit \(link.displayName)")Also applies to: 198-206, 277-285
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@XboxControllerMapper/XboxControllerMapper/Views/MainWindow/OnScreenKeyboardSettingsView.swift`
around lines 119 - 127, The accessibility labels for the edit/delete buttons in
OnScreenKeyboardSettingsView currently interpolate QuickText.text,
AppBarItem.displayName, and WebsiteLink.displayName directly, which can produce
blank announcements when those values are empty. Update the label-building logic
around the affected Button/accessibilityLabel calls so it keeps the dynamic name
when present but falls back to the old noun (for example, the item type like
quick text/app bar item/website link) when the interpolated display name is
empty. Apply the same fallback behavior to all three label pairs in this view,
including the other Edit/Delete sections referenced by the review.
💡 What: Changed static accessibility labels for icon-only edit/delete buttons in repeated lists to be dynamic by including the item's name/text. Added a missing accessibility label to the reset button in
SettingsViews.swift.🎯 Why: In lists of items (like apps, links, or text snippets), screen reader users hear identical static labels like "Edit app" for every row. Adding dynamic context (e.g. "Edit Safari") allows users to know exactly which item they are targeting.
♿ Accessibility: Improves screen reader navigation and clarity for users interacting with settings lists.
Added a learning to
.Jules/palette.mdfor this UX pattern.PR created automatically by Jules for task 8629821849748021373 started by @NSEvent
Summary by CodeRabbit