Skip to content

🎨 Palette: [UX improvement] Replace onTapGesture with Accessible Buttons - #168

Open
NSEvent wants to merge 2 commits into
mainfrom
palette-ux-accessible-buttons-7237675322418955143
Open

NSEvent wants to merge 2 commits into
mainfrom
palette-ux-accessible-buttons-7237675322418955143

Conversation

@NSEvent

@NSEvent NSEvent commented Sep 6, 2026

Copy link
Copy Markdown
Owner

💡 What:
Replaced .onTapGesture attached to HStack components with standard Button components in ChordRow and SequenceRow list items. The HStack is now wrapped inside the Button, with .buttonStyle(.plain) applied to preserve visual styling.

🎯 Why:
Attaching .onTapGesture to non-interactive generic views (like HStack or VStack) makes them clickable for mouse users but completely hides them from keyboard navigation (Tab key) and screen readers. Wrapping them in a proper Button ensures semantic correctness and accessibility.

📸 Before/After:
Visual appearance is unchanged.

Accessibility:

  • The list rows can now receive keyboard focus natively.
  • Screen readers (VoiceOver) will now correctly identify the interactive rows as actionable elements, rather than ignoring them or reading them incorrectly.

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

Summary by CodeRabbit

  • Accessibility

    • Improved keyboard navigation and screen reader support when editing chord and sequence rows.
    • Expanded clickable areas to include surrounding empty space within each row.
  • Bug Fixes

    • Replaced gesture-based row editing with standard buttons for more consistent interaction behavior.
    • Editing rows now responds more reliably across supported input methods.

Refactored `ChordRow` and `SequenceRow` list items to wrap interactive hit zones in standard `Button` components instead of using `.onTapGesture` on `.contentShape(Rectangle())`. This ensures proper keyboard focus support (via Tab) and allows screen readers to correctly identify the row as a button.

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 Sep 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: a80f6452-5389-481a-af5a-65b6e9dff511

📥 Commits

Reviewing files that changed from the base of the PR and between 62c658a and 6638656.

📒 Files selected for processing (1)
  • XboxControllerMapper/XboxControllerMapper/Services/Mapping/MappingEngine.swift
💤 Files with no reviewable changes (1)
  • XboxControllerMapper/XboxControllerMapper/Services/Mapping/MappingEngine.swift

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

ChordRow and SequenceRow now use plain-styled Button controls for editing. The palette journal records the related accessibility guidance. Two DEBUG-only diagnostic print statements were removed from MappingEngine.

Changes

Accessible edit controls and diagnostics

Layer / File(s) Summary
Replace row tap gestures with buttons
XboxControllerMapper/XboxControllerMapper/Views/MainWindow/ChordSequenceListViews.swift, .Jules/palette.md
ChordRow and SequenceRow trigger onEdit through Button, retain full-row hit areas with contentShape(Rectangle()), and apply .buttonStyle(.plain). The journal documents this accessibility pattern.
Remove DEBUG diagnostic output
XboxControllerMapper/XboxControllerMapper/Services/Mapping/MappingEngine.swift
Removes two DEBUG-only print statements for button presses and chord detection without changing runtime control flow.

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

Merge Risk: ⚪ Minimal · up to 66386

The row edit controls now use native buttons for improved keyboard and screen-reader interaction, with no identified merge-blocking risk.

🚥 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 accurately identifies the main change: replacing onTapGesture with accessible Button components for a UX improvement. The emoji and bracketed label add minor noise but do not make the title …
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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-ux-accessible-buttons-7237675322418955143

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.

Refactored `ChordRow` and `SequenceRow` list items to wrap interactive hit zones in standard `Button` components instead of using `.onTapGesture` on `.contentShape(Rectangle())`. This ensures proper keyboard focus support (via Tab) and allows screen readers to correctly identify the row as a button. Also removed excessive test-deadlocking synchronous debug prints from `MappingEngine.swift`.

Co-authored-by: NSEvent <44446865+NSEvent@users.noreply.github.com>
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