Skip to content

Add Create report and None options to the Report field when creating an expense - #107924

Open
DylanDylann wants to merge 11 commits into
Expensify:mainfrom
DylanDylann:dylann/101573-report-create-and-none-v2
Open

DylanDylann wants to merge 11 commits into
Expensify:mainfrom
DylanDylann:dylann/101573-report-create-and-none-v2

Conversation

@DylanDylann

@DylanDylann DylanDylann commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

This version fixed 3 regressions: #106693, #106696 and #106697

From #105028 (comment)

When you create an expense, the report list now always starts with two options: Create report and None.

  • None leaves the new expense off any report. It moves the draft to your self DM, the same as picking yourself as the recipient, and switches the form to a track expense so the category, tax and distance rate fields match. It shows in both the anchored dropdown and the full-page picker for submit, create and track expenses. It's hidden for per diem and time expenses (they only exist on a workspace), splits, invoices, and when editing a saved expense.
  • Create report now makes the report on the workspace the expense is going to, instead of your default workspace.
  • Since those two options are always there, the Report row can always be opened while creating an expense, even when the workspace has no open report. It stays locked when you create an expense from inside an expense report, and when you edit an expense that's on a report and there's no other report to move it to.
  • When no report is picked yet, the full-page picker opens from the chat the expense is being created in, not from a placeholder report ID.
  • Moving a draft to the self DM (participants, unreported report ID, distance rate) now lives in moveMoneyRequestDraftToSelfDM, so the participant picker and the None option share it.

This PR doesn't change the default report. It's still the open report on the expense's workspace, or New report when that workspace has none.

Fixed Issues

$ #101573
PROPOSAL:

Tests

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

Precondition: two workspaces, A (your default) and B, where B has no open report.

  1. In workspace B's chat, start a manual expense and go to the confirmation page. Verify the Report field shows "New report" and can be opened, even though B has no open report.
  2. Open the Report field. Verify the list starts with Create report and None.
  3. Pick Create report. Verify the new report is made on workspace B, not on A.
  4. Start another expense in B's chat, open Report and pick None. Verify:
    • the Report field shows "None";
    • the form switches to a track expense (the confirm button tracks it instead of submitting);
    • after confirming, the expense shows in your personal space and not on a report.
  5. Repeat step 4 with the full-page report picker (without the anchoredFieldDropdowns beta, or on a narrow screen). Verify the same result.
  6. Start a per diem, a time, a split and an invoice expense. Verify None is not in the report list for any of them.
  7. Inside an open expense report, add an expense with the + button. Verify the Report field is locked.
  8. Open a saved expense on a report while no other open report exists. Verify the Report field is locked. Create a second report, then verify it opens with no None option.
  9. In a workspace that has an open report, start an expense. Verify the Report field still defaults to that report.

Extra precondition for steps 13 to 17: A and B each have a distance rate, with different amounts (e.g. A $0.70 / mile, B $0.50 / mile), and B has an open report (the one from step 3 works).

  1. In workspace B's chat, start a manual expense, open Report and pick None.
  2. Open Report again. Verify the Create report row shows workspace B's name, not A's.
  3. Pick Create report. Verify the Report field shows the new report and the confirm button submits the expense instead of tracking it. Confirm, then verify the expense is on a new report in workspace B.
  4. In workspace B's chat, start a distance expense and go to the confirmation page. Verify the Rate field shows B's rate.
  5. Open Report and pick None. Verify the Rate field switches to A's rate and shows no error.
  6. Open Report again and pick B's open report. Verify the Rate field switches back to B's rate, the amount is recalculated with it, no rate error shows, and the confirm button submits the expense instead of tracking it.
  7. Confirm. Verify the expense is on that report with B's rate.
  8. Repeat steps 13 to 15, but pick Create report instead of B's open report. Verify the same rate result, and that the new report is made on workspace B.
  • 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 verified any copy / text that was added to the app 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 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 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.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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: HybridApp
Screen.Recording.2026-11-25.at.16.46.59.mov
Android: mWeb Chrome
Screen.Recording.2026-11-25.at.16.33.30.mov
iOS: HybridApp
Screen.Recording.2026-11-25.at.16.59.44.mov
iOS: mWeb Safari
Screen.Recording.2026-11-25.at.16.56.53.mov
MacOS: Chrome / Safari
Screen.Recording.2026-11-25.at.16.30.05.mov

@DylanDylann
DylanDylann requested review from a team as code owners November 25, 2026 07:14
@expensify-chore-bot
expensify-chore-bot Bot requested review from ikevin127 and thelullabyy and removed request for a team November 25, 2026 07:14
@expensify-chore-bot

Copy link
Copy Markdown

@ikevin127 @thelullabyy One of you needs to 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]

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T07:34:04.320281Z 6553509 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@expensify-chore-bot
expensify-chore-bot Bot requested review from JmillsExpensify and removed request for a team November 25, 2026 07:14
@codecov

codecov Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/CONST/SENTRY_LABEL.ts 100.00% <ø> (ø)
...onents/MoneyRequestConfirmationFields/Provider.tsx 100.00% <100.00%> (ø)
...mponents/MoneyRequestConfirmationFields/context.ts 83.33% <ø> (ø)
...tConfirmationList/hooks/useConfirmationListData.ts 98.57% <100.00%> (+0.01%) ⬆️
...tConfirmationList/sections/ReportFieldDropdown.tsx 96.55% <100.00%> (+0.12%) ⬆️
...MoneyRequestConfirmationList/sections/selectors.ts 91.66% <ø> (ø)
...stConfirmationListFooter/ConfirmationFieldList.tsx 100.00% <100.00%> (ø)
...firmationListFooter/fieldGroups/fieldVisibility.ts 77.77% <ø> (ø)
src/hooks/useConfirmationParticipantSelection.ts 92.30% <100.00%> (+1.89%) ⬆️
src/libs/IOUUtils.ts 84.61% <100.00%> (+0.28%) ⬆️
... and 8 more
... and 7403 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: 6553509800

ℹ️ 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".

Comment thread src/pages/Share/SubmitDetailsPage.tsx Resolved
@DylanDylann
DylanDylann removed the request for review from thelullabyy November 25, 2026 07:44
@DylanDylann

Copy link
Copy Markdown
Contributor Author

@JmillsExpensify @trjExpensify #106701 came from my original PR #105939, which added None to the Report field, and QA reported it as a regression from that PR. I wanted to check with you before making a fix.

When you create an expense and pick Create report, you land inside the new report. When you pick None, the expense goes to your self DM and you land on the self DM chat, without the new expense opened. QA flagged that as inconsistent. Landing on the self DM is what already happens whenever you track an expense to yourself, and None does the same thing as picking yourself as the recipient. If we open the expense after None, picking yourself would need the same change, or the two would behave differently.

My suggestion is to keep the self DM landing and treat #106701 as expected behavior. If you'd rather have None open the created expense, I'm happy to add it in #107924. Which do you prefer?

@trjExpensify

Copy link
Copy Markdown
Contributor

When you create an expense and pick Create report, you land inside the new report. When you pick None, the expense goes to your self DM and you land on the self DM chat, without the new expense opened.

Sounds like a bug in that "Create report" case. Here's how it's intended to work, and largely does on staging AFAIK.

If you create an expense when on the Inbox tab.

  • Land in the workspace chat (if it's being reported), the preview of the expense report is updated with the new addition.
  • Land in the SelfDM (if it's being created unreported), the unreported expense is added there.
  • Land in the DM (if it's a P2P request for the IOUReport), the preview of the IOUReport is updated with the new addition.

If you create an expense when on any other tab in the app (I.e Home, Spend, Workspaces etc).

  • Land on Spend > Expenses tab, the expense is added to the table.

If you create an expense from inside a specific expense report/IOU report

  • Stay on that report view, wherever you are viewing it. (The only option in this case is for the expense to be added to that report, so there's no nav consideration basically).

Copy link
Copy Markdown
Contributor

Sounds good to me

@ikevin127

ikevin127 commented Nov 25, 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 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
    • 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
    • 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 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.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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

MacOS: Chrome / Safari
pr107924-ctest-after-fix.mp4

@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.

@DylanDylann requesting changes. There are two blockers: picking None in the report picker switches the form to track and never switches it back, and on Share, None hides the Report row with no way to undo it.

The Tests and Offline tests sections are also empty apart from the console check. Please fill both in.

Blockers issues reproduced:

⚠️ Before Fix With Fix (applied locally)
pr107924-ctest-before-fix.mp4
pr107924-ctest-after-fix.mp4

Comment thread src/pages/Share/SubmitDetailsPage.tsx Resolved
Comment thread src/CONST/SENTRY_LABEL.ts Resolved

@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.

@DylanDylann requesting changes, non-blockers only: the track type now switches back after None. Two things are still open: the distance rate isn't re-resolved when a report is picked after None, and Create report after None lands on the default workspace.

@JmillsExpensify JmillsExpensify 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.

No product review required.

@DylanDylann

Copy link
Copy Markdown
Contributor Author

@ikevin127 Can you take a look 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.

@DylanDylann requesting changes, non-blockers only: the rate and Create report fixes work.

Still open: after None, the Create report row still shows the default workspace's name.

Please also add QA steps for None → Create report and None → pick report on a distance expense.

@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

@melvin-bot
melvin-bot Bot requested a review from puneetlath November 27, 2026 07:36
@DylanDylann
DylanDylann requested review from mountiny and removed request for puneetlath November 27, 2026 07:38

@mountiny mountiny 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.

Requesting changes for one bug on the Share page. The flows already covered in this review work for me.

  1. Blocker: on Share, picking a report after None gets undone, and the expense goes on a different report (inline on SubmitDetailsPage.tsx).
  2. Picking a report after None keeps the category and tag from the default workspace (inline on useReportPickerActions.ts).
  3. NAB: the None row isn't marked as selected after you pick it (inline on IOURequestEditReportCommon.tsx).

Comment thread src/pages/Share/SubmitDetailsPage.tsx Resolved
@DylanDylann
DylanDylann requested a review from mountiny November 30, 2026 10:00

@mountiny mountiny 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.

All three of my earlier points are fixed, thanks. One bug is left: on a multi-scan draft, None moves every receipt to the self DM, but picking a report afterwards only restores the receipt on screen (handleRegularReportSelection calls setTransactionReport for transaction only), so the other receipts still go through the track path on confirm. Please set reportID and participants on all transactions there, like handleGlobalCreateReport does, and update the PR title, which still describes the ReportField refactor.

@DylanDylann DylanDylann changed the title V2: Refactor ReportField logic to simplify report editability condition Add Create report and None options to the Report field when creating an expense Dec 1, 2026
@DylanDylann

Copy link
Copy Markdown
Contributor Author

One bug is left: on a multi-scan draft, None moves every receipt to the self DM, but picking a report afterwards only restores the receipt on screen (handleRegularReportSelection calls setTransactionReport for transaction only), so the other receipts still go through the track path on confirm

@mountiny I'd leave this as is. After picking None, each receipt becomes its own expense in the self DM and the Report row on each one shows Self DM. Since the expenses now appear separately in the self DM chat, it makes more sense for users to change the report for each one individually

@DylanDylann
DylanDylann requested a review from mountiny December 1, 2026 08:02
@mountiny

mountiny commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

In your video when you choose None then the option disappeared from the form? Is that intentional? Or is that old video?
image

mountiny
mountiny previously approved these changes Dec 1, 2026

@mountiny mountiny 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.

Got one question

@DylanDylann

Copy link
Copy Markdown
Contributor Author

In your video when you choose None then the option disappeared from the form? Is that intentional? Or is that old video?

@mountiny It's intentional. The None option moves the expense to the self DM chat, so if the expense is already in the self DM, None is hidden

This branch has not been deployed

No deployments
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.

5 participants