Skip to content

Let users attach and replace receipts on created odometer expenses - #104375

Merged
lakchote merged 2 commits into
mainfrom
claude-allowOdometerReceiptAttach
Oct 20, 2026
Merged

lakchote merged 2 commits into
mainfrom
claude-allowOdometerReceiptAttach

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Users couldn't add a receipt to a created odometer expense. Clicking the receipt area did nothing, and dropping a file created a separate scan expense. Once a receipt was on the expense, Replace was also hidden.

This PR makes two changes:

  1. Receipt permission: canEditFieldOfMoneyRequest (the RECEIPT branch in ReportUtils.ts) allowed only manual distance expenses, so canEditReceipt was false for odometer. That disabled ReceiptEmptyState, and useShouldAddOrReplaceReceipt returned false, so useReceiptDrop fell back to creating a new scan expense. The check now also allows isOdometerDistanceRequest. This fixes the click, file picker, and drop paths, and enables Delete, Rotate, and Crop the same way they work for manual distance. Map and GPS distance expenses stay locked.
  2. Replace lock: TransactionReceiptModalContent treated every odometer receipt as stitched (isOdometerDistanceRequest && !imageType), so Replace was hidden even on created expenses. The stitcher only builds the receipt from the odometer photos while the expense is a draft. The lock now also requires isDraftTransaction. Replace stays hidden in the create flow and shows on created expenses. This doesn't depend on the filename, so ordinary uploads and receipts built from one photo are handled the same way.

Tests:

  • canEditFieldOfMoneyRequestTest: receipt edit and delete are allowed for odometer, edit is allowed for manual distance, and edit is still blocked for map distance.
  • New TransactionReceiptOdometerReplaceTest: Replace shows for a created odometer expense and stays hidden for an odometer draft.
  • Without the source changes, the odometer permission test and the created-expense Replace test both fail.

Fixed Issues

$ #104349
PROPOSAL: #104349 (comment)

Tests

Use a test workspace with a distance rate and dummy images.

  1. Create an odometer expense without photos; attach a receipt.
  2. Replace, reload and reopen it. Verify the same expense retains the receipt, distance and amount, without creating another expense.
  3. Rotate, crop, delete and reattach it. Cancel replacement; verify the receipt remains.
  4. On Android native, replace a receipt on an expense created with odometer photos.
  5. On Safari, verify individual draft photos remain editable but the combined draft receipt has no Replace. Verify manual-distance replacement works, invalid files preserve the receipt, and map receipts remain protected.
  • Verify that no errors appear in the JS console

Offline tests

Replace a cached odometer receipt offline, reconnect and reload. Verify the receipt persists on the same expense with unchanged distance and amount.

QA Steps

  1. Same as Tests and Offline tests.
  2. Verify desktop drag-and-drop attaches/replaces on the same expense, and GPS receipts remain protected.
  • 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: Native
Android-pr104375.mp4
Android-pr104375-cancel-and-persistence.mp4
Android: mWeb Chrome
Android-mWeb-pr104375.mp4
Android-mWeb-pr104375-persistence.mp4
iOS: Native
ios-pr104375.mp4
iOS: mWeb Safari
ios-mWeb-pr104375.mp4
MacOS: Chrome / Safari

Chrome recording (partial)

Chrome-pr104375-receipt-replacement.mp4

The receipt permission check only allowed manual distance expenses, so the
receipt area on an odometer expense was disabled and a dropped file created a
new scan expense. The Replace button was also hidden for every odometer
receipt, though the photo-stitched receipt only exists while the expense is a
draft.

Co-authored-by: Nyoman Jyotisa <nyomanjyotisa@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team October 19, 2026 17:09
@melvin-bot melvin-bot Bot added Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web labels Oct 19, 2026
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I created this PR from an upstream branch because I couldn't find a fork of App under nyomanjyotisa that I can push to.

To take ownership of this branch and push updates, run:

git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-allowOdometerReceiptAttach
git checkout -b claude-allowOdometerReceiptAttach upstream/claude-allowOdometerReceiptAttach
git push -u origin claude-allowOdometerReceiptAttach

Then you can close this PR and open a new one from your fork.

Co-authored-by: Nyoman Jyotisa <nyomanjyotisa@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Fixed the failing Oxfmt check: tests/unit/canEditFieldOfMoneyRequestTest.ts had the type-fest import in the wrong group. I ran npm run fmt and pushed the reformatted file in 3bf84dc.

Check independent approval is also failing. It needs a reviewer's approval, not a code change.


view run

@MelvinBot

MelvinBot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ✅ pass

On standalone Android NewDot, you can now attach and replace a receipt on a created Odometer expense, and Replace stays hidden on the draft odometer-photo receipt. The PR's Tests section is still empty, so these steps come from the linked issue's reproduction steps and the PR description.
Draft receipt viewer with only Rotate/Crop, no Replace

Step Status
Global create (+) → Track distance → Odometer tab is shownTrack distance shows the Map/Manual/GPS/Odometer tabs. Tapping Odometer shows the Start reading and End reading fields.
Odometer tab selected on Track distance screen
✅
Enter start/end odometer readings and create the distance expenseStart 1000, End 1050 gave a total of 50 mi. Confirmation showed Default Rate, Car, $38.00. Create expense produced "50.00 mi @ $0.76/mi (odometer start: 1000, odometer end: 1050), $38.00".
Start/End readings entered, total distance 50 mi
Created odometer expense in Spend > Expenses list
✅
Open the created Odometer expense; empty receipt placeholder is shownThe expense view shows an empty Receipt placeholder with an "Upload receipt" control.
Empty receipt placeholder on created Odometer expense
✅
Tapping the receipt area opens a working receipt pickerTapping the placeholder opened the Receipt screen with the camera and Take photo / Choose from gallery / Choose file options. Before the fix, this tap did nothing.
Receipt capture screen opened from tapping the empty receipt area
✅
The image attaches to the same Odometer expense (no separate scan expense)A camera capture attached in place. The same expense (50.00 miles, $38.00, Default Rate) now shows "View attachment" and "Add additional receipt". No new expense appeared. The emulator camera renders a garbled image, but it is a valid attachment.
Receipt image attached to the same Odometer expense
✅
The receipt viewer on the created expense shows ReplaceThe receipt viewer shows Rotate, Crop, and Replace.
Receipt viewer on created expense showing Rotate/Crop/Replace
✅
Regression: Replace stays hidden on the draft odometer receiptAn unsubmitted Odometer draft with an odometer-start photo showed a receipt preview. Its viewer showed only Rotate and Crop, and the More menu had only Download. No Replace option appeared.
Unsubmitted draft confirmation screen showing a receipt preview
Draft receipt viewer with only Rotate/Crop, no Replace
✅

view run · view recording

@MelvinBot

MelvinBot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ⚠️ partial

On dev NewDot web, the Odometer tab, expense creation, and the empty receipt area on a created Odometer expense all work. The Web test tool can't upload or drag-and-drop files, so I couldn't run the attach, Replace, or drop steps here. The earlier Android run covered attach and Replace.
Draft Confirm details panel showing no receipt preview

Step Status
Global create (+) → Track distance → Odometer tab is shownTrack distance shows the Map/Manual/GPS/Odometer tabs. Odometer shows the Start reading and End reading fields and the odometer photo buttons.
Track distance screen on the Odometer tab
✅
Enter start/end odometer readings and create the distance expenseStart 1000, End 1050. Confirmation showed 50.00 miles, Default Rate, $38.00. Create expense showed "Expense added" and the row "50.00 mi @ $0.76/mi (odometer start: 1000, odometer end: 1050)".
Confirm details screen for the Odometer expense before creation
✅
Open the created Odometer expense; empty receipt area is shownThe expense view shows a Receipt panel with "Add a receipt / or drag and drop one here".
Expense view showing empty Add a receipt area on the odometer expense
✅
Clicking the receipt area opens a file picker (not disabled)The "Upload receipt" control is enabled and visible. Clicking it caused no error or navigation. Headless Chrome does not show the native file picker, so this run can't confirm that the picker opened.
Expense view immediately after clicking the empty receipt area
⚠️
Uploaded image attaches to the same Odometer expense (no separate scan expense)Not run. The Web test tool does not support file uploads.
⚠️
The receipt viewer shows Replace for the attached receiptNot run. This step needs the uploaded receipt from the previous step.
⚠️
Drag-and-drop onto a second Odometer expense attaches the receipt (no new scan expense)Not run. The Web test tool can't simulate a file drop. A second Odometer expense (2000 → 2075) reached Confirm details, but it was not created.
⚠️
Regression: Replace stays hidden on the draft odometer receiptObservation only: no odometer photos were taken, so the draft Confirm details screen showed no receipt preview to inspect. The draft was discarded and not submitted.
Draft Confirm details panel showing no receipt preview
⚠️

view run · view recording

@nyomanjyotisa

Copy link
Copy Markdown
Member

@lakchote While testing this PR, I found a pre-existing accessibility issue: ReceiptEmptyState uses imagebutton, so Safari VoiceOver announces “Upload receipt group” instead of identifying the button.

Changing the role to button fixes the announcement and preserves Android picker activation/cancellation. The diff is four changed lines, including regression assertions.

May I handle this separately under the C+ small-fix process?

@nyomanjyotisa

Copy link
Copy Markdown
Member

@lakchote I also reproduced a pre-existing receipt return-focus issue on main: after replacement, VoiceOver can remain on “Choose file” instead of returning to “View attachment.”

The receipt preview and expand controls are remounted during loading. Keeping them mounted fixes the tested Safari/VoiceOver replacement and cancellation flows; cross-platform validation remains incomplete.

The candidate is 14 changed lines excluding tests, or 76 including regression tests. Since the C+ small-fix guidelines require fewer than 20 lines without specifying a test exclusion, could you confirm whether it qualifies or should be tracked separately?

@lakchote

Copy link
Copy Markdown
Contributor

@nyomanjyotisa Yes, go ahead with the ReceiptEmptyState role fix as its own PR.

For the return-focus one, I'd track it separately regardless of how the tests count. It changes the receipt view every expense uses, and it hasn't been checked on all platforms yet. Can you report it in #expensify-bugs with the repro on main?

Neither of these blocks this PR.

@nyomanjyotisa

Copy link
Copy Markdown
Member

@MelvinBot please replace ### Tests through ### Screenshots/Videos with the following.

Updated testing, checklist, and recordings

Tests

Use a test workspace with a distance rate and dummy images.

  1. Create an odometer expense without photos; attach a receipt.
  2. Replace, reload and reopen it. Verify the same expense retains the receipt, distance and amount, without creating another expense.
  3. Rotate, crop, delete and reattach it. Cancel replacement; verify the receipt remains.
  4. On Android native, replace a receipt on an expense created with odometer photos.
  5. On Safari, verify individual draft photos remain editable but the combined draft receipt has no Replace. Verify manual-distance replacement works, invalid files preserve the receipt, and map receipts remain protected.
  • Verify that no errors appear in the JS console

Offline tests

Replace a cached odometer receipt offline, reconnect and reload. Verify the receipt persists on the same expense with unchanged distance and amount.

QA Steps

  1. Same as Tests and Offline tests.
  2. Verify desktop drag-and-drop attaches/replaces on the same expense, and GPS receipts remain protected.
  • 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: Native
Android-pr104375.mp4
Android-pr104375-cancel-and-persistence.mp4
Android: mWeb Chrome
Android-mWeb-pr104375.mp4
Android-mWeb-pr104375-persistence.mp4
iOS: Native
ios-pr104375.mp4
iOS: mWeb Safari
ios-mWeb-pr104375.mp4
MacOS: Chrome / Safari

Chrome recording (partial)

Chrome-pr104375-receipt-replacement.mp4

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I replaced everything from ### Tests through ### Screenshots/Videos in the PR description with your text. The sections above it, including Explanation of Change and Fixed Issues, are unchanged.

I left out the outer <details> wrapper ("Updated testing, checklist, and recordings"). That way, Tests, QA Steps and the checklist stay visible as normal sections. Let me know if you want that wrapper added.


view run

@nyomanjyotisa

Copy link
Copy Markdown
Member

@MelvinBot please mark this PR as ready for review.

@MelvinBot
MelvinBot marked this pull request as ready for review October 20, 2026 12:17
@MelvinBot
MelvinBot requested a review from a team as a code owner October 20, 2026 12:17
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I marked this PR as ready for review.


view run

@melvin-bot
melvin-bot Bot requested review from nyomanjyotisa and removed request for a team October 20, 2026 12:17
@melvin-bot

melvin-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

@nyomanjyotisa 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]

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T12:23:12.822804Z 3bf84dc Draft marked ready
ℹ️ 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.

@melvin-bot
melvin-bot Bot removed the request for review from a team October 20, 2026 12:17
@nyomanjyotisa

Copy link
Copy Markdown
Member

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

Android: HybridApp
Android-pr104375.mp4
Android-pr104375-cancel-and-persistence.mp4
Android: mWeb Chrome
Android-mWeb-pr104375.mp4
Android-mWeb-pr104375-persistence.mp4
iOS: HybridApp
ios-pr104375.mp4
iOS: mWeb Safari
ios-mWeb-pr104375.mp4
MacOS: Chrome / Safari
Chrome-pr104375-receipt-replacement.mp4
Chrome-pr104375-drag-drop.mp4

@nyomanjyotisa nyomanjyotisa left a comment

Copy link
Copy Markdown
Member

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 lakchote October 20, 2026 12:38

@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

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

Looks good, a few NABs.


const receiptFilename = transaction?.receipt?.filename;
const isStitchedOdometerReceipt = isOdometerDistanceRequest(transaction) && !imageType;
// Odometer photos are stitched into the receipt only while the expense is a draft, so a created expense's receipt can be replaced like any other

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.

NAB: we also call open reports "Draft" in the UI, so this reads like it's about the report status. Maybe "Odometer photos are only stitched into the receipt during the create flow, so a created expense's receipt can be replaced like any other"?

renderReceiptModal({reportID: TRANSACTION_THREAD_REPORT_ID, transactionID: TRANSACTION_ID});
await waitForBatchedUpdatesWithAct();

// Then Replace is shown, because the stitcher no longer owns the receipt once the expense is created

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.

NAB: "the stitcher no longer owns the receipt" is a bit hard to parse. Maybe "because odometer photos are only stitched during the create flow"?


it('should not let the submitter edit the receipt on a map distance expense', async () => {
// Given a map distance expense, whose receipt is generated from the route
const mapTransaction = createDistanceTransaction(CONST.IOU.REQUEST_TYPE.DISTANCE_MAP);

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.

NAB: the description says GPS stays locked too, could we add a GPS case next to the map one? An it.each over DISTANCE_MAP and DISTANCE_GPS would cover it.

@lakchote
lakchote merged commit 0798bfe into main Oct 20, 2026
42 of 44 checks passed
@lakchote
lakchote deleted the claude-allowOdometerReceiptAttach branch October 20, 2026 17:38
@github-actions

Copy link
Copy Markdown
Contributor

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

@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

🚀 Deployed to staging by https://github.com/lakchote in version: 9.5.15-1 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No help site update is needed. This is a bug fix: it lets the existing receipt actions work on created odometer expenses, as users would expect, and no article says they can't.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/grgia in version: 9.5.15-3 🚀

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

Bundle Size Analysis (Sentry):

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

Labels

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants