Skip to content

fix(topup): persistent header Done exit on the card-payment WebView - #686

Merged
islandbitcoin merged 3 commits into
mainfrom
feat/topup-success-exit
Aug 10, 2026
Merged

fix(topup): persistent header Done exit on the card-payment WebView#686
islandbitcoin merged 3 commits into
mainfrom
feat/topup-success-exit

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

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 onNavigationStateChange never detects success and the paymentSuccess screen (which does have Done/View buttons) never shows.

What

  • CardPayment now sets a persistent header Done button (navigation.setOptions / headerRight) that navigates straight to Primary, available from the moment the screen opens — before, during, and after payment. Also sets the proper header title (FygaroWebViewScreen.title).
  • Leaving early is safe by design: crediting is webhook-driven on the backend (feat(fygaro): payment webhook — record, notify, and flag-gated auto-credit flash#472) and does not depend on this screen.
  • Reuses existing i18n keys (PaymentSuccessScreen.done) — no locale-file churn.

Tests

  • header Done button renders and navigates to Primary on press
  • header exit stays available while the username query is still loading (the screen's most stranded state)
  • existing 13 CardPayment/TopupDetails tests updated for the setOptions mock and passing (15 total)

yarn tsc:check clean, eslint clean on changed files.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NcEjF6SS3Ci5D4CzZqdPjb

Dread and others added 3 commits August 8, 2026 22:52
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
@islandbitcoin
islandbitcoin merged commit ed5fb1d into main Aug 10, 2026
9 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.

1 participant