Navigate to the clicked expense in a multi-expense report preview (v2) - #97308
Draft
wildan-m wants to merge 1 commit into
Draft
Navigate to the clicked expense in a multi-expense report preview (v2)#97308wildan-m wants to merge 1 commit into
wildan-m wants to merge 1 commit into
Conversation
Tapping a card in the multi-expense report preview carousel opens that expense instead of the parent report. Wide layouts keep the report in the super-wide RHP and cascade the pressed expense on top; narrow layouts open the expense with a single forward navigation, so back returns to the chat. This is v2 of Expensify#92546, which was reverted for five deploy blockers. v1 inserted the parent report beneath the expense so back stopped on the report first -- a spliced stack entry on native, an extra history entry on mobile web. That hand-built stack is gone: it broke whenever another flow mutated it (Expensify#97184 replaced the deleted thread with a duplicate report route, Expensify#97183 left a stale route after a split save, Expensify#97158 crashed resolving duplicates) and on mobile web the extra entry forced a state rebuild that flashed the chat on back. Navigation.ts is untouched by this version. Also guards an expense deleted while offline (Expensify#97149): those rows stay in the carousel but their thread is gone, so pressing one now opens the parent report instead of landing on 'It's not here'.
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
v2 of #92546, which was reverted in #97198 after five deploy blockers.
Tapping a card in the multi-expense Report Preview carousel opens that expense instead of the parent report.
What caused the blockers, and what v2 does about it
v1 inserted the parent report beneath the expense so that back stopped on the report first — a spliced stack entry on native (
Navigation.openExpenseOverParentReport) and an extra history entry on mobile web. Every native blocker traced back to that hand-built stack being mutated by another flow:goBackcouldn't param-match the spliced parent (itsbackToisn't inrouteParamsIgnore) → REPLACE inserted a duplicate report route → back showed the report twiceremoveScreenByKeyonly filters the root navigator, so the stale thread route nested in the split survived → back landed on the LHNv2 removes the splice entirely.
Navigation.tsis untouched by this PR — no custom stack manipulation, nothing for those flows to trip over. #97149 is additionally guarded explicitly: a pending-DELETE press opens the parent report.The trade-off is one intermediate stop: on narrow, back goes expense → chat rather than expense → report → chat. Given #97155 also showed the intended wide cascade being read as a bug, I'd rather ship the simple stack and revisit the extra stop separately if it's wanted.
#97155 was closed with the revert and needs no code change here — it was the intended wide-layout cascade.
Fixed Issues
$ #91042
PROPOSAL: #91042 (comment)
Tests
Offline tests
QA Steps
Same as Tests, plus the regression checks from the reverted PR's blockers: