Fix: open referral RHP on first click in new manual expense flow#94546
Fix: open referral RHP on first click in new manual expense flow#94546MelvinBot wants to merge 2 commits into
Conversation
Co-authored-by: thelullabyy <thelullabyy@users.noreply.github.com>
|
@MelvinBot Please merge main. After that replace all |
…ManualExpense Co-authored-by: thelullabyy <thelullabyy@users.noreply.github.com>
|
@thelullabyy 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] |
|
🤖 Done:
|
|
🤖 I looked into the failing checks and there's nothing to fix — no functional check is failing. Current status: 31 passing, 0 failing, 4 skipped, and 2 still running (the The red ❌ you likely saw was a transient PR Author Checklist run that has already been superseded by a passing run — that check just needs the human checklist filled in and isn't something I act on. All the substantive CI is green: TypeScript, all 8 Jest jobs, ESLint, Prettier, Bun tests, Storybook, the builds, Knip, and spellcheck. No code changes were needed, so I haven't pushed anything. If a check flips to a real failure after the perf benchmarks finish, re-ping me and I'll dig in. |
Explanation of Change
In the new manual expense flow (
isNewManualExpenseFlowEnabledbeta), the To participant selector is no longer a navigation screen — it's a JSRIGHT_DOCKEDModal(ParticipantPicker) whose visibility is driven by local React state inIOURequestStepConfirmation, layered on top of the confirmation RHP.When the referral banner at the bottom of the picker was pressed,
ReferralProgramCTAcalledNavigation.navigate(...)which swapped the underlying RHP to the referral panel, but nothing dismissed the still-mounted picker overlay. So the picker covered the freshly-presented referral RHP and the user saw "nothing happened." Tapping back closed the picker overlay, revealing the referral RHP that had been underneath the whole time — matching the reported "only opens after returning from participant list."By contrast,
NewChatPageuses the sameReferralProgramCTAand works because there the participant selector is a top-level RHP screen, so navigating to referral replaces it on the same modal stack with nothing layered on top.Fix: give
ReferralProgramCTAan optionalonBeforeNavigatecallback that fires right before it navigates, and thread the picker's existingcloseParticipantPicker/onClosehandler down to it (ParticipantPicker→MoneyRequestParticipantsSelector→ParticipantSearchResults→ParticipantSelectorFooter→ReferralProgramCTA). Pressing the banner now dismisses the picker overlay first, so the referral RHP is revealed immediately. The prop is optional, soNewChatPageand every otherReferralProgramCTAcaller are unchanged.A navigation-listener / focus-based auto-dismiss was considered but rejected: the referral route is a dynamic route appended to the current route's path (an overlay on the same screen), so the confirmation screen does not blur and
useIsFocusedwould not flip. The explicit close-before-navigate approach is deterministic.Fixed Issues
$ #94234
PROPOSAL: #94234 (comment)
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review".
// Please describe what tests you performed that validate your changes worked.
Offline tests
Same as tests.
QA Steps
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari