Repository navigation
feat(ui): rebuild Reset wallet info in SwiftUI - #1250
Conversation
The wipe warning (More → Security → Reset wallet, and removing the last wallet in Wallets) is now a SwiftUI screen with the DashUIKit nav bar and buttons, replacing the Objective-C controller and its storyboard. Same copy and behavior: Continue opens the recovery-phrase check in wipe mode, and a completed wipe still goes to the caller's DWWipeDelegate. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou'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 28 minutes. View limit details
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Replace the reset warning screen DashWallet/Sources/UI/Menu/Security/ResetWalletInfo/* |
The SwiftUI screen displays the wipe warning and provides Continue and Cancel actions. Its hosting controller opens recovery in .wipe mode, pops on Cancel, forwards a completed wipe to its delegate, and asserts on an unexpected recovery callback. The Objective-C controller and storyboard are removed. |
Wire reset routes and app targets DashWallet/Sources/UI/Menu/Security/SecurityMenuScreen.swift, DashWallet/Sources/UI/Menu/Security/Wallets/WalletsScreen.swift, DashWallet.xcodeproj/project.pbxproj, DashWallet/dashwallet-Bridging-Header.h |
Both reset entry points use ResetWalletInfoHostingController. The project includes the Swift file in both app targets and removes the legacy source, storyboard, and bridging-header references. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Refactor
Suggested reviewers: llbartekll
Merge Risk: 
Minimal · up to 56887
-
No actionable merge-blocking issue remains in the reviewed reset-wallet migration. Normal checks can proceed before merge.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title "feat(ui): rebuild Reset wallet info in SwiftUI" matches the main change. The PR replaces the Objective-C DWResetWalletInfoViewController and its storyboard with a SwiftUI ResetWalletInfoScreen, and both reset entry points (Security menu and removing the last wallet) now use it. The title is specific and concise, and it names the UI area and the technology. No search was needed because the check relies only on the provided context.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
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
-
- 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.
Comment @coderabbitai help to get the list of available commands.
|
✅ Final review complete — no blockers (commit 5023377) · triage: normal |
romchornyi
left a comment
There was a problem hiding this comment.
✅ no blockers · 5 non-blocking recommendations · 2 requests before approval — reviewed at 5688726e40
| Level | Verdict | |
|---|---|---|
| 1 · Idea | ✅ valid | First screen of the Security / Settings SwiftUI migration; same copy and behaviour |
| 2 · Architecture | ✅ right layer | App UI only; DWRecoverViewController stays Obj-C as stated |
| 3 · Completeness | ✅ complete | Both entry points (Security → Reset Wallet, last wallet in Wallets) switched; no references to the old controller remain |
| 4 · Code | ✅ clean | Recommendations below, none blocking |
Before approval, please:
- Add Before / After screenshots to the description — light and dark, old screen next to new. The visuals do change: the background goes from
SecondaryBackgroundColor(#141519in dark) todash.primaryBackground(#000000), and the spacing differs (icon → title was 26, title → description 10, now 16 for both; bottom inset was ~4, now 20). A one-row table with<img width="260" …/>per cell keeps it readable. - Run the full wipe on a test wallet (the open test-plan item), from both entry points — that is the one path this screen exists for, and the
DWWipeDelegatehand-off is the part a UI port can break silently.
5 non-blocking recommendations
- Declare
NavigationBarDisplayableon the hosting controller — ResetWalletInfoScreen.swift#L87 —BaseNavigationController.willShowshows the UIKit bar and adds its own back button on every push/pop unless the controller says otherwise; this is how the two back buttons appeared before (CreateUsernameViewController.swift#L132-L136, InternalTransferHostingController.swift#L110-L116). The other DashUIKit-bar hosting controllers declareisNavigationBarHidden { true }; doing the same here removes the dependency on SwiftUI re-applying.navigationBarHidden(true)after popping back from the recovery screen. (not reproduced at runtime) - Dynamic Type no longer scales — ResetWalletInfoScreen.swift#L47-L53 — the old labels used
preferredFontForTextStylewithadjustsFontForContentSizeCategory;dashFontis a fixed.system(size:). Same as the sibling SwiftUI screens, so not for this PR — but if scaling is added later, this fixed VStack + Spacers layout will need aScrollView. - Header trait on the title — ResetWalletInfoScreen.swift#L35-L37 — the old UIKit
titlewas announced as the screen heading;.accessibilityAddTraits(.isHeader)restores VoiceOver rotor navigation on this destructive flow. - Doc comments name only the Security menu — ResetWalletInfoScreen.swift#L21, #L84 — the controller is also pushed from
WalletsScreen.beginRemovewhen removing the last wallet. rootViewis built twice ininit— ResetWalletInfoScreen.swift#L93-L97 — placeholder closures, then the real ones. Works, but if the reassignment is ever dropped the buttons silently do nothing; a small actions object captured beforesuper.initwould build it once.
Review details
Layered review: idea → architecture → completeness → code. Level 4 ran a general correctness pass and a UI lane (navigation, localization, accessibility, dark mode, parity with the deleted storyboard). Localization: same five keys, no new ones, no format strings. Recommendation 2 was checked against UIFont+DWFont.m and DashUIKit DashTextStyle.swift.
🤖 Reviewed with Claude Code
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The SwiftUI migration preserves the reset flow and delegate routing, and the changed entry points correctly use the new hosting controller. Two non-blocking concerns remain: the replacement drops the legacy screen's explicit light status-bar style, and the asynchronous wipe-to-app delegate path has no focused regression or end-to-end coverage. The DashWalletTests simulator check was still in progress at the captured CI state.
🟡 2 suggestion(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:
normalbygpt-6.1-sol(effort low) — This is a contained but behavior-changing UI and navigation migration affecting two wallet-reset entry points, delegation, and project integration, so it warrants ordinary review. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-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; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-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/Security/ResetWalletInfo/ResetWalletInfoScreen.swift`:
- [SUGGESTION] DashWallet/Sources/UI/Menu/Security/ResetWalletInfo/ResetWalletInfoScreen.swift:87-90: Preserve the reset screen's light status-bar style
The deleted `DWResetWalletInfoViewController` explicitly returned `UIStatusBarStyleLightContent`, while `ResetWalletInfoHostingController` does not override `preferredStatusBarStyle`. With `UIViewControllerBasedStatusBarAppearance` enabled, the replacement uses the hosting controller's default status-bar style, changing the status-bar icons when this screen is pushed. Even if the new light background makes the default style arguably more legible, this is an unannounced visual behavior change from the parity described by the PR. Add an explicit override matching the previous controller or document the intentional design change.
- [SUGGESTION] DashWallet/Sources/UI/Menu/Security/ResetWalletInfo/ResetWalletInfoScreen.swift:121-123: Cover successful asynchronous wipe forwarding
This migration makes `recoverViewControllerDidWipe` the only bridge from the Objective-C recovery-phrase flow to the caller's app-level `DWWipeDelegate`. The listed simulator checks cover navigation into wipe mode but do not exercise a completed wipe, so they would not catch a broken delegate connection or a failure to transition out of the wallet UI. Add a focused test that invokes the hosting controller's wipe callback with a mock delegate and asserts forwarding, or run the full flow with a disposable test wallet.
| final class ResetWalletInfoHostingController: UIHostingController<ResetWalletInfoScreen>, | ||
| DWRecoverViewControllerDelegate { | ||
|
|
||
| private weak var wipeDelegate: DWWipeDelegate? |
There was a problem hiding this comment.
✅ Withdrawn at
50233773; see the replies below.
🟡 Suggestion: Preserve the reset screen's light status-bar style
The deleted DWResetWalletInfoViewController explicitly returned UIStatusBarStyleLightContent, while ResetWalletInfoHostingController does not override preferredStatusBarStyle. With UIViewControllerBasedStatusBarAppearance enabled, the replacement uses the hosting controller's default status-bar style, changing the status-bar icons when this screen is pushed. Even if the new light background makes the default style arguably more legible, this is an unannounced visual behavior change from the parity described by the PR. Add an explicit override matching the previous controller or document the intentional design change.
| final class ResetWalletInfoHostingController: UIHostingController<ResetWalletInfoScreen>, | |
| DWRecoverViewControllerDelegate { | |
| private weak var wipeDelegate: DWWipeDelegate? | |
| final class ResetWalletInfoHostingController: UIHostingController<ResetWalletInfoScreen>, | |
| DWRecoverViewControllerDelegate { | |
| override var preferredStatusBarStyle: UIStatusBarStyle { .lightContent } | |
| private weak var wipeDelegate: DWWipeDelegate? |
source: gpt-6.1-sol (phase2-reviewer: general)
There was a problem hiding this comment.
Keeping the default here on purpose. .lightContent is left over from the old dark-blue header design. On the current light background it makes the clock and status icons white on near-white, so effectively invisible. In dark mode the default style is already light. Edit Profile had the same leftover and dropped it when it moved to the DashUIKit bar. The before/after screenshots in the description show the result.
There was a problem hiding this comment.
Withdrawn (re-reviewed at 50233773): The old light-content status-bar style belonged to the former dark header, while this replacement uses an adaptive light background where white status icons would be unreadable. The hosting controller's default style is therefore intentional for the new design, so the parity concern does not apply.
| func recoverViewControllerDidWipe(_ controller: DWRecoverViewController) { | ||
| wipeDelegate?.didWipeWallet() | ||
| } |
There was a problem hiding this comment.
✅ Resolved at
50233773; see the replies below.
🟡 Suggestion: Cover successful asynchronous wipe forwarding
This migration makes recoverViewControllerDidWipe the only bridge from the Objective-C recovery-phrase flow to the caller's app-level DWWipeDelegate. The listed simulator checks cover navigation into wipe mode but do not exercise a completed wipe, so they would not catch a broken delegate connection or a failure to transition out of the wallet UI. Add a focused test that invokes the hosting controller's wipe callback with a mock delegate and asserts forwarding, or run the full flow with a disposable test wallet.
source: gpt-6.1-sol (phase2-reviewer: general)
There was a problem hiding this comment.
Covered both ways in 5023377: ResetWalletInfoWipeForwardingTests checks that recoverViewControllerDidWipe reaches the DWWipeDelegate (held weakly). A full wipe was also run with a real wallet from both entry points; each time the app returned to onboarding.
There was a problem hiding this comment.
Resolved (re-reviewed at 50233773): The added ResetWalletInfoWipeForwardingTests construct the hosting controller with a spy, invoke recoverViewControllerDidWipe, and verify that the caller delegate receives the callback; they also verify the delegate remains weak. This directly covers the forwarding gap identified in the original finding.
- "Wipe Wallet" carries the header trait for VoiceOver. - Doc comments name both entry points (Security, and removing the last wallet in Wallets). - The hosting controller builds its root view once; the buttons reach it through a small target object instead of placeholder closures. - ResetWalletInfoWipeForwardingTests: a completed wipe reaches the DWWipeDelegate, which is held weakly. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@romchornyi thanks for the review! Addressed in 5023377: Before approval
Recommendations
|
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The SwiftUI replacement preserves both reset entry points, recovery-phrase wipe mode, weak delegate ownership, and completed-wipe forwarding. One non-blocking architecture issue remains: the new SwiftUI screen is closure-only and does not use the required @mainactor ObservableObject ViewModel boundary. The simulator test check is still queued, with the target-membership and accessibility checks successful.
🟡 1 suggestion(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); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a contained but behavior-changing UI and navigation migration affecting wallet reset entry points, delegate forwarding, and project configuration, so it warrants ordinary review. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort high); agentphase2-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/Security/ResetWalletInfo/ResetWalletInfoScreen.swift`:
- [SUGGESTION] DashWallet/Sources/UI/Menu/Security/ResetWalletInfo/ResetWalletInfoScreen.swift:24-26: Add the required ViewModel for the new SwiftUI screen
This new SwiftUI screen is implemented as a closure-only View with no @MainActor ObservableObject ViewModel. The project architecture requires all new UI to use a ViewModel, with the View limited to rendering state and routing intent. Introduce a ResetWalletInfoViewModel for the screen's actions/state and have the hosting controller inject or own it, rather than making raw closures the screen's behavior boundary.
| struct ResetWalletInfoScreen: View { | ||
| let onContinue: () -> Void | ||
| let onCancel: () -> Void |
There was a problem hiding this comment.
🟡 Suggestion: Add the required ViewModel for the new SwiftUI screen
This new SwiftUI screen is implemented as a closure-only View with no @mainactor ObservableObject ViewModel. The project architecture requires all new UI to use a ViewModel, with the View limited to rendering state and routing intent. Introduce a ResetWalletInfoViewModel for the screen's actions/state and have the hosting controller inject or own it, rather than making raw closures the screen's behavior boundary.
source: gpt-6.1-sol (phase2-reviewer: general)
romchornyi
left a comment
There was a problem hiding this comment.
✅ Approve · no blockers · 1 tracked follow-up — re-reviewed at 50233773d2
| Level | Verdict | |
|---|---|---|
| 1 · Idea | ✅ valid | unchanged |
| 2 · Architecture | ✅ right layer | unchanged |
| 3 · Completeness | ✅ complete | both entry points wiped end to end; forwarding now covered by a test |
| 4 · Code | ✅ clean | the incremental diff (5688726e40..50233773d2) is small and correct; DashWalletTests on simulator green |
Closed since the last review
- Before / After — light and dark, old vs new, posted in this comment. Please also move the image into the description under a Before / After heading, so it stays with the PR when it is squash-merged and linked from release notes.
- Full wipe from both entry points — done (Security → Reset Wallet, last wallet in Wallets), plus
ResetWalletInfoWipeForwardingTestsfor the hand-off and the weak delegate. -
.isHeaderon the title —ResetWalletInfoScreen.swift#L38. - Doc comments name both entry points.
-
rootViewbuilt once — theActionTargetwith a weak controller avoids both the placeholder and a retain cycle (#L94-L108). -
NavigationBarDisplayable— withdrawn, you are right:extension UIHostingController: NavigationBarDisplayablealready covers every hosting controller, so the explicit conformance was redundant.
Deferred: Dynamic Type (dashFont is a fixed size) goes to the pass over the sibling screens, as agreed.
🤖 Reviewed with Claude Code

Summary
First screen of the UIKit / Objective-C → SwiftUI migration (Security / Settings group).
ResetWalletInfoScreen, with the DashUIKitNavigationBar(back circle + title) andDashButtons (ContinuefilledBlue, CancelplainBlue).DWRecoverViewControllerin wipe mode.DWWipeDelegate.ResetWalletInfoHostingControlleris a thinUIHostingControllerthat pushes the recovery-phrase screen and acts as its delegate.DWResetWalletInfoViewController.h/.m,ResetWalletInfo.storyboardand their bridging-header / project entries.The recovery-phrase screen it opens (
DWRecoverViewController) is still Objective-C. It's part of the later Wallet setup group.Test plan
dashpayDebug simulator build;scripts/a11y_audit.py --checkcleanResetWalletInfoWipeForwardingTests🤖 Generated with Claude Code
Summary by CodeRabbit