🎨 Palette: Add accessibility and tooltips to ScriptListView empty state list item buttons#68
🎨 Palette: Add accessibility and tooltips to ScriptListView empty state list item buttons#68NSEvent wants to merge 4 commits into
Conversation
…te list item buttons * Adds `.help()` and `.accessibilityLabel()` to the `Button` in the empty state of `ScriptListView` to improve the UX and accessibility for users on macOS utilizing mouse or VoiceOver when navigating the dynamic `ForEach` generated list of script examples. 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. |
|
Warning Review limit reached
More reviews will be available in 4 minutes and 46 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds Empty-state button accessibility
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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: 2
🤖 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 @.Jules/palette.md:
- Around line 28-30: Update the palette guidance entry to clearly separate
icon-only buttons from buttons with visible text: the current wording in the
empty-state list item guidance is too broad and can lead to incorrectly adding a
static accessibility label to text-visible controls like the scripts empty state
button. Revise the wording around the empty-state button guidance to say
icon-only buttons should always get both .help() and .accessibilityLabel(),
while buttons with visible text should generally rely on SwiftUI’s automatic
accessibility label unless the visible text is insufficient; reference the
existing empty-state list item guidance and the newer icon-only entry so the
terminology stays consistent. Also verify whether the 2024-06-28 date is
intentional relative to the later entries, and correct it if it was copied by
mistake.
In
`@XboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift`:
- Around line 132-133: The ExampleScript button in ScriptListView is using a
static accessibility label that overrides the richer label SwiftUI can derive
from the visible Text(example.name) and Text(example.description). Remove the
hardcoded .accessibilityLabel("Add Example Script") in the example button
builder, or replace it with a dynamic label that includes example.name so each
script remains distinguishable to VoiceOver users; keep the .help() only if
needed, since the visible text already provides context.
🪄 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: a9ad32d7-681b-49da-a44a-ffab8004d23d
📒 Files selected for processing (2)
.Jules/palette.mdXboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift
| ## 2024-06-28 - Missing accessibility in Empty State List Item Buttons | ||
| **Learning:** Empty state list item buttons (like "Add example scripts") containing only an icon or text and icon can miss explicit accessibility labels or helpful tooltips, particularly in dynamically generated lists (`ForEach`) or customized interactive elements, causing a bad UX for mouse and screen reader users. | ||
| **Action:** Always add `.help()` and `.accessibilityLabel()` modifiers to interactive empty state list buttons. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift
Palette guidance conflates icon-only and text-visible buttons, risking misapplied accessibility overrides.
The new entry groups "only an icon or text and icon" together, but these have different accessibility requirements. Buttons with visible text (like this scriptsEmptyState button containing example.name and example.description) should not blindly receive .accessibilityLabel(): SwiftUI's automatic label incorporates all visible text, and a static override strips that context from VoiceOver users.
Revise the guidance to explicitly distinguish:
- Icon-only buttons: always add both
.help()and.accessibilityLabel()(matches existing 2024-11-20 entry). - Buttons with visible text: do not add
.accessibilityLabel()unless the visible text fails to describe the action; prefer letting SwiftUI auto-generate from content, or use dynamic labels that include visible text.
Also, the entry date "2024-06-28" predates the 2024-11-20 and 2026-06-06 entries; verify this is intentional and not a copy-paste error.
🤖 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 @.Jules/palette.md around lines 28 - 30, Update the palette guidance entry to
clearly separate icon-only buttons from buttons with visible text: the current
wording in the empty-state list item guidance is too broad and can lead to
incorrectly adding a static accessibility label to text-visible controls like
the scripts empty state button. Revise the wording around the empty-state button
guidance to say icon-only buttons should always get both .help() and
.accessibilityLabel(), while buttons with visible text should generally rely on
SwiftUI’s automatic accessibility label unless the visible text is insufficient;
reference the existing empty-state list item guidance and the newer icon-only
entry so the terminology stays consistent. Also verify whether the 2024-06-28
date is intentional relative to the later entries, and correct it if it was
copied by mistake.
…te list item buttons * Adds `.help()` and `.accessibilityLabel()` to the `Button` in the empty state of `ScriptListView` to improve the UX and accessibility for users on macOS utilizing mouse or VoiceOver when navigating the dynamic `ForEach` generated list of script examples. Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
…te list item buttons * Adds `.help()` and `.accessibilityLabel()` to the `Button` in the empty state of `ScriptListView` to improve the UX and accessibility for users on macOS utilizing mouse or VoiceOver when navigating the dynamic `ForEach` generated list of script examples. Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
…te list item buttons * Adds `.help()` and `.accessibilityLabel()` to the `Button` in the empty state of `ScriptListView` to improve the UX and accessibility for users on macOS utilizing mouse or VoiceOver when navigating the dynamic `ForEach` generated list of script examples. Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
💡 What: Added
helpandaccessibilityLabelmodifiers to the button displaying the "+ circle" icon for pre-filling script examples.🎯 Why: Because the UI structure consisted of only an
Image(systemName: "plus.circle")embedded inside an unlabelled Button (and lacked modifiers), the button action intent was ambiguous for hover interactions on macOS and opaque to VoiceOver screen reader users navigating the empty state.♿ Accessibility: Enhanced the list item buttons to be discoverable and describable for visually impaired screen reader users on macOS.
PR created automatically by Jules for task 11584182886286396162 started by @NSEvent
Summary by CodeRabbit