Skip to content

feat: remove isNewManualExpenseFlowEnabled beta flag#96228

Open
thelullabyy wants to merge 1 commit into
Expensify:mainfrom
thelullabyy:fix-part-2/93854
Open

feat: remove isNewManualExpenseFlowEnabled beta flag#96228
thelullabyy wants to merge 1 commit into
Expensify:mainfrom
thelullabyy:fix-part-2/93854

Conversation

@thelullabyy

@thelullabyy thelullabyy commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Fixed Issues

$ #93854
PROPOSAL:

Tests

  1. Login to ND
  2. Verify that new manual expense flow works as default
  3. Try to create expense
  4. Verify create expense flow works correctly
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  1. Login to ND
  2. Verify that new manual expense flow works as default
  3. Try to create expense
  4. Verify create expense flow works correctly
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Screen.Recording.2026-07-17.at.18.53.35.mov
Screen.Recording.2026-07-17.at.18.54.33.mov
Screen.Recording.2026-07-17.at.18.55.23.mov
Android: mWeb Chrome
iOS: Native
Screen.Recording.2026-07-17.at.18.49.29.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-06-21.at.15.43.27.mov
Screen.Recording.2026-07-17.at.18.42.39.mov
Screen.Recording.2026-07-17.at.18.43.43.mov
Screen.Recording.2026-07-17.at.18.44.31.mov

@thelullabyy
thelullabyy marked this pull request as ready for review July 16, 2026 00:03
@thelullabyy
thelullabyy requested review from a team as code owners July 16, 2026 00:03
@melvin-bot
melvin-bot Bot requested review from ZhenjaHorbach and joekaufmanexpensify and removed request for a team July 16, 2026 00:03
@melvin-bot

melvin-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

@ZhenjaHorbach 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 16, 2026 00:03
@thelullabyy

Copy link
Copy Markdown
Contributor Author

Hey @ZhenjaHorbach, sorry but I think @ikevin127 will be reviewer of this PR. We worked on this but got reverted here #94134

@codecov

codecov Bot commented Jul 16, 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 Δ
src/CONST/index.ts 94.81% <ø> (ø)
...onents/MoneyRequestConfirmationFields/Provider.tsx 100.00% <ø> (ø)
...mponents/MoneyRequestConfirmationFields/context.ts 80.00% <ø> (ø)
src/components/MoneyRequestConfirmationList.tsx 96.85% <100.00%> (+2.15%) ⬆️
...stConfirmationList/hooks/useConfirmationCtaText.ts 100.00% <100.00%> (+3.44%) ⬆️
...onfirmationList/hooks/useConfirmationValidation.ts 83.33% <100.00%> (ø)
...stConfirmationList/hooks/useFormErrorManagement.ts 90.38% <100.00%> (ø)
...eyRequestConfirmationList/sections/AmountField.tsx 42.98% <100.00%> (-0.99%) ⬇️
...oneyRequestConfirmationList/sections/DateField.tsx 58.69% <100.00%> (-19.57%) ⬇️
...uestConfirmationList/sections/DescriptionField.tsx 70.00% <100.00%> (-6.67%) ⬇️
... and 11 more
... and 16 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: 09e08eaa33

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@joekaufmanexpensify joekaufmanexpensify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good for product

@ikevin127

ikevin127 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Screen.Recording.2026-06-21.at.18.17.32.mov

@ikevin127 ikevin127 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rework Verification — #96228 vs reverted #94134 (issue #93854)

What happened with the original PR

#94134 (identical title, same issue #93854) was merged 2026-06-22, deployed to staging as 9.4.17-0, and immediately generated ~18 deploy blockers, then was reverted. The rework #96228 is functionally the same flag removal. The re-land strategy is the standard one: each blocker bug was fixed on main while the beta flag still shielded production, and #96228 now flips the flag to expose those already-fixed paths. All 18 blockers are now CLOSED or Awaiting Payment, which means their fixes were merged and QA'd. So the rework is only safe if (a) every fix is actually in main, and (b) the flag flip exposes the fixed path and doesn't reintroduce old code.

⚠️ The one structural difference between the two PRs

The reverted #94134 modified shouldEnableNegative in src/libs/ReportUtils.ts (dropped the isNewManualExpenseFlow param and applied the P2P-recipient negative exclusion to all callers). #96228 does NOT touch ReportUtils.ts — it hardcodes true only at the AmountField call site (AmountField.tsx:122) and leaves every other caller (including the submission path IOUAmountSubmission.ts:209) on the old default-false behavior.

This turns out to be OK, because the negative-amount blocker is now fixed by a different mechanism that lives in main and is exposed by this PR:

  • IOURequestStepConfirmation.tsx:994shouldExcludeP2P={(transaction?.amount ?? 0) < 0} on the now-unconditionally-rendered ParticipantPicker
  • which flows to ParticipantSearchResults.tsx:191/242includeP2P/includeUserToInvite: ... && !shouldExcludeP2P
  • plus the isValidMoneyRequestAmount(iouAmount, iouType, true, isP2P) guard in useConfirmationValidation.ts

So the negative case is guarded at the picker/validation layer rather than in shouldEnableNegative. Recommend the author still sanity-check that there's no path to a negative P2P submission that bypasses the picker exclusion, since the shouldEnableNegative divergence means the two PRs are not behaviorally identical there.


Blocker-by-blocker verification

✅ Verified fixed in the exposed code path (found in current code / this diff):

# Blocker Fix confirmed
94261 Negative amount submittable to user from self DM shouldExcludeP2P={amount<0} wired through ParticipantPicker → ParticipantSearchResults (includeP2P/includeUserToInvite gated) — verified end-to-end
94244 Distance expense created when date removed shouldShowConfirmationDate returns true for isDistanceRequest, and useConfirmationValidation now unconditionally blocks on shouldShowDate && !isReadOnly && isCreatedMissing(transaction)
94266 "This field is required" shown twice useFormErrorManagement dedups common.error.fieldRequired/invalidMerchant inline (in diff)
94264 Tax decimal removed → replaced with 0 TaxFields.tsx numeric-compare useEffect ("must not be overwritten while typing") now unconditional (in diff)
94246 Clicking outside RHP doesn't close creation RHP onBackdropPress={() => Navigation.dismissModal()} on the now-unconditional ParticipantPicker (in diff)
94263 Invoice reselect same user → wrong RHP useReportSelectionActions simplified to Navigation.goBack(backTo) (in diff)
94233 / 94273 Autofocus / fields unfocus after each input AmountField.tsx autofocus useEffect (deferred focus past picker-close) present in diff

🔶 FOR PR AUTHOR: Cannot verify statically — the residual re-revert risk (requires explicit re-test on this build):

# Blocker Why it needs manual re-test
94289 (OPEN) Distance expense to a new/invited user shows error Depends on invite-participant handling (users with no reportID/accountID); not verifiable by reading web code
94282 (OPEN, Overdue) Submissions disabled → expense created in wrong report with error Depends on useDefaultParticipants auto-report logic (shouldAutoReport/getPolicyExpenseChat), which this PR modifies — highest-risk of the set
94255 Android: cursor before negative sign, number disappears Native NumberWithSymbolForm behavior — Android only
94258 Android: unable to enter multi-line description Native DescriptionField behavior — Android only
94274 Android & iOS: description field not visible when focused Native scroll-into-view — device only
94262 Keyboard closes after entering number, report opens in background Native keyboard/nav timing
94259 Android: returns to workspace chat after QAB flow Native navigation
94271 iOS: returns to "Spend" briefly after closing confirm page iOS navigation timing
94234 Referral RHP only opens after returning from participant list Navigation timing
94260 Android: referral banner behind navigation bar Native layout / safe-area

Verdict

The rework is structurally sound and most blockers are provably addressed in the exposed code paths — this is a real re-land (fixes on main + flag flip), not a blind re-merge of the reverted change. But two things keep it from being a clean "safe to merge":

  1. The flag flip re-exposes all 18 blocker scenarios at once. ~7 are verified in code; the remaining ~11 (all the native-platform and navigation-timing ones, plus the two still-open feature bugs 94282 and 94289) can only be confirmed by re-running those exact repro steps on this build, on Android native, iOS native, and mWeb. Given the original had zero screenshots filled in and was reverted for exactly these, I'd block merge on a completed all-platform QA pass against the full blocker list — not "Same as tests."
  2. 94282 is the single highest risk: it's still OPEN + Overdue (seems a fix was shipped since payment is due), this issue is about the useDefaultParticipants auto-report path that this PR directly edits, and it's a "doesn't exist in prod" new-feature bug — exactly the kind of thing that slips through unit tests and re-triggers a deploy blocker.

Recommendation to the author: in the PR's Tests/QA sections, replace the generic 4-step script with the explicit repro steps from #94282, #94289, #94261, #94244 and the Android-native ones (#94255, #94258, #94274), and attach the all-platform videos. That's the concrete difference between this landing and getting reverted a second time.

cc @thelullabyy

@thelullabyy

Copy link
Copy Markdown
Contributor Author

@ikevin127 I uploaded recordings for regressions, kindly check again

@ikevin127 ikevin127 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 LGTM - Tests well

cc @puneetlath coming from the issue, if you could assign me as I was reviewing on the previously now reverted PR, then if all good to you, we can merge.

@melvin-bot
melvin-bot Bot requested a review from puneetlath July 17, 2026 22:55
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.

3 participants