Migration navigation from InteractionManager to TransitionTracker V2#83899
Merged
srikarparsi merged 7 commits intoExpensify:mainfrom Mar 18, 2026
Merged
Conversation
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
This PR introduces the TransitionTracker and migrates the first batch of
InteractionManagerusages in navigation code to use it.TransitionTracker (
src/libs/Navigation/TransitionTracker.ts) is a new module that explicitly tracks active transitions (navigation, modal, keyboard, focus) using a counted map. It exposesstartTransition/endTransitionto mark transition boundaries, andrunAfterTransitionsto queue callbacks that fire once all transitions are idle. A safety timeout (1s) auto-ends transitions that are never explicitly closed.On top of TransitionTracker, existing APIs gain transition-aware options:
*
Navigation.navigate,goBack, anddismissModalnow acceptwaitForTransition(defer the navigation until ongoing transitions finish) andafterTransition(run a callback after the triggered transition completes). This replaces the old pattern of wrapping navigation calls inInteractionManager.runAfterInteractions.dismissModalWithReportusesafterTransitioninstead of the oldDeviceEventEmitter-basedMODAL_EVENTS.CLOSEDcallback pattern. TheMODAL_EVENTS.CLOSEDconstant and its associatedDeviceEventEmitteremissions inBaseModalandRightModalNavigatorare removed.KeyboardUtils.dismissnow accepts{ afterTransition, shouldSkipSafari }instead of a bare boolean, and tracks keyboard show/hide as a transition type.ScreenLayout(src/libs/Navigation/PlatformStackNavigation/ScreenLayout.tsx) is a new component wired into the web stack navigator viascreenLayoutprop. It listens totransitionStart/transitionEndevents to feed TransitionTracker.ReanimatedModalnow callsTransitionTracker.startTransition('modal')/endTransition('modal')alongside the existingInteractionManagerhandles.Concrete migration examples in this PR:
WorkspaceCategoriesSettingsPageandWorkspaceCreateTagPagereplaceKeyboard.dismiss()+InteractionManagerwithKeyboardUtils.dismiss({ afterTransition }).WorkspaceInviteMessageComponent,NewChatPage,TransactionReceiptModalContent, andReport/index.tsreplacedismissModal({ callback })withdismissModal({ afterTransition }).Fixed Issues
$ #71913
$ #83727
$ #83755
$ #83759
$ #83711
Tests
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Start new chat:
Screen.Recording.2026-03-03.at.16.17.56.mov
Workspace invite:
Screen.Recording.2026-03-03.at.16.19.09.mov
Create group:
Screen.Recording.2026-03-03.at.16.21.00.mov
Replace receipt:
Screen.Recording.2026-03-03.at.16.14.02.mov
Keyboard behaviour:
Screen.Recording.2026-03-03.at.16.15.22.mov
MacOS: Chrome / Safari
Start new chat:
Screen.Recording.2026-03-03.at.16.41.24.mov
Workspace invite:
Screen.Recording.2026-03-03.at.16.42.14.mov
Create group:
Screen.Recording.2026-03-03.at.16.43.08.mov
Replace receipt:
Screen.Recording.2026-03-03.at.16.43.50.mov