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
{{ message }}
Repository navigation
Troubleshoot - Blank page opens when opening test tools via CMD+D #85871
Version Number: 9.3.41-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#79834 Email or phone of affected tester (no customers):sdjsdjosijnsodiosd@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Other
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #79834 - "fix: [Web] Focus restoration mechanism on back navigation (#76921)" by @mavrickdeveloper (High confidence) Related Issues: #76921
Recommendation: REVERT
PR #79834 introduced a new NavigationFocusManager system to handle keyboard focus restoration during back navigation. This appears to be interfering with the TestToolsModal rendering, causing a blank page instead of the modal content when opening test tools via CMD+D.
Labels: Keeping DeployBlockerCash (App deploy blocker - frontend fix required). DeployBlocker label is not present on this issue.
📋 Detailed Analysis
Evidence
Issue only reproduces on staging (v9.3.41-0), not production
Please re-state the problem that we are trying to solve in this issue.
On staging (v9.3.41-0), pressing CMD+D to open the test tools modal results in a blank page instead of showing the test tools modal. This is a regression introduced by PR #79834 ("fix: [Web] Focus restoration mechanism on back navigation").
What is the root cause of that problem?
PR #79834 completely reworked the FocusTrapForScreen web implementation (src/components/FocusTrap/FocusTrapForScreen/index.web.tsx) and added a new NavigationFocusManager system. The test tools "modal" is not a traditional React modal — it is a navigation-based route (/test-tools) rendered by TestToolsModalNavigator, which wraps its content in FocusTrapForScreens (the same modified component).
The key changes that break the test tools modal:
New <View style={{flex: 1}}> wrapper (line 213-220): PR fix: [Web] Focus restoration mechanism on back navigation (#76921) #79834 added a wrapper <View> inside the <FocusTrap> component. The focus-trap-react library renders its own plain <div> wrapper (no flex styles). The new <View style={{flex: 1}}> inside it has flex-basis: 0% (RN Web's interpretation of flex: 1), which may not expand correctly inside the non-flex parent <div>. Combined with TestToolsModalNavigator's specific layout hierarchy (PressableWithoutFeedback → FocusTrap div → new View → inner View), this can cause the content to collapse or not render visibly.
Focus lifecycle hooks on navigation transitions: When CMD+D triggers Navigation.navigate() to /test-tools:
The previous screen's FocusTrapForScreen detects isFocused=false and calls NavigationFocusManager.captureForRoute() (line 117-119)
The test tools screen's FocusTrapForScreen activates with onActivate blurring the active element (line 159-164) and initialFocus returning false (line 175-198, since wasNavigatedTo.current starts as false)
This complex interplay of focus capture, cleanup, blur, and trap activation during the multi-step async open sequence (Modal.close() → setTimeout(200ms) → Navigation.navigate()) can result in the screen rendering blank
initialFocus and setReturnFocus changed from false to functions: Previously these were simply false (no focus management). Now they are dynamic functions that interact with NavigationFocusManager. This fundamentally changes how focus-trap-react handles focus during trap activation/deactivation for every screen, including the test tools modal.
What changes do you think we should make in order to solve the problem?
Since this is a deploy blocker, the safest immediate fix is to revert PR #79834. The focus restoration feature is a UX enhancement, not a bugfix, and should not block the deploy.
If a revert is not desired, a targeted fix could be explored:
Remove the <View style={{flex: 1}}> wrapper from FocusTrapForScreen (line 213-220) and find an alternative way to attach the route boundary dataSet attribute (e.g., via a ref on the FocusTrap container)
Alternatively, ensure the focus-trap-react wrapper <div> gets proper flex layout styles so the inner <View style={{flex: 1}}> can expand correctly
What alternative solutions did you explore? (Optional)
Investigated whether NavigationFocusManager.handleKeyDown was intercepting CMD+D — confirmed it does not (it only handles Enter, Space, and Escape at line 415 of NavigationFocusManager/index.web.ts)
Investigated whether the PanResponder change in ScreenWrapperContainer (from useRef to useMemo) could cause the issue — this is functionally equivalent and unlikely to be the cause
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
This issue is reproducible on every snapshot build, no culprit PR was found.
Not sure if this means that the issue is present on staging as well (non-related to our PR, coming from another staging-deployed PR) or it is actually related to our PR.
If related to our PR, this does seem like a deploy blocker since it prevents usage of dev tools.
Activity
melvin-bot commentedon Mar 19, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #79834
melvin-bot commentedon Mar 19, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Mar 19, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
OSBotify commentedon Mar 19, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #79834 - "fix: [Web] Focus restoration mechanism on back navigation (#76921)" by @mavrickdeveloper (High confidence)
Related Issues: #76921
Recommendation: REVERT
PR #79834 introduced a new NavigationFocusManager system to handle keyboard focus restoration during back navigation. This appears to be interfering with the TestToolsModal rendering, causing a blank page instead of the modal content when opening test tools via CMD+D.
Labels: Keeping DeployBlockerCash (App deploy blocker - frontend fix required). DeployBlocker label is not present on this issue.
📋 Detailed Analysis
Evidence
Verification
Files affected by the bug:
PR #79834 modifies:
Root Cause
The new FocusTrapForScreen adds complex focus capture/restoration logic. The test tools modal triggers edge case behavior:
Key suspicious code:
vincdargento commentedon Mar 19, 2026
This issue is reproducible on every snapshot build, no culprit PR was found.
MelvinBot commentedon Mar 19, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On staging (v9.3.41-0), pressing CMD+D to open the test tools modal results in a blank page instead of showing the test tools modal. This is a regression introduced by PR #79834 ("fix: [Web] Focus restoration mechanism on back navigation").
What is the root cause of that problem?
PR #79834 completely reworked the
FocusTrapForScreenweb implementation (src/components/FocusTrap/FocusTrapForScreen/index.web.tsx) and added a newNavigationFocusManagersystem. The test tools "modal" is not a traditional React modal — it is a navigation-based route (/test-tools) rendered byTestToolsModalNavigator, which wraps its content inFocusTrapForScreens(the same modified component).The key changes that break the test tools modal:
New
<View style={{flex: 1}}>wrapper (line 213-220): PR fix: [Web] Focus restoration mechanism on back navigation (#76921) #79834 added a wrapper<View>inside the<FocusTrap>component. Thefocus-trap-reactlibrary renders its own plain<div>wrapper (no flex styles). The new<View style={{flex: 1}}>inside it hasflex-basis: 0%(RN Web's interpretation offlex: 1), which may not expand correctly inside the non-flex parent<div>. Combined withTestToolsModalNavigator's specific layout hierarchy (PressableWithoutFeedback→FocusTrap div→ newView→ innerView), this can cause the content to collapse or not render visibly.Focus lifecycle hooks on navigation transitions: When CMD+D triggers
Navigation.navigate()to/test-tools:FocusTrapForScreendetectsisFocused=falseand callsNavigationFocusManager.captureForRoute()(line 117-119)NavigationRoot.handleStateChangecallsNavigationFocusManager.cleanupRemovedRoutes()(NavigationRoot.tsx:244)FocusTrapForScreenactivates withonActivateblurring the active element (line 159-164) andinitialFocusreturningfalse(line 175-198, sincewasNavigatedTo.currentstarts asfalse)Modal.close()→setTimeout(200ms)→Navigation.navigate()) can result in the screen rendering blankinitialFocusandsetReturnFocuschanged fromfalseto functions: Previously these were simplyfalse(no focus management). Now they are dynamic functions that interact withNavigationFocusManager. This fundamentally changes howfocus-trap-reacthandles focus during trap activation/deactivation for every screen, including the test tools modal.What changes do you think we should make in order to solve the problem?
Since this is a deploy blocker, the safest immediate fix is to revert PR #79834. The focus restoration feature is a UX enhancement, not a bugfix, and should not block the deploy.
If a revert is not desired, a targeted fix could be explored:
<View style={{flex: 1}}>wrapper fromFocusTrapForScreen(line 213-220) and find an alternative way to attach the route boundarydataSetattribute (e.g., via a ref on the FocusTrap container)focus-trap-reactwrapper<div>gets proper flex layout styles so the inner<View style={{flex: 1}}>can expand correctlyWhat alternative solutions did you explore? (Optional)
NavigationFocusManager.handleKeyDownwas intercepting CMD+D — confirmed it does not (it only handles Enter, Space, and Escape at line 415 ofNavigationFocusManager/index.web.ts)PanResponderchange inScreenWrapperContainer(fromuseReftouseMemo) could cause the issue — this is functionally equivalent and unlikely to be the causeclickOutsideDeactivates: truecould immediately deactivate the test tools trap — this option existed before PR fix: [Web] Focus restoration mechanism on back navigation (#76921) #79834 and is not newNext Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.ikevin127 commentedon Mar 19, 2026
Not sure if this means that the issue is present on staging as well (non-related to our PR, coming from another staging-deployed PR) or it is actually related to our PR.
If related to our PR, this does seem like a deploy blocker since it prevents usage of dev tools.
cristipaval commentedon Mar 20, 2026
Not repro anymore after reverting #79834