Skip to content

fix(ui): Settings rows take the tap across their whole area - #1176

Merged
romchornyi merged 6 commits into
developfrom
fix/settings-row-tap-area
Oct 2, 2026
Merged

romchornyi merged 6 commits into
developfrom
fix/settings-row-tap-area

Conversation

@romchornyi

@romchornyi romchornyi commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

Settings rows answered taps only on their icon and text: DashUIKit.MenuItem draws no background, so a plain-style button around it is hit-tested only where something is drawn. Taps on the gap between the title and the trailing control, or in the strip the 60 pt minimum height adds, did nothing. Plain toggle rows (Notifications, Enable Voting) answered only on the switch.

What was done?

  • Each row's full height is its tap target: the 60 pt minimum height moved inside a contentShape(Rectangle()).
  • Plain toggle rows are buttons whose action is the toggle, so tapping anywhere on Notifications or Enable Voting flips the switch. For VoiceOver they are one element — a toggle with its state and subtitle — instead of a stateless button next to a second switch.
  • Enable Voting rebuilds the items after the flip, so its switch moves (before, the setting changed but the switch did not until something else refreshed the list).
  • The rows are keyed by title rather than the model's per-build UUID, so a toggle updates its row in place: the switch slides and VoiceOver keeps its focus.
  • The Advanced mode row keeps its split: the switch toggles, the rest of the row opens the explainer.

Scope is Settings only. The root cause is DashUIKit.MenuItem having no content shape; fixing it there would cover every other caller (Send, Swap, Internal transfer, …) and is suggested as a follow-up.

How Has This Been Tested?

  • dashpay scheme builds for the simulator (Xcode 27, iOS 26.5 SDK, arm64).
  • Still to check by hand on the final head: every row reacts across its full width and height; tapping the Notifications / Enable Voting row body flips the switch once; the Advanced mode switch toggles and the rest of its row opens the explainer (AdvancedModeRowUITests covers that last split).
  • SettingsRowsUITests (DashPayRecovery scheme) pass: for Notifications and Enable Voting, a tap on the title-to-switch gap, the minimum-height strip and the switch each flips the setting exactly once, and VoiceOver sees one labeled switch. With the row's contentShape removed the gap tap fails.
  • Five local review passes.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • The Voting setting now updates its displayed switch state immediately when toggled.
    • Improved settings row touch targets and VoiceOver descriptions. Rows with info actions keep the info action separate from the switch; other toggle rows respond to taps across the full row.

jeanpierreroma and others added 5 commits October 1, 2026 14:45
DashUIKit's MenuItem draws no background, so a plain-style button around it
answered only on the icon and the text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The minimum row height moved inside the tap shape, and a toggle row without
an explainer is a button whose action is the toggle, so tapping anywhere on
Notifications or Enable Voting flips the switch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rows read as switches

Enable Voting rebuilds the items after the flip, so a row tap moves the switch.
A plain toggle row presents one VoiceOver element: a toggle with its state.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 9ea0dcf1-6a31-480c-9a98-7c7e6187e7d2

📥 Commits

Reviewing files that changed from the base of the PR and between 173a8f4 and d045958.

📒 Files selected for processing (2)
  • DashWallet/Sources/UI/Menu/Settings/SettingsMenuViewModel.swift
  • DashWallet/Sources/UI/Menu/Settings/SettingsScreen.swift

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Settings rows now use title-based identity, a rectangular hit area, and updated action and accessibility behavior. The voting action refreshes menu items after toggling the voting preference.

Changes

Settings menu

Layer / File(s) Summary
Settings row behavior
DashWallet/Sources/UI/Menu/Settings/SettingsScreen.swift
Rows use their titles as identity and apply a 60-point minimum height to the row content. Plain toggle rows respond across the row and expose toggle accessibility semantics. Toggle rows with an info action retain a separate info action.
Voting menu refresh
DashWallet/Sources/UI/Menu/Settings/SettingsMenuViewModel.swift
The voting action captures the view model weakly and rebuilds menu items after toggling the voting preference.

Priority: ➖ Normal

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

Change: Bug fix

Suggested reviewers: jeanpierreroma

Merge Risk: ⚪ Minimal · up to d0459

Settings rows should now respond across their whole area, and the Enable Voting switch should update after a toggle. No concrete problems were found; do the planned manual tap and VoiceOver checks before merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: Settings rows now accept taps across their full area.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@thepastaclaw

thepastaclaw commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ Final review complete — no blockers (commit 7e93dfe) · triage: low

@thepastaclaw thepastaclaw 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.

Final validation — Phase 1 + Phase 2

The Settings changes correctly address the reported hit-target, toggle-refresh, stable-identity, and accessibility behavior, and the exact-head CI snapshot shows the title and accessibility checks passing. No blocking defect was found, but the new full-row toggle interactions and unified accessibility representation lack focused regression coverage.

🟡 1 suggestion(s)

Review provenance

Source: reviewer 1: gemini-3.8-flash-high (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.1-sol (effort low) — The diff is a small, Settings-only UI fix to row hit targets, toggle refresh, stable row identity, and accessibility semantics, with no changes to critical wallet surfaces.
  • Phase 1 reviewers: gemini-3.8-flash-high — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: gemini-3.8-flash-high — antigravity quota: weekly 90% left, 5h 50% left
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `DashWallet/Sources/UI/Menu/Settings/SettingsScreen.swift`:
- [SUGGESTION] DashWallet/Sources/UI/Menu/Settings/SettingsScreen.swift:165-170: Add regression coverage for full-row toggle interactions
  This change wraps the Notifications and Enable Voting rows in buttons while retaining their interactive switch accessories, and replaces their accessibility representation with a single Toggle. The existing AdvancedModeRowUITests covers only the Advanced mode split and does not verify the new plain-toggle behavior. Add focused UI coverage that taps the title-to-switch gap, the additional minimum-height area, and the switch itself, asserting that each action changes the setting exactly once and that the displayed switch state updates immediately. Also verify that VoiceOver exposes one labeled toggle with the current value and subtitle.
Out-of-scope follow-up suggestions (1)

These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.

  • Add contentShape to DashUIKit.MenuItem to fix hit-testing globally — DashUIKit.MenuItem still relies on callers to provide a content shape. For example, the interactive address-source rows in EnterAddressView wrap DashUIKit.MenuItem in a plain Button without adding contentShape, so transparent gaps can remain outside the hit region. This is a concrete shared-component follow-up, but the PR explicitly limits its fix to Settings and identifies the broader DashUIKit change separately.
    • Follow-up: Track a DashUIKit MenuItem contentShape change and audit its interactive callers.

Comment on lines 165 to +170
} else if let action = item.action {
// For a plain toggle row the action is the toggle itself, so a tap
// anywhere on the row flips the switch.
Button(action: action) { content }
.buttonStyle(.plain)
.modifier(ToggleRowAccessibility(item: item, isOn: Self.toggleBinding(item)))

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.

🟡 Suggestion: Add regression coverage for full-row toggle interactions

This change wraps the Notifications and Enable Voting rows in buttons while retaining their interactive switch accessories, and replaces their accessibility representation with a single Toggle. The existing AdvancedModeRowUITests covers only the Advanced mode split and does not verify the new plain-toggle behavior. Add focused UI coverage that taps the title-to-switch gap, the additional minimum-height area, and the switch itself, asserting that each action changes the setting exactly once and that the displayed switch state updates immediately. Also verify that VoiceOver exposes one labeled toggle with the current value and subtitle.

source: gpt-6.1-sol (phase2-reviewer: general)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added in 7e93dfe: DashPayRecoveryUITests/SettingsRowsUITests launches the real SettingsScreen through a simulator-only DEBUG fixture and, for Notifications and Enable Voting, taps the title-to-switch gap, the minimum-height strip and the switch, asserting a single flip after each tap. It also checks that VoiceOver sees one labeled switch with no nested switch. Neither row has a subtitle in its toggle state, so there is no subtitle to assert. Without the row's contentShape the gap tap fails, so the test catches the original defect.

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.

Resolved (re-reviewed at 7e93dfe2): Thank you—the registered SettingsRowsUITests use the real SettingsScreen fixture and assert a state flip after gap, minimum-height-strip, and switch taps for both rows, plus a labeled switch with no nested switch. You are also correct that neither row has a subtitle in its toggle state, so no subtitle assertion is needed for these cases.

SettingsRowsUITests launches the real SettingsScreen through a
simulator-only DEBUG fixture (SETTINGS_ROWS_UI_TEST=1) and, for
Notifications and Enable Voting, taps the gap between title and switch,
the minimum-height strip and the switch itself, asserting after each tap
that the switch flipped exactly once. It also checks that VoiceOver sees
one labeled switch with no nested switch inside it.

Removing the row's contentShape makes the gap tap fail, so the test
catches the original defect.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@thepastaclaw thepastaclaw 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.

Re-review — Final validation — Phase 1 + Phase 2

Independently inspected the complete base-to-head diff at 7e93dfe and found no actionable in-scope defects. The row hit-target changes, Voting state refresh, stable row identities, and registered regression tests address the intended Settings behavior and the prior coverage suggestion. Verification was static: the supplied exact-head CI snapshot reports successful title and accessibility checks, but provides no build or UI-test execution results, so the reported local runtime validation remains unverified.

🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)

Review provenance

Source: reviewer 1: gemini-3.8-flash-high (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.1-sol (effort low) — This is a small, contained Settings UI fix covering row hit targets, toggle refresh and identity, and VoiceOver semantics, with focused UI tests and no changes to critical wallet surfaces.
  • Phase 1 reviewers: gemini-3.8-flash-high — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: gemini-3.8-flash-high — antigravity quota: weekly 46% left, 5h 58% left
  • Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer, gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.

No unresolved findings remain from the prior review on this head.

@llbartekll llbartekll left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. I read through this against DashUIKit at the pinned 83cf65a:

  • No double fire on the switch. SwitchView handles its tap with its own .onTapGesture, and SwiftUI gives a child gesture priority over the Button around it. So tapping the switch runs item.action once through the binding, and the row button does not fire. SettingsRowsUITests checks this.
  • contentShape covers the full width. MenuItem is HStack { leading; central; Spacer(); trailing }, so the row fills the width, and moving frame(minHeight: 60) inside the shape also covers the bottom strip.
  • Enable Voting used to write the pref and leave the switch on the stale item.isToggled until something else refreshed the list. refreshMenuItems() plus [weak self] fixes that.
  • Keying rows by \.title. I checked every Localizable.strings: no locale gives two Settings rows the same title, so the IDs are unique. Notifications swapping between its toggle and "Open Settings" forms switches if branches, so SwiftUI rebuilds that row anyway. That is fine.
  • VoiceOver. accessibilityRepresentation replaces the whole button subtree, so the nested SwitchView element goes away. Activating the representation goes through the same toggleBinding setter, so it fires one action.
  • Fixture guards match: ObjC TARGET_OS_SIMULATOR && DASHPAY inside #if DEBUG, and Swift DEBUG && targetEnvironment(simulator). It never reaches device or release builds. It follows the same pattern as DWUsernameRecoveryUITestFixture.

One small point about running the tests locally (not blocking): testNotificationsRowFlipsFromAnywhereOnTheRow depends on the simulator's notification grant. If anyone has tapped "Don't Allow" for the app on that simulator, effectiveState() returns .blockedBySystem. The row then becomes the "Open Settings" button, and the test fails with "VoiceOver would read a stateless button", which points at the wrong cause. A check like if app.buttons["settings_row_notifications"].exists { throw XCTSkip("notifications denied on this simulator") }, or a clearer failure message, would save someone time.

I did a static review only. I didn't run the build or the UI tests myself.

@romchornyi
romchornyi merged commit b0bbc7f into develop Oct 2, 2026
4 checks passed
@romchornyi
romchornyi deleted the fix/settings-row-tap-area branch October 2, 2026 18:28
romchornyi pushed a commit that referenced this pull request Oct 6, 2026
…me-redesign

Conflicts: the identity coordinator now logs through DWLogger (#1155), so
this branch's os.Logger privacy annotations are dropped and its log lines
kept; the Enable Voting comment takes develop's wording (#1176); the
catalogs keep "Shield your funds first", still used by the funding-privacy
screen, and drop "Shield", which nothing uses any more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

4 participants