From 92f776801309b383da40536062f748822095fbff Mon Sep 17 00:00:00 2001 From: "Aimane Chnaif (via MelvinBot)" Date: Mon, 11 May 2026 12:29:02 +0000 Subject: [PATCH 1/2] Hide manual tab for distance expenses in production Gate the manual distance editing tab behind a production check using useEnvironment(). In production, only the map tab is shown. In staging/dev, the full tab navigator with both map and manual tabs remains available for testing. Co-authored-by: Aimane Chnaif --- .../request/step/IOURequestStepDistance.tsx | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepDistance.tsx b/src/pages/iou/request/step/IOURequestStepDistance.tsx index c400d37b333a..bc814f3691bc 100644 --- a/src/pages/iou/request/step/IOURequestStepDistance.tsx +++ b/src/pages/iou/request/step/IOURequestStepDistance.tsx @@ -12,6 +12,7 @@ import type {BaseTextInputRef} from '@components/TextInput/BaseTextInput/types'; import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails'; import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails'; import useDefaultExpensePolicy from '@hooks/useDefaultExpensePolicy'; +import useEnvironment from '@hooks/useEnvironment'; import useFetchRoute from '@hooks/useFetchRoute'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; @@ -81,6 +82,7 @@ function IOURequestStepDistance({ const {isOffline} = useNetwork(); const {translate} = useLocalize(); const {isBetaEnabled} = usePermissions(); + const {isProduction} = useEnvironment(); const isArchived = useReportIsArchived(report?.reportID); const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(report?.parentReportID)}`); const [parentReportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${getNonEmptyStringOnyxID(report?.parentReportID)}`); @@ -762,14 +764,18 @@ function IOURequestStepDistance({ shouldShowNotFoundPage={!currentTransaction?.comment?.waypoints || shouldShowNotFoundPage} shouldShowWrapper > - - {renderMapTab} - {renderManualTab} - + {isProduction ? ( + renderMapTab() + ) : ( + + {renderMapTab} + {renderManualTab} + + )} ); } From 5c2634d8d5441f3ab43b79606a6d3bd2ff660a90 Mon Sep 17 00:00:00 2001 From: "Aimane Chnaif (via MelvinBot)" Date: Mon, 11 May 2026 12:38:41 +0000 Subject: [PATCH 2/2] Use isEditing && !isProduction condition instead of conditional rendering Change the guard condition to skip the editing tab navigator in production rather than conditionally rendering inside it. Co-authored-by: Aimane Chnaif --- .../request/step/IOURequestStepDistance.tsx | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepDistance.tsx b/src/pages/iou/request/step/IOURequestStepDistance.tsx index bc814f3691bc..2573a26573a3 100644 --- a/src/pages/iou/request/step/IOURequestStepDistance.tsx +++ b/src/pages/iou/request/step/IOURequestStepDistance.tsx @@ -755,7 +755,7 @@ function IOURequestStepDistance({ [currentDistance, distanceUnit, submitManualDistance, manualFormError, handleManualInputChange], ); - if (isEditing) { + if (isEditing && !isProduction) { return ( - {isProduction ? ( - renderMapTab() - ) : ( - - {renderMapTab} - {renderManualTab} - - )} + + {renderMapTab} + {renderManualTab} + ); }