Skip to content

🎨 Palette: Replace .onTapGesture with Button in list views for better accessibility - #96

Open
NSEvent wants to merge 1 commit into
mainfrom
palette-accessibility-tap-gesture-6216224137302109714
Open

🎨 Palette: Replace .onTapGesture with Button in list views for better accessibility#96
NSEvent wants to merge 1 commit into
mainfrom
palette-accessibility-tap-gesture-6216224137302109714

Conversation

@NSEvent

@NSEvent NSEvent commented Jul 19, 2026

Copy link
Copy Markdown
Owner

💡 What:
Replaced standard HStack rows equipped with .onTapGesture modifiers with semantic Button components using .buttonStyle(.plain) in MacroListView.swift and ScriptListView.swift. Added dynamic .help() and .accessibilityLabel() bindings to these new interactive areas.

🎯 Why:
Using .onTapGesture directly on views effectively breaks native keyboard navigation; these items lose their focus states and are removed from the native tab order. Additionally, without a semantic interactive trait, screen readers struggle to convey what action the user can perform. By migrating to a Button, we restore these vital interactive behaviors and accessibility affordances without altering the visual design of the lists.

Accessibility:

  • Restored keyboard focus and space/enter key interactivity to the list item actions.
  • Introduced specific VoiceOver text via .accessibilityLabel indicating exactly which macro or script is being edited (e.g., "Edit 'My Script'").
  • Added .help strings to provide identical context via visual tooltips on hover.

PR created automatically by Jules for task 6216224137302109714 started by @NSEvent

Summary by CodeRabbit

  • Accessibility Improvements
    • Improved keyboard navigation and focus behavior for macro and script rows.
    • Added clearer accessibility labels and help text for editing actions.
    • Preserved separate controls for editing and deleting scripts.
  • Documentation
    • Added documentation describing the updated accessibility and navigation behavior.

…tter accessibility

- Refactored `MacroListView.swift` and `ScriptListView.swift` to use `Button` wrapping instead of `.onTapGesture` on list items.
- Added proper `.help()` and `.accessibilityLabel()` dynamically bound to the item's name.
- Ensures the UI remains keyboard navigable (e.g., standard tab order and focus states) and accessible to VoiceOver.
- Logged accessibility learnings to `.Jules/palette.md`.

Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Macro and script row edit interactions now use plain-styled SwiftUI buttons instead of tap gestures, with rectangular hit areas and accessibility labels/tooltips. The palette documentation records the keyboard navigation and accessibility rationale.

Changes

Accessible row edit actions

Layer / File(s) Summary
Accessible row edit actions
XboxControllerMapper/XboxControllerMapper/Views/{Macros, Scripts}/*, .Jules/palette.md
Macro and script row content now invokes editing through Button(action:) with .buttonStyle(.plain), contentShape(Rectangle()) where applicable, and edit-focused help and accessibility labels. The palette documents this SwiftUI interaction pattern.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: replacing .onTapGesture rows with plain Buttons in list views to improve accessibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette-accessibility-tap-gesture-6216224137302109714

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
XboxControllerMapper/XboxControllerMapper/Views/Macros/MacroListView.swift (1)

190-190: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add fallback text for empty macro names.

For consistency with the .help and .accessibilityLabel modifiers below, consider providing a fallback string when macro.name is empty. This also aligns with how empty names are handled in ScriptListView.swift.

♻️ Proposed refactor
-                        Text(macro.name)
+                        Text(macro.name.isEmpty ? "Unnamed Macro" : macro.name)
🤖 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/Macros/MacroListView.swift`
at line 190, Update the macro name display in MacroListView to use the same
fallback string as its nearby help and accessibilityLabel modifiers when
macro.name is empty. Preserve the existing macro.name value for non-empty names
and align the behavior with ScriptListView.
🤖 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.

Nitpick comments:
In `@XboxControllerMapper/XboxControllerMapper/Views/Macros/MacroListView.swift`:
- Line 190: Update the macro name display in MacroListView to use the same
fallback string as its nearby help and accessibilityLabel modifiers when
macro.name is empty. Preserve the existing macro.name value for non-empty names
and align the behavior with ScriptListView.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1c21e7c5-d208-45e4-9835-2d78b4ad0644

📥 Commits

Reviewing files that changed from the base of the PR and between ae38cc3 and a4137d8.

📒 Files selected for processing (3)
  • .Jules/palette.md
  • XboxControllerMapper/XboxControllerMapper/Views/Macros/MacroListView.swift
  • XboxControllerMapper/XboxControllerMapper/Views/Scripts/ScriptListView.swift

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant