Derive the distance draft expense type from the selected tab - #97310
Open
wildan-m wants to merge 5 commits into
Open
Derive the distance draft expense type from the selected tab#97310wildan-m wants to merge 5 commits into
wildan-m wants to merge 5 commits into
Conversation
wildan-m
marked this pull request as ready for review
July 29, 2026 16:44
melvin-bot
Bot
requested review from
linhvovan29546
and removed request for
a team
July 29, 2026 16:44
|
@linhvovan29546 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
Bot
requested review from
flaviadefaria
and removed request for
a team
July 29, 2026 16:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
Tapping a Start or Stop waypoint on the Map tab opens the "Not here" page instead of the waypoint editor once an Odometer expense has been created earlier in the session. Leaving the flow clears the draft expense, so reopening it has to derive the expense type again — and that derivation preferred the last distance expense the user created over the tab that is actually on screen. The tab navigator restores the tab that was last selected, so the two disagree as soon as someone creates an Odometer expense and later switches to Map: the visible tab is Map, but the draft is rebuilt as an Odometer expense, which carries no waypoints. The Map tab renders placeholder Start and Stop rows regardless of the underlying draft, so the list looks normal until a row is tapped and the editor finds no waypoints to open.
Deriving the type from the selected tab keeps the rebuilt draft aligned with the tab the navigator is showing, so a Map tab always sits over a map expense with its waypoints seeded. The last-created type stays as the next fallback, so opening the flow before any tab has been selected still lands on the type used last.
Fixed Issues
$ #92598
PROPOSAL: #92598 (comment)
Tests
Offline tests
The rebuilt draft expense is derived entirely from locally stored values, so the behavior is unchanged offline. Turn off the network connection and repeat the steps above; the waypoint editor still opens on the Map tab.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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
Kapture.2026-07-29.at.23.38.56.mp4
Android: mWeb Chrome
Kapture.2026-07-29.at.23.42.39.mp4
iOS: Native
Kapture.2026-07-29.at.23.24.56.mp4
iOS: mWeb Safari
Kapture.2026-07-29.at.23.28.51.mp4
MacOS: Chrome / Safari
Kapture.2026-07-29.at.22.18.58.mp4