fix(topup): persistent header Done exit on the card-payment WebView - #686
Merged
Conversation
The Fygaro payment can complete entirely inside the page (SPA state change, PayPal modal) with no URL change for the navigation-state handler to detect — so the success screen never fires and the user is stranded in the WebView, backing out through the whole top-up stack to get home. Add a header Done button on CardPayment that navigates straight to Primary. Leaving early is safe: crediting is webhook-driven on the backend and independent of this screen. Reuses existing i18n keys (FygaroWebViewScreen.title, PaymentSuccessScreen.done) — no locale churn. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NcEjF6SS3Ci5D4CzZqdPjb
Review fix for PR #686: the PR deletes the stray committed .watchman-cookie-mlod.local-804-544 but nothing prevented a fresh cookie (new random suffix) from being committed by the next `git add -A` while Metro/watchman is running. Add .watchman-cookie-* to .gitignore so the class of files stays out. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014QwZjNcKfkMhrBE33HcUVN
makeStyles from @rneui/themed returns a fresh styles object every render, so depending on styles.headerDone made the header useLayoutEffect re-run navigation.setOptions on every CardPayment render. Hoist the static style to module scope and drop it from the dep array, leaving only stable deps. Adds a regression test asserting setOptions is not called again on an unrelated re-render (WebView load completing), with the i18n test mock made referentially stable to match the real context. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014QwZjNcKfkMhrBE33HcUVN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
After completing a card top-up, users can be left stranded on the Fygaro WebView with no forward path — backing out through TopupDetails → TopupCashout → home by hand. Root cause: Fygaro can complete the payment entirely in-page (SPA state change / PayPal modal) with no URL change, so
onNavigationStateChangenever detects success and thepaymentSuccessscreen (which does have Done/View buttons) never shows.What
CardPaymentnow sets a persistent headerDonebutton (navigation.setOptions/headerRight) that navigates straight toPrimary, available from the moment the screen opens — before, during, and after payment. Also sets the proper header title (FygaroWebViewScreen.title).PaymentSuccessScreen.done) — no locale-file churn.Tests
Primaryon presssetOptionsmock and passing (15 total)yarn tsc:checkclean, eslint clean on changed files.🤖 Generated with Claude Code
https://claude.ai/code/session_01NcEjF6SS3Ci5D4CzZqdPjb