Skip to content

[CP staging] Revert "Fix magic code navigates back on payment (SettlementButton)" - #96126

Merged
jasperhuangg merged 2 commits into
mainfrom
revert-93087-fix/magic-code-navigates-back-payment
Jul 14, 2026
Merged

[CP staging] Revert "Fix magic code navigates back on payment (SettlementButton)"#96126
jasperhuangg merged 2 commits into
mainfrom
revert-93087-fix/magic-code-navigates-back-payment

Conversation

@jasperhuangg

@jasperhuangg jasperhuangg commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Reverts #93087

$ #96091

@jasperhuangg
jasperhuangg requested review from a team as code owners July 14, 2026 19:58
@melvin-bot
melvin-bot Bot requested review from heyjennahay and mollfpr and removed request for a team July 14, 2026 19:58
@melvin-bot

melvin-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

@mollfpr Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot removed the request for review from a team July 14, 2026 19:59
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
...s/WideRHPContextProvider/useShouldRenderOverlay.ts 0.00% <ø> (ø)
src/components/SettlementButton/index.tsx 82.19% <37.93%> (-2.99%) ⬇️
... and 13 files with indirect coverage changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78129a3057

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +215 to +217
if (!isUserValidated && paymentMethodType !== CONST.IOU.PAYMENT_TYPE.ELSEWHERE) {
Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.VERIFY_ACCOUNT.path));
return true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resume payment after magic-code verification

For an unvalidated user who chooses any non-Pay Elsewhere method, this branch only navigates to the verify-account screen and then returns, so the selected payment/KYC action is discarded when the magic-code flow validates and closes. In the inspected SettlementButton flow, callers such as handlePaymentSelection and the payment-method submenu onSelected handlers all stop on this return, leaving the user back on the report with no payment attempted unless they click Pay again.

Useful? React with 👍 / 👎.

Comment on lines +25 to 26
}).start(() => {
setShouldRenderOverlay(false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Ignore interrupted overlay hide animations

When the overlay condition flips false and then back true before the 300ms hide animation completes, starting the show animation interrupts the hide animation but this callback still runs with finished=false; it now unconditionally sets shouldRenderOverlay to false while the current condition is true. On wide/super-wide RHP flows this unmounts the dim/click-catcher overlay until the condition cycles again, so quick RHP transitions can leave the underlying pane uncovered.

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown
Contributor

🚧 jasperhuangg has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@jasperhuangg jasperhuangg changed the title Revert "Fix magic code navigates back on payment (SettlementButton)" [CP staging] Revert "Fix magic code navigates back on payment (SettlementButton)" Jul 14, 2026
@jasperhuangg
jasperhuangg merged commit 890332b into main Jul 14, 2026
41 of 43 checks passed
@jasperhuangg
jasperhuangg deleted the revert-93087-fix/magic-code-navigates-back-payment branch July 14, 2026 23:26
@github-actions

Copy link
Copy Markdown
Contributor

🚧 jasperhuangg has triggered a test Expensify/App build. You can view the workflow run here.

OSBotify pushed a commit that referenced this pull request Jul 14, 2026
…navigates-back-payment

[CP staging] Revert "Fix magic code navigates back on payment (SettlementButton)"

(cherry picked from commit 890332b)

(cherry-picked to staging by jasperhuangg)
@OSBotify OSBotify added the CP Staging marks PRs that have been CP'd to staging label Jul 14, 2026
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/jasperhuangg in version: 9.4.34-6 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 cancelled 🔪
🍎 iOS 🍎 cancelled 🔪

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Help site review: no documentation changes required.

I reviewed the changes in this PR and confirmed no updates are needed to Expensify's help site files under docs/articles, so no draft PR was created.

Why

This PR reverts #93087 to fix a visual regression (a semi-transparent overlay appearing on the report RHP — #96091). The changes are entirely internal implementation details:

  • Removes the useVerifyAccountAndResume hook and its test.
  • Reverts SettlementButton and useShouldRenderOverlay logic that controlled how the magic-code verification modal was presented when an unvalidated user triggers a payment.

None of this alters a documented user-facing feature, setting, label, or workflow. The help articles that mention "magic code" cover login/account verification and 2FA — not the modal-presentation behavior during payment, which is not documented on the help site. There is nothing in docs/articles that describes this flow and would become inaccurate as a result of the revert.

@jasperhuangg, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review

Note: no help site PR was created because no documentation changes are required. If you believe an article should be updated, let me know which flow to document and I'll draft one.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 failure ❌
🍎 iOS 🍎 failure ❌

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/jasperhuangg in version: 9.4.35-1 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 No help site changes required.

This PR reverts #93087, and the diff is entirely internal implementation detail:

  • src/components/SettlementButton/index.tsx — reverts the payment-flow guard logic back to inline navigation to the verify-account (magic code) screen.
  • src/hooks/useVerifyAccountAndResume.ts + tests — deleted (the hook introduced by Fix magic code navigates back on payment (SettlementButton) #93087).
  • src/components/WideRHPContextProvider/useShouldRenderOverlay.ts — reverts an overlay-animation edge-case guard.

None of this changes documented, user-facing behavior. The underlying flows (paying an expense, verifying an account with a magic code) are unchanged from the user's perspective — only the internal navigation/resume mechanics differ. I searched docs/articles for the relevant topics (magic code, verify/validate account, payment) and found no article that documents the specific navigation behavior affected here, so there is nothing to update.

No draft docs PR was created since there are no documentation updates to make. @jasperhuangg, let me know if you'd like me to re-check any specific article.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.4.35-6 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CP Staging marks PRs that have been CP'd to staging Ready To Build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants