Repository navigation
fix(wallet): a failed transfer's toast stays until it is closed - #1177
Conversation
The failure reason is the one thing the history does not show, and three seconds was not enough to read it. Failure toasts now carry a close button and no timer; progress and success notices still time out. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The failure rule lives on the runner's Notice. A sticky failure is cleared when a recovery of the pending lock succeeds and on a wallet or network switch; the notice docs say what the code now does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Clearing a failure on recovery or on wallet/network notifications retired the wrong failure or a still-true one; the toast now stays until the user closes it or the next transfer replaces it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lure; failures go unstamped Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tap clears only its own notice Co-Authored-By: Claude Opus 5.5 <[email protected]>
The DashUIKit pinned on develop draws the toast's close glyph without a label; a named Close action on the toast gives VoiceOver the way out. 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 19 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
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 |
|
✅ Final review complete — no blockers (commit b13f6a4) · triage: low |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The failure exemption and dismissal callback match the PR's intended behavior, and no blocking defect was confirmed. Two nonblocking improvements remain: register the VoiceOver Close action only where it works, and add focused regression coverage for persistence, timer cancellation, and dismissal. Runtime accessibility behavior remains unverified; the installed Xcode 16.4 toolchain is older than the pinned DashUIKit package's Swift tools 6.3 requirement.
🟡 2 suggestion(s)
1 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: Add focused regression coverage for persistent failure notices
DashWallet/Sources/UI/Payments/InternalTransfer/Confirm/InternalTransferToastModifier.swift:61-78
The PR adds failure persistence and explicit dismissal without adding regression tests, and its description leaves the manual smoke check outstanding. Cover a started notice replaced by a failure before its timer expires, an old failure when Home reappears, normal expiration of non-failure notices, explicit failure dismissal, and a captured dismissal callback after a different notice replaces it. Exercise the production presentation rules through focused tests or a UI harness rather than duplicating those rules in a test-only implementation. Also verify the Close action with VoiceOver on a compatible simulator or device: the pinned DashUIKit close button is unlabeled, so the named action's discoverability matters to this flow. The documented test-target breakage makes this a nonblocking coverage suggestion, not a demand to repair unrelated test infrastructure.
source: glm-5.3-flash (phase1-reviewer: general); gpt-6.1-sol (phase2-reviewer: general)
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:
lowbygpt-6.1-sol(effort low) — This is a small, well-contained UI notification lifecycle change affecting only transfer toast dismissal and failure-state handling, without changing funds movement, signing, networking, or persistence. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 99% left, weekly 73% left; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 13% left, 5h 100% left) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); 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/Payments/InternalTransfer/Confirm/InternalTransferToastModifier.swift`:
- [SUGGESTION] DashWallet/Sources/UI/Payments/InternalTransfer/Confirm/InternalTransferToastModifier.swift:52-54: Register the Close accessibility action only for failure notices
The named Close action is attached unconditionally, but its handler dismisses only failures. For started, busy, succeeded, and submitted notices, the modifier therefore declares an accessibility action that does nothing when invoked. Automatic expiration does not make that advertised action functional. Apply the accessibility action only to failure toasts, matching the condition already used for onDismiss, so VoiceOver is not offered an ineffective Close control on other notices.
- [SUGGESTION] DashWallet/Sources/UI/Payments/InternalTransfer/Confirm/InternalTransferToastModifier.swift:61-78: Add focused regression coverage for persistent failure notices
The PR adds failure persistence and explicit dismissal without adding regression tests, and its description leaves the manual smoke check outstanding. Cover a started notice replaced by a failure before its timer expires, an old failure when Home reappears, normal expiration of non-failure notices, explicit failure dismissal, and a captured dismissal callback after a different notice replaces it. Exercise the production presentation rules through focused tests or a UI harness rather than duplicating those rules in a test-only implementation. Also verify the Close action with VoiceOver on a compatible simulator or device: the pinned DashUIKit close button is unlabeled, so the named action's discoverability matters to this flow. The documented test-target breakage makes this a nonblocking coverage suggestion, not a demand to repair unrelated test infrastructure.
| .accessibilityAction(named: Text(NSLocalizedString("Close", comment: ""))) { | ||
| if notice.isFailure { dismiss(notice) } | ||
| } |
There was a problem hiding this comment.
🟡 Suggestion: Register the Close accessibility action only for failure notices
The named Close action is attached unconditionally, but its handler dismisses only failures. For started, busy, succeeded, and submitted notices, the modifier therefore declares an accessibility action that does nothing when invoked. Automatic expiration does not make that advertised action functional. Apply the accessibility action only to failure toasts, matching the condition already used for onDismiss, so VoiceOver is not offered an ineffective Close control on other notices.
source: glm-5.3-flash (phase1-reviewer: general)
There was a problem hiding this comment.
Fixed in b13f6a4 — the Close action is now registered through accessibilityActions only when the notice is a failure, the same condition as the close glyph.
There was a problem hiding this comment.
Resolved (re-reviewed at b13f6a40): Confirmed your fix in b13f6a4: accessibilityActions registers Close only inside the notice.isFailure condition, matching the close glyph's onDismiss condition. Non-failure notices no longer advertise an ineffective Close action.
… rules The VoiceOver Close action was attached to every transfer toast, but only a failure can be closed — on the others it did nothing. It is now registered only for failures, the same condition as the close glyph. The display-time and dismissal rules move out of the view onto InternalTransferRunner (Notice.remainingDisplayTime, dismissal(of:clears:)) so the toast and InternalTransferNoticeTests exercise the same code: failures have no timer, a notice seen late gets the rest of its window, one whose window passed unseen expires at once, and a stale close leaves a newer notice in place. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Regression coverage (the out-of-diff suggestion) is in b13f6a4: the display-time and dismissal rules moved from the view onto |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Independently reviewed the complete base-to-head diff at b13f6a4, the runner's notice transitions, HomeView integration, test-target membership, and the pinned DashUIKit Toast implementation; no actionable in-scope defects were found. Both prior suggestions are fixed: Close accessibility actions are failure-only, and the new regression tests exercise the production timing and dismissal rules. Validation is static: the supplied exact-head CI snapshot passes accessibility, PR-title, and CodeRabbit checks but contains no build or XCTest results; SwiftUI timer lifecycle and device VoiceOver behavior remain 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:
lowbygpt-6.1-sol(effort low) — The diff is a small, contained change to transfer-toast persistence, stale-dismissal protection, and accessibility with focused tests, without changing funds movement or other critical surfaces. - Phase 1 reviewers:
gemini-3.8-flash-high— general (completed, effort high); agentphase1-reviewer - Phase 1 model:
gemini-3.8-flash-high— antigravity quota: weekly 42% left, 5h 32% left - 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 medium); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort medium); agentphase2-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
left a comment
There was a problem hiding this comment.
LGTM. A failure is now the only notice without a timer. The stale-tap guard works because Notice is Equatable and the toast captures the notice it was drawn for. Moving the timing and dismissal rules onto InternalTransferRunner means the tests exercise production code and not a copy. I checked against the pinned DashUIKit (83cf65a): Toast(style:message:onDismiss:) exists and draws the close button only when onDismiss is set. "Close" already exists in en.lproj/Localizable.strings, so this adds no new string.
Two non-blocking notes are inline: the VoiceOver workaround will become redundant after the next DashUIKit bump, and one test checks less than its name says.
A third note, also non-blocking, extends the trade-off in the description. InternalTransferRunner.shared lives for the whole process, so an unclosed failure also survives a wallet wipe: the next wallet's Home would show the deleted wallet's failure. Before this PR, that notice would have expired as soon as Home reappeared. A wipe isn't ambiguous the way the wallet-change notification is, so clearing notice there would be safe if it ever matters. Not needed for this PR.
Reviewed statically at b13f6a40f (diff, runner and HomeView integration, DashUIKit Toast source). I didn't build it locally or check VoiceOver on a device.
| style: style(for: notice), | ||
| message: message(for: notice), | ||
| onDismiss: notice.isFailure ? { dismiss(notice) } : nil) | ||
| // The pinned DashUIKit draws the close glyph unlabelled, |
There was a problem hiding this comment.
Non-blocking: DashUIKit master already labels this button. dashpay/DashUIKit#18 (b5b765b) added .accessibilityLabel("Close") to the Toast close button. Package.resolved tracks master at 83cf65a, so the next package update will give VoiceOver both a labelled Close button and this Close action, and this comment will no longer be true. A TODO(dashuikit-pin): drop once the pin includes DashUIKit#18 here would make sure it gets removed with that bump.
| } | ||
| } | ||
|
|
||
| func testFailureReplacingAStartedNoticeStopsTheCountdown() { |
There was a problem hiding this comment.
Nit: this test only re-checks two values that testFailureHasNoTimer and testFreshNoticeGetsTheWholeWindow already cover. What actually stops the countdown is .task(id: runner.notice) cancelling when the notice changes, and nothing here runs that. Consider renaming it to what it checks, or dropping it, so the coverage list doesn't claim more than it tests.
Issue being fixed or feature implemented
A failed internal transfer is announced by a toast that disappeared after 3 seconds. The failure reason is the one thing the history does not show, and 3 seconds was not enough to read it — on testnet the toast was gone before the user could see what went wrong.
What was done?
developdraws the close glyph without a label, and for a failure it is the only way out.InternalTransferRunner.Notice.isFailure; the notice docs describe the failure exemption.Trade-off, deliberate: since a failure is closed only by hand, it also stays if the user switches wallet or network, or later completes the transfer through recovery, until they close it. Clearing it automatically on those events was tried and dropped — the wallet-change notification also fires on rebuilds of the same wallet, and recovery could clear an unrelated, still-true failure.
How Has This Been Tested?
dashpayscheme builds for the simulator (Xcode 27, iOS 26.5 SDK, arm64).AlreadyExists, platform#4998).Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code