Skip to content

Comments

fix(pay): skip intro screen when data collection not required#256

Merged
jakubuid merged 1 commit intodevelopfrom
improve_ic_flow
Feb 6, 2026
Merged

fix(pay): skip intro screen when data collection not required#256
jakubuid merged 1 commit intodevelopfrom
improve_ic_flow

Conversation

@jakubuid
Copy link
Collaborator

@jakubuid jakubuid commented Feb 5, 2026

Summary

  • Skip the "Let's get started" intro screen when collectData is nil in the pay flow
  • Automatically advance to the confirmation screen after loading payment options
  • Dismiss the modal when pressing back from confirmation (when intro was skipped)

Changes

When a payment link does not require user data collection (travel rule), the wallet now:

  1. Skips directly to the payment confirmation modal
  2. Properly handles back navigation by dismissing instead of showing an unnecessary intro screen

Test plan

  • Test with a payment link that does NOT require data collection:
    • Flow should go directly to PayConfirmView (confirmation screen)
    • Pressing back/close should dismiss the modal
  • Test with a payment link that requires data collection:
    • Flow should show PayIntroView first
    • Then proceed through name input → date of birth → confirmation
    • Back navigation should work as before

🤖 Generated with Claude Code

When collectData is nil, the pay flow now automatically advances to the
confirmation screen instead of showing the intro screen. Back navigation
from confirmation now dismisses the modal when intro was skipped.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@claude
Copy link

claude bot commented Feb 5, 2026

Claude finished @jakubuid's task in 51s —— View job


Code Review

  • Read modified PayPresenter.swift file
  • Analyze navigation flow logic
  • Check for potential bugs and edge cases
  • Review Swift best practices
  • Post findings

Issue 1: Race condition between state transition and loading flag

ID: paypresent-race-loading-86f3
File: Example/WalletApp/PresentationLayer/Wallet/Pay/PayPresenter.swift:87
Severity: MEDIUM
Category: concurrency

State transition to .confirmation occurs before isLoading is set to false (line 90). If views observe both currentStep and isLoading, they may briefly see the confirmation screen with loading state still active. This can cause UI inconsistencies where the confirmation view appears while the loading spinner is still showing.

Recommendation: Set isLoading = false before changing currentStep:

// If no data collection required, skip intro and go directly to confirmation
if response.collectData == nil {
    self.isLoading = false
    self.currentStep = .confirmation
} else {
    self.isLoading = false
}

Issue 2: Inconsistent navigation state when payment fails during intro-skipped flow

ID: paypresent-nav-state-9c41
File: Example/WalletApp/PresentationLayer/Wallet/Pay/PayPresenter.swift:218
Severity: LOW
Category: code_quality

When confirmPayment() fails (line 218), it resets to .confirmation step. If the user then presses back from confirmation, the logic at line 147 will call dismiss() (since intro was skipped). However, if the error is transient and user wants to retry, there's no way to go back to the intro screen to restart the flow. The state machine assumes intro-skipped mode is permanent once collectData == nil, but error recovery might benefit from allowing users to restart the entire flow.

Recommendation: Consider adding an explicit "restart flow" option in error cases, or track whether intro was explicitly skipped vs. user has seen it, to allow graceful error recovery.


Automated Checks

✅ No external domain URLs detected
✅ No static resource cache-control issues detected
✅ No workflow security issues detected


@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 5, 2026

@jakubuid jakubuid merged commit 4b671bf into develop Feb 6, 2026
13 of 15 checks passed
@jakubuid jakubuid deleted the improve_ic_flow branch February 6, 2026 07:50
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