You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When clicking "Replace," the app navigates to the odometer distance page and then to the odometer image page. I think we should open the picker directly instead of navigating the user back to the odometer image page.
Please re-state the problem that we are trying to solve in this issue.
When clicking "Replace" on an odometer image, the app dismisses the modal, briefly shows the odometer distance page, then navigates to the full odometer image capture page. This creates unnecessary intermediate navigation. We should open the image picker directly instead.
What is the root cause of that problem?
The Replace button's onPress handler in TransactionReceiptModalContent treats odometer images the same way as regular receipts — it calls Navigation.dismissModal() then navigates to the full ODOMETER_IMAGE capture page:
This causes the user to see the distance odometer screen flash before landing on the image capture page, since dismissModal returns to the underlying screen first, and afterTransition then pushes the capture page on top.
What changes do you think we should make in order to solve the problem?
For odometer images, wrap the Replace button with AttachmentPicker (type=IMAGE) and call openPicker directly on press. When the user selects a file, call setMoneyRequestOdometerImage (already imported in the file) with the selected file and close the modal via navigation.goBack(). This skips the intermediate navigation entirely and opens the native file picker immediately.
For non-odometer receipts, keep the existing behavior (dismiss modal → navigate to scan step).
@Julesssss@DylanDylann Oh, okay, I read that completely wrong and thought you don't want to navigate to the odometer image page but open the attachment picker immediately and block the drag&drop this way. Could you clarify this for me a little bit.
You want to get rid of this very, very short period of time when you can see odometer tab after the image preview closes that we can see before the odometer image screen?
If thats what we are talking about then thats exactly what happens for scan as well and it's not caused by wrong navigation as we correctly navigate to odometer image, which can be seen here:
I suggest skipping both the distance page and the odometer image page, and opening the picker right away instead. I think this would provide a better UX, since the odometer image page feels redundant on laptop and I forgot that it serves more purposes on native.
It does serve more purposes on native, but we could go for a platform specific behavior if we would like to. It wouldn't be that hard to distinguish desktop web from other platforms and behave differently.
My concern is that, even on web it provides more functionalities - allows drag&drop, which, in my opinion would be good to have + that's exactly what happens for scan as well. We also show the scan page on web there
I agree, but even if we decide to go ahead with it, then it seems like a very low prio change and we can take care of it later since the behavior aligns across the app. (from the positives I am pretty sure that those are only 2 instances where something like this happens)
I assumed the picker could be shown on top of the previous modal preview.
It's possible, that makes sense. So we go like -> Replace -> show attachment picker -> pick an image -> hide attachment picker -> land on modal image preview with the updated image -> user can close/crop/rotate/replace?
Activity
Open image picker directly when replacing odometer image
wildan-m commentedon Mar 18, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When clicking "Replace" on an odometer image, the app dismisses the modal, briefly shows the odometer distance page, then navigates to the full odometer image capture page. This creates unnecessary intermediate navigation. We should open the image picker directly instead.
What is the root cause of that problem?
The Replace button's
onPresshandler inTransactionReceiptModalContenttreats odometer images the same way as regular receipts — it callsNavigation.dismissModal()then navigates to the fullODOMETER_IMAGEcapture page:App/src/pages/media/AttachmentModalScreen/routes/TransactionReceiptModalContent.tsx
Lines 544 to 567 in 7053fde
This causes the user to see the distance odometer screen flash before landing on the image capture page, since
dismissModalreturns to the underlying screen first, andafterTransitionthen pushes the capture page on top.What changes do you think we should make in order to solve the problem?
For odometer images, wrap the Replace button with
AttachmentPicker(type=IMAGE) and callopenPickerdirectly on press. When the user selects a file, callsetMoneyRequestOdometerImage(already imported in the file) with the selected file and close the modal vianavigation.goBack(). This skips the intermediate navigation entirely and opens the native file picker immediately.For non-odometer receipts, keep the existing behavior (dismiss modal → navigate to scan step).
https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/85716-odometer-replace-picker?expand=1
DylanDylann commentedon Mar 19, 2026
@jakubkalinski0 Let's discuss here
jakubkalinski0 commentedon Mar 19, 2026
@Julesssss @DylanDylann Oh, okay, I read that completely wrong and thought you don't want to navigate to the odometer image page but open the attachment picker immediately and block the drag&drop this way. Could you clarify this for me a little bit.
You want to get rid of this very, very short period of time when you can see odometer tab after the image preview closes that we can see before the odometer image screen?
output.mp4
jakubkalinski0 commentedon Mar 19, 2026
If thats what we are talking about then thats exactly what happens for scan as well and it's not caused by wrong navigation as we correctly navigate to odometer image, which can be seen here:
App/src/pages/media/AttachmentModalScreen/routes/TransactionReceiptModalContent.tsx
Lines 544 to 550 in ced001b
Scan for comparison:
Screen.Recording.2026-03-19.at.10.47.29.mov
DylanDylann commentedon Mar 19, 2026
I suggest skipping both the distance page and the odometer image page, and opening the picker right away instead. I think this would provide a better UX, since the odometer image page feels redundant on laptop and I forgot that it serves more purposes on native.
jakubkalinski0 commentedon Mar 19, 2026
It does serve more purposes on native, but we could go for a platform specific behavior if we would like to. It wouldn't be that hard to distinguish desktop web from other platforms and behave differently.
jakubkalinski0 commentedon Mar 19, 2026
My concern is that, even on web it provides more functionalities - allows drag&drop, which, in my opinion would be good to have + that's exactly what happens for scan as well. We also show the scan page on web there
DylanDylann commentedon Mar 19, 2026
Let’s wait for a final confirmation from Jules first. Since the same behavior occurs in the scan feature, I’m okay with keeping it as is for now.
jakubkalinski0 commentedon Mar 19, 2026
I agree, but even if we decide to go ahead with it, then it seems like a very low prio change and we can take care of it later since the behavior aligns across the app. (from the positives I am pretty sure that those are only 2 instances where something like this happens)
jakubkalinski0 commentedon Mar 19, 2026
Actually, one more question popped into my mind. In this situation:
What will be under the attachment picker? The odometer distance page?
DylanDylann commentedon Mar 19, 2026
I assumed the picker could be shown on top of the previous modal preview.
jakubkalinski0 commentedon Mar 19, 2026
It's possible, that makes sense. So we go like ->
Replace -> show attachment picker -> pick an image -> hide attachment picker -> land on modal image preview with the updated image -> user can close/crop/rotate/replace?Julesssss commentedon Mar 19, 2026
Thats what I was thinking, yeah.
Ah fair point.
Okay so lets forget this improvement in that case. We can rethink about it later but I'm just going to close. No need to fix this.