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
iPhone Duo - Distance - Next button disappears after rotating from portrait to landscape #106372
Version Number: 9.5.34-0 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#104988 Email or phone of affected tester (no customers):jnosidjodsjojo@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: iPhone Duo / iOS 27.2 App Component: Money Requests
Action Performed:
Launch Expensify app unfolded in landscape mode.
Open FAB > Track distance > Map.
Rotate device to portrait.
Rotate device to landscape.
Expected Result:
Next button will not disappear after rotating from portrait to landscape.
Actual Result:
Next button disappears after rotating from portrait to landscape.
👋 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.
Recommendation: keep DeployBlockerCash; the causing PR is not yet confirmed.
Update macOS runners to Xcode 27 is a plausible candidate because it shipped in the affected staging release and changes the native toolchain. However, its diff changes only build infrastructure—not the distance screen or orientation handling. The automated assignments are not sufficient evidence to recommend reverting it.
Compare otherwise-identical native builds with and without the Xcode update on the reported device. During landscape → portrait → landscape, capture window/screen dimensions, safe-area frame, cached initial height, and button/container bounds.
Revert only if that comparison establishes toolchain causality; otherwise address the demonstrated layout problem.
No interactive reproduction was performed: web testing cannot confirm this iOS-specific rotation/toolchain behavior. Confidence is low in the exact root cause and PR attribution. No code, labels, or assignments were changed.
Please re-state the problem that we are trying to solve in this issue.
On an unfolded foldable device (such as iPhone Duo), launching the app in landscape mode, opening FAB > Track distance > Map, rotating the device to portrait, and then rotating back to landscape causes the Next button at the bottom of the Distance Map screen to disappear below the visible viewport.
useInitialWindowDimensions latches the larger portrait window.height and fails to shrink initialHeight when rotating back to landscape if screen dimensions do not change (src/hooks/useInitialWindowDimensions/index.ts):
In src/hooks/useInitialWindowDimensions/index.ts:35-50:
When the app launches unfolded in landscape mode, initialHeight is initialized to the smaller landscape height (window.height).
When the user rotates to portrait mode, window.height > oldState.initialHeight is true, so initialHeight updates to the taller portrait height (and on iOS / unfolded foldable Simulator/devices where Dimensions.get('screen') reports fixed native screen bounds or orientation-independent screen dimensions during window rotation, screen.width === oldState.screenWidth && screen.height === oldState.screenHeight).
When the user rotates back to landscape, window.height decreases back to the shorter landscape height (window.height < oldState.initialHeight), while window.width increases (window.width > oldState.initialWidth). If screen.width and screen.height remain unchanged in the Dimensions change payload, the condition screen.width !== oldState.screenWidth || screen.height !== oldState.screenHeight || window.height > oldState.initialHeight evaluates to false!
As a result, useInitialWindowDimensions keeps the stale, taller portraitinitialHeight as minHeight on ScreenWrapperContainer (styles.screenWrapperContainerMinHeight(minHeight)). Because DistanceMapTabContent (src/pages/iou/request/step/DistanceMapTabContent.tsx:93-149) stretches its flex1 column to ScreenWrapperContainer's minHeight and places the <Button> (Next) at the bottom of that column after <DraggableList>, the bottom of the container extends below the actual landscape viewport, pushing the Next button off-screen!
What changes do you think we should make in order to solve the problem?
Detect orientation / window.width changes in src/hooks/useInitialWindowDimensions/index.ts: useInitialWindowDimensions is meant to ignore window.height reductions caused by the virtual keyboard opening (during which window.width does not change), NOT reductions caused by device rotation (during which window.width !== oldState.initialWidth).
Update onDimensionChange in src/hooks/useInitialWindowDimensions/index.ts:39 to also update dimensions whenever window.width !== oldState.initialWidth:
When rotating from portrait back to landscape, window.width !== oldState.initialWidth is always true, so initialHeight immediately resets to the new landscape window.height while still ignoring pure vertical shrinks from the virtual keyboard (window.width === oldState.initialWidth && window.height < oldState.initialHeight).
(Complementary) Exclude unfolded tablet-sized viewports from isInLandscapeMode in src/libs/isInLandscapeMode/index.native.ts:
As noted in #106376 and #106385, DistanceMapTabContent (src/pages/iou/request/step/DistanceMapTabContent.tsx:86-126) switches between a single-column layout (!isInLandscapeMode, map inside DraggableList's ListFooterComponent) and a two-column split layout (isInLandscapeMode, map on the left and DraggableList + Next button on the right). Updating isInLandscapeMode/index.native.ts so unfolded tablet-sized viewports (Math.min(windowWidth, windowHeight) > variables.mobileResponsiveWidthBreakpoint) are not treated as compact phone landscape also prevents unnecessary hierarchy remounts of DraggableFlatList and DistanceRequestFooter across rotations on unfolded devices.
What alternative solutions did you explore? (Optional)
Removing shouldEnableMinHeight={canUseTouchScreen()} from DistanceRequestStartPage.tsx: rejected because DistanceRequestStartPage shares its ScreenWrapper across the Manual and Odometer tabs (which contain text inputs that open the virtual keyboard), and fixing window.width !== oldState.initialWidth in useInitialWindowDimensions fixes the root cause for all screens using shouldEnableMinHeight.
Activity
applause-bot commentedon Nov 9, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/6822962160286d9bac5d42bfef586b7b072ee471f2b656654d5a8956afa4029c
melvin-bot commentedon Nov 9, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #104988
melvin-bot commentedon Nov 9, 2026
@lakchote you have been assigned to this deploy blocker because you reviewed the offending PR: #104988
melvin-bot commentedon Nov 9, 2026
@war-in you have been assigned to this deploy blocker because you authored the offending PR: #104988
melvin-bot commentedon Nov 9, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Nov 9, 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:
jponikarchuk commentedon Nov 9, 2026
We couldn't reproduce this issue a second time because it is device-specific, and the iPhone Duo is the only one in the team.
MelvinBot commentedon Nov 9, 2026
Deploy blocker investigation
Recommendation: keep
DeployBlockerCash; the causing PR is not yet confirmed.Update macOS runners to Xcode 27 is a plausible candidate because it shipped in the affected staging release and changes the native toolchain. However, its diff changes only build infrastructure—not the distance screen or orientation handling. The automated assignments are not sufficient evidence to recommend reverting it.
What the code shows
One concrete hypothesis: a portrait-height minimum survives rotation back to landscape, pushing Next below the visible area. ScreenWrapper derives its minimum height from cached initial dimensions, and the dimensions hook can retain an earlier height when window height decreases. Whether the reported device actually triggers that condition is unverified. Native safe-area or list-layout updates remain alternatives.
Recommended resolution
Compare otherwise-identical native builds with and without the Xcode update on the reported device. During landscape → portrait → landscape, capture window/screen dimensions, safe-area frame, cached initial height, and button/container bounds.
Revert only if that comparison establishes toolchain causality; otherwise address the demonstrated layout problem.
No interactive reproduction was performed: web testing cannot confirm this iOS-specific rotation/toolchain behavior. Confidence is low in the exact root cause and PR attribution. No code, labels, or assignments were changed.
view run
cocvn157 commentedon Nov 15, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On an unfolded foldable device (such as iPhone Duo), launching the app in landscape mode, opening
FAB > Track distance > Map, rotating the device to portrait, and then rotating back to landscape causes the Next button at the bottom of the Distance Map screen to disappear below the visible viewport.What is the root cause of that problem?
DistanceRequestStartPagepassesshouldEnableMinHeight={canUseTouchScreen()}toScreenWrapper(src/pages/iou/request/DistanceRequestStartPage.tsx):In
src/pages/iou/request/DistanceRequestStartPage.tsx:167-172:And in
src/components/ScreenWrapper/ScreenWrapperContainer.tsx:110-118andline 190:useInitialWindowDimensionslatches the larger portraitwindow.heightand fails to shrinkinitialHeightwhen rotating back to landscape ifscreendimensions do not change (src/hooks/useInitialWindowDimensions/index.ts):In
src/hooks/useInitialWindowDimensions/index.ts:35-50:initialHeightis initialized to the smaller landscape height (window.height).window.height > oldState.initialHeightistrue, soinitialHeightupdates to the taller portrait height (and on iOS / unfolded foldable Simulator/devices whereDimensions.get('screen')reports fixed native screen bounds or orientation-independent screen dimensions during window rotation,screen.width === oldState.screenWidth && screen.height === oldState.screenHeight).window.heightdecreases back to the shorter landscape height (window.height < oldState.initialHeight), whilewindow.widthincreases (window.width > oldState.initialWidth). Ifscreen.widthandscreen.heightremain unchanged in theDimensionschange payload, the conditionscreen.width !== oldState.screenWidth || screen.height !== oldState.screenHeight || window.height > oldState.initialHeightevaluates tofalse!useInitialWindowDimensionskeeps the stale, taller portraitinitialHeightasminHeightonScreenWrapperContainer(styles.screenWrapperContainerMinHeight(minHeight)). BecauseDistanceMapTabContent(src/pages/iou/request/step/DistanceMapTabContent.tsx:93-149) stretches itsflex1column toScreenWrapperContainer'sminHeightand places the<Button>(Next) at the bottom of that column after<DraggableList>, the bottom of the container extends below the actual landscape viewport, pushing the Next button off-screen!What changes do you think we should make in order to solve the problem?
Detect orientation /
window.widthchanges insrc/hooks/useInitialWindowDimensions/index.ts:useInitialWindowDimensionsis meant to ignorewindow.heightreductions caused by the virtual keyboard opening (during whichwindow.widthdoes not change), NOT reductions caused by device rotation (during whichwindow.width !== oldState.initialWidth).Update
onDimensionChangeinsrc/hooks/useInitialWindowDimensions/index.ts:39to also updatedimensionswheneverwindow.width !== oldState.initialWidth:When rotating from portrait back to landscape,
window.width !== oldState.initialWidthis alwaystrue, soinitialHeightimmediately resets to the new landscapewindow.heightwhile still ignoring pure vertical shrinks from the virtual keyboard (window.width === oldState.initialWidth && window.height < oldState.initialHeight).(Complementary) Exclude unfolded tablet-sized viewports from
isInLandscapeModeinsrc/libs/isInLandscapeMode/index.native.ts:As noted in
#106376and#106385,DistanceMapTabContent(src/pages/iou/request/step/DistanceMapTabContent.tsx:86-126) switches between a single-column layout (!isInLandscapeMode, map insideDraggableList'sListFooterComponent) and a two-column split layout (isInLandscapeMode, map on the left andDraggableList+Nextbutton on the right). UpdatingisInLandscapeMode/index.native.tsso unfolded tablet-sized viewports (Math.min(windowWidth, windowHeight) > variables.mobileResponsiveWidthBreakpoint) are not treated as compact phone landscape also prevents unnecessary hierarchy remounts ofDraggableFlatListandDistanceRequestFooteracross rotations on unfolded devices.What alternative solutions did you explore? (Optional)
shouldEnableMinHeight={canUseTouchScreen()}fromDistanceRequestStartPage.tsx: rejected becauseDistanceRequestStartPageshares itsScreenWrapperacross the Manual and Odometer tabs (which contain text inputs that open the virtual keyboard), and fixingwindow.width !== oldState.initialWidthinuseInitialWindowDimensionsfixes the root cause for all screens usingshouldEnableMinHeight.lakchote commentedon Nov 16, 2026
Not overdue.
lakchote commentedon Nov 17, 2026
@war-in can you take a look? Melvin linked this to your PR #104988, and there's a proposal above waiting for review.
lakchote commentedon Nov 18, 2026
Not overdue. #104730 added iPhone Duo support and war-in is going through these now, so I'm moving this to Weekly.