Fix device back from Submit to my employer confirmation landing on the workspace chat - #97512
Fix device back from Submit to my employer confirmation landing on the workspace chat#97512abzokhattab wants to merge 1 commit into
Conversation
…inserted report on screen When a report is pre-inserted under the RHP within the same tab, the RHP-already-dismissed cleanup only jumped to the original tab name, which is a no-op that drops the saved tab state. Reset the tab navigator to the saved original state instead so the report the flow started from is restored.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Some provenance worth having on record: the broken restore path this PR fixes is a pre-existing latent defect, and it was actually fixed once before. Commit aee58a1 (part of #91062, May 27) identified the same mechanism in the workspace-creation flow — "jumpTo works for the cross-tab case but is a no-op when the pre-insert happened in the same tab" — and replaced the jumpTo with a state reset. #91062 was then reverted wholesale (#93017) because of two deploy blockers in its workspace-creation changes (#93000, #93003), and the re-implementation (#93915) never restored the cleanup fix, so Two notes for review confidence:
|
Explanation of Change
On narrow layout, the submit confirmation RHP pre-mounts its destination report under itself (
usePreMountDestination) so post-submit dismissal reveals an already-rendered screen. A report route resolves to the tab navigator, so the pre-insert takes the tab-switch path: it rewrites the focused tab's inner state in place (self DM → workspace chat) and saves the original route aside. When the flow is cancelled while the RHP is still open, the router action restores that saved route fully. But when the device back button pops the RHP before the cleanup runs,removePreInsertedFullscreenIfNeededonly re-focused the original tab by name — a no-op when the pre-insert stayed on the same tab — so the saved state was dropped and the pre-inserted workspace chat stayed on screen instead of the self DM.The fix: in the RHP-already-dismissed cleanup path, when the focused tab is unchanged, reset the tab navigator to the saved original state instead of the no-op
jumpTo. The cross-tab path (jumpTo) and the RHP-still-open path are unchanged. In the "Submit to my employer" auto-skip flow this became reachable after #97057 bound the draft to the destination workspace chat, which made that report the pre-mount destination.Fixed Issues
$ #97437
PROPOSAL:
Tests
With the
submit2026beta enabled, on an account with a self DM and exactly one paid workspace, on Android (or any narrow layout):Offline tests
Same as Tests while offline — the flow is navigation-only, so behavior is identical.
QA Steps
submit2026beta, a self DM and exactly one paid workspace, create a manual expense in the self DM on Android.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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari