Skip to content

refactor(ui): split the Advanced mode row with MenuItem's row action - #1440

Merged
ross-dash merged 2 commits into
developfrom
refactor/settings-toggle-voiceover
Nov 19, 2026
Merged

ross-dash merged 2 commits into
developfrom
refactor/settings-toggle-voiceover

Conversation

@ross-dash

@ross-dash ross-dash commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Uses MenuItem(…, action:) from dashpay/DashUIKit#63 for the Settings row that has both a switch and an explainer (Advanced mode), and drops the app-side workaround for it.

  • Advanced mode. The row was a Button that opened the explainer, wrapped around a MenuItem with an interactive switch, and an accessibility representation made the pair read as one switch with a "Learn more" action. Now MenuItem splits it: the icon and text are one button that opens the explainer, and the switch is its own element, labelled "Advanced mode". The switch is no longer nested inside a button.
  • Notifications, Enable Voting. Unchanged: the whole row is the switch, for taps and for VoiceOver. MenuItem has no "the row is the switch" mode, so ToggleRowAccessibility stays for these rows only, without the explainer part.
  • UI-test fixture. SettingsRowsUITests had not reached the Settings screen since the UIScene adoption (fix(wallet): adopt the UIScene life cycle so the app launches on iOS 27 #1145): the fixture made its own window in AppDelegate, and the scene replaced it, so the tests saw onboarding. The fixture is now shown through installWindowInScene:, like the username-recovery and shielded-history fixtures.

No visual change. One behaviour difference: on the Advanced mode row, the empty strip above and below the text no longer opens the explainer. The icon and text do.

Test plan

  • SettingsRowsUITests (DashPayRecovery scheme), 4 pass:
    • Advanced mode: the row holds exactly one button and one switch, both labelled "Advanced mode"; tapping the switch flips it without opening the explainer; tapping the body opens the explainer without flipping it (new)
    • Notifications, Enable Voting: one switch element, and a tap anywhere on the row flips it exactly once
  • scripts/a11y_audit.py --check: no new findings

Notes from the tests:

  • SwitchView keeps a zero-size switch inside its own element. VoiceOver does not enter an element, so it is not read; the tests count only the row's direct children.
  • The sheet's advanced_mode_info_sheet identifier covers its children's, so the test cleanup finds the close button by its "Close" label rather than navigationbar-close.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Advanced mode settings now respond independently: tapping the switch changes its value, while tapping the row opens the explainer.
    • The switch and explainer control are clearly labeled for accessibility, making each easier to identify and use.

The Advanced mode row wrapped a MenuItem with a switch inside a Button that
opened the explainer, and an accessibility representation made the pair read
as one switch. MenuItem(action:) from DashUIKit#63 does the split itself: the
icon and text are a button that opens the explainer, and the switch is its
own element named after the row. ToggleRowAccessibility now covers only the
plain toggle rows, where the whole row is the switch.

The Settings rows UI-test fixture made its own window in AppDelegate, which
the scene replaced since the UIScene adoption, so SettingsRowsUITests saw
onboarding. It is now shown through installWindowInScene: like the other
fixtures.

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

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 369985cd-f05b-4f5d-aa44-fd5f61cca6c4
Commits

Reviewing files that changed from the base of the PR and between e1ffc18 and f657e82.

Files selected for processing: 1

  • DashWallet/Sources/UI/Menu/Settings/SettingsScreen.swift

No actionable comments were generated in the recent review.

Walkthrough

The Advanced mode settings row now exposes its explainer action and switch as separate controls. UI tests verify their labels and tap behavior. The settings test fixture is saved for installation through the scene setup.

Changes: Settings row accessibility

Layer / File(s) Summary
Separate the explainer action and switch
DashWallet/Sources/UI/Menu/Settings/SettingsScreen.swift
Toggle rows with an explainer assign the info action to the row body and keep the switch as a separate control. The “Learn more” accessibility action is removed.
Set up and verify the row controls
DashWallet/AppDelegate.m, DashPayRecoveryUITests/SettingsRowsUITests.swift
The settings fixture is saved for scene installation. UI tests verify the row’s separate button and switch, their tap behavior, and switch restoration.

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

Change: Refactor

Possibly related issues

Possibly related PRs

  • dashpay/dashwallet-ios#1282: This PR changes the same Advanced mode row’s accessibility representation, but uses a single switch with a “Learn more” action instead of a separate button and switch.

Suggested reviewers: romchornyi, jeanpierreroma, llbartekll

Merge Risk: Minimal · previous review e1ffc

The Advanced mode row now exposes its explainer button and switch as separate accessible controls, and tests cover both. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the Advanced mode row split and the MenuItem row action, which matches the main change in the PR objectives and the SettingsScreen.swift and SettingsRowsUITests.swift summaries. It use…
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.
Full details: Title check

Explanation

The title names the Advanced mode row split and the MenuItem row action, which matches the main change in the PR objectives and the SettingsScreen.swift and SettingsRowsUITests.swift summaries. It uses a conventional refactor(ui) prefix and stays within one sentence. It does not mention the AppDelegate fixture change, but that is secondary and the title does not need to cover every detail.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e0e63dd8-82b2-45ce-ae8d-5b83ce34873d
Commits

Reviewing files that changed from the base of the PR and between 9ef62d8 and e1ffc18.

Files selected for processing: 3

  • DashPayRecoveryUITests/SettingsRowsUITests.swift
  • DashWallet/AppDelegate.m
  • 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.

@thepastaclaw

thepastaclaw commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Final review complete — no blockers (commit f657e82) · triage: normal

@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 change correctly implements the split Advanced mode interaction and updates the fixture through the scene lifecycle. CI reports the affected app build/tests and accessibility audit passing. Two non-blocking maintainability issues remain in the changed SettingsScreen code: one comment overstates the tap area, and the branch predicate is duplicated.

💬 2 nitpick(s)

Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.

Review provenance

Source: reviewer 1: glm-5.3-flash (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) — This is a small, well-contained UI accessibility and test-fixture refactor with limited behavior changes and no critical security, funds, or persistence surfaces involved.
  • Phase 1 reviewers: glm-5.3-flash — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 99% left, weekly 99% left; passed over gemini-3.8-flash-high (antigravity quota lookup failed)
  • 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 (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `DashWallet/Sources/UI/Menu/Settings/SettingsScreen.swift`:
- [NITPICK] DashWallet/Sources/UI/Menu/Settings/SettingsScreen.swift:148-153: Tap-target comment incorrectly describes the explainer-toggle branch
  This comment says the row's full height is the tap target, but the `explainsToggle` branch no longer wraps the content in an outer button. In that branch, `MenuItem` supplies a button for the icon and text while the switch is separate, so the empty strip added by `frame(minHeight:)` does not open the explainer. Scope the comment to the plain-toggle Button branches so it remains accurate after this refactor.
- [NITPICK] DashWallet/Sources/UI/Menu/Settings/SettingsScreen.swift:175-188: MenuItem initializer re-derives the row-branch predicate
  `row(for:)` uses `explainsToggle(item)` to choose the split interaction, while `menuItem(for:isOn:)` independently checks `item.showToggle` and `item.infoAction` to choose the action initializer. These conditions currently match, but future changes to one predicate could make the row branch and the MenuItem initializer disagree. Reuse the same helper so there is one decision point.
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.

  • DashUIKit dependency remains pinned to an unversioned master branch — The new call depends on a recently added DashUIKit API while the project resolves DashUIKit from branch = master without a committed Package.resolved. A fresh checkout whose package cache predates the API can fail to compile even though the current CI resolution succeeds. This is a pre-existing dependency-management issue rather than a defect introduced by the SettingsScreen change.
    • Follow-up: Open a separate dependency-management PR to pin DashUIKit to a compatible release/tag or commit a reproducible Package.resolved.

Comment on lines 148 to 153
// The row's full height is the tap target: `MenuItem` draws no
// background of its own, so without the shape a plain-style button
// would answer only on the icon and text, not on the gaps or the
// strip the minimum height adds.
.frame(minHeight: 60)
.contentShape(Rectangle())

@thepastaclaw thepastaclaw Nov 17, 2026 •

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 at f657e827; see the replies below.

💬 Nitpick: Tap-target comment incorrectly describes the explainer-toggle branch

This comment says the row's full height is the tap target, but the explainsToggle branch no longer wraps the content in an outer button. In that branch, MenuItem supplies a button for the icon and text while the switch is separate, so the empty strip added by frame(minHeight:) does not open the explainer. Scope the comment to the plain-toggle Button branches so it remains accurate after this refactor.

Suggested change
// The row's full height is the tap target: `MenuItem` draws no
// background of its own, so without the shape a plain-style button
// would answer only on the icon and text, not on the gaps or the
// strip the minimum height adds.
.frame(minHeight: 60)
.contentShape(Rectangle())
// The row's full height is the tap target for the Button branches:
// `MenuItem` draws no background of its own, so without the shape a
// plain-style button would answer only on the icon and text, not on
// the gaps or the strip the minimum height adds. The explainsToggle
// branch has no outer button, so the strip above and below the text is
// intentionally inert.
.frame(minHeight: 60)
.contentShape(Rectangle())

source: glm-5.3-flash (phase1-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.

Fixed in f657e82: the comment now says the full-height tap target applies to rows wrapped in a button, and that on the explainer row only MenuItem's icon-and-text button opens the explainer.

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 f657e827): Fixed in f657e82: the comment now limits the full-height tap-target explanation to rows wrapped in a button and explicitly states that the explainer row's surrounding strip is inert.

Comment on lines +175 to +188
private static func explainsToggle(_ item: MenuItemModel) -> Bool {
item.showToggle && item.infoAction != nil
}

private static func menuItem(for item: MenuItemModel, isOn: Binding<Bool>) -> DashUIKit.MenuItem {
let leadingIcon = item.icon.map(iconSource)
let info: MenuItemInfo? = item.showInfo ? .round(color: Color.dash.gray300Alpha70) : nil
let accessory: MenuItemAccessory = item.showToggle
? .toggle(isOn: isOn)
: (item.details.map { .text($0) } ?? .none)

if item.showToggle, let infoAction = item.infoAction {
return DashUIKit.MenuItem(leadingIcon: leadingIcon, title: item.title, helpText: item.subtitle,
info: info, accessory: accessory, action: infoAction)

@thepastaclaw thepastaclaw Nov 17, 2026 •

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 at f657e827; see the replies below.

💬 Nitpick: MenuItem initializer re-derives the row-branch predicate

row(for:) uses explainsToggle(item) to choose the split interaction, while menuItem(for:isOn:) independently checks item.showToggle and item.infoAction to choose the action initializer. These conditions currently match, but future changes to one predicate could make the row branch and the MenuItem initializer disagree. Reuse the same helper so there is one decision point.

Suggested change
private static func explainsToggle(_ item: MenuItemModel) -> Bool {
item.showToggle && item.infoAction != nil
}
private static func menuItem(for item: MenuItemModel, isOn: Binding<Bool>) -> DashUIKit.MenuItem {
let leadingIcon = item.icon.map(iconSource)
let info: MenuItemInfo? = item.showInfo ? .round(color: Color.dash.gray300Alpha70) : nil
let accessory: MenuItemAccessory = item.showToggle
? .toggle(isOn: isOn)
: (item.details.map { .text($0) } ?? .none)
if item.showToggle, let infoAction = item.infoAction {
return DashUIKit.MenuItem(leadingIcon: leadingIcon, title: item.title, helpText: item.subtitle,
info: info, accessory: accessory, action: infoAction)
if Self.explainsToggle(item), let infoAction = item.infoAction {
return DashUIKit.MenuItem(leadingIcon: leadingIcon, title: item.title, helpText: item.subtitle,
info: info, accessory: accessory, action: infoAction)
}

source: glm-5.3-flash (phase1-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.

Fixed in f657e82: explainerAction(_:) returns the explainer for a toggle row (or nil), and both row(for:) and menuItem(for:isOn:) read it, so the branch and the initializer cannot disagree. SettingsRowsUITests (4) still pass.

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 f657e827): Fixed in f657e82: explainerAction(_:) is now the shared decision used by both row(for:) and menuItem(for:isOn:), so the row branch and MenuItem initializer cannot diverge.

explainerAction(_:) is what both row(for:) and menuItem(for:isOn:) read
to tell a toggle row that opens an explainer from the others, so the two
cannot disagree. The tap-target comment now says the full-height shape
applies to rows wrapped in a button, not to the explainer row.

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

The reviewed head correctly centralizes the Advanced-mode split predicate, delegates the explainer action to DashUIKit's row-action initializer, and keeps the switch independent from the body button. The settings UI-test fixture now follows the scene-based window lifecycle used by the other fixtures. No in-scope findings remain; workflow lint, target-membership, and accessibility checks passed, while the simulator test job was still in progress with no reported failure.

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

Review provenance

Source: reviewer 1: muse-spark-1.3-contributor (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: normal by gpt-6.1-sol (effort low) — This is a contained UI behavior and accessibility refactor with accompanying UI-test fixture changes, so its correctness requires ordinary review but does not affect a critical surface.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort high); 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.

@ross-dash
ross-dash merged commit 088eead into develop Nov 19, 2026
7 checks passed
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.

2 participants