Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2fd0d9f
Flatten SCREENS.RIGHT_MODAL.SEARCH_REPORT
WojtekBoman Dec 16, 2025
9bc71d1
Move overlays to the wrapper file
WojtekBoman Dec 17, 2025
0d7768d
Reapply "Merge pull request #75886 from software-mansion-labs/swrhp-v2"
collectioneur Dec 15, 2025
594b8d6
fix swrhp bugs
collectioneur Dec 15, 2025
8fc2911
Flatten super wide rhp structure
WojtekBoman Dec 12, 2025
13ca711
Add SuperWideRHPWrapper
WojtekBoman Dec 15, 2025
1e8c5a0
Flatten search report modal stack
WojtekBoman Dec 16, 2025
21a70bf
small fix
collectioneur Dec 16, 2025
0f91145
migrate navigation to wide rhp modal
collectioneur Dec 16, 2025
51d2f2c
migrate navigation part to flatten structure of wide rhps
collectioneur Dec 16, 2025
1a67465
fix navigation to super wide rhp after merging reports
collectioneur Dec 16, 2025
624dce9
fix navigation to super wide RHP after reviewing duplicates
collectioneur Dec 17, 2025
5b5247e
fix leave button and navigation to super wide RHP
collectioneur Dec 17, 2025
8794127
fix android bugs
collectioneur Dec 18, 2025
cf03423
remove dead code
collectioneur Dec 18, 2025
287472f
Remove check for Portal in SearchMoneyRequestReportPage
WojtekBoman Dec 18, 2025
e161860
Fix SearchReport animations
WojtekBoman Dec 22, 2025
ac3fa37
Fix displaying side panel above super wide rhp
WojtekBoman Dec 22, 2025
31b6b39
Fix navigating using ParentNavigationSubtitle
WojtekBoman Dec 22, 2025
37fe971
Add ExpenseReportVerifyAccountPage
WojtekBoman Dec 22, 2025
193870d
Fix issue: Expense - Report RHP opens not here page after resolving d…
WojtekBoman Dec 22, 2025
f500e07
Remove unused wrapper files
WojtekBoman Dec 23, 2025
7cf3e27
Fix navigating back from ReportDetailsPage
WojtekBoman Dec 23, 2025
793dd5d
Fix swrhp/wrhp screens animations
WojtekBoman Jan 8, 2026
471a943
Remove InteractionManager from show wide rhp hooks
WojtekBoman Jan 8, 2026
2a6291d
fix specific case, when optimistic report is displayed in the backgro…
collectioneur Jan 9, 2026
405521a
fix comments
collectioneur Jan 9, 2026
f6e19e3
Disable auto focus on search report when another rhp is displayed below
WojtekBoman Jan 9, 2026
bfcf023
fix reject button when dismissing to expense report
collectioneur Jan 9, 2026
11a43f8
Remove redundant RHPReportScreen
WojtekBoman Jan 12, 2026
1139f4d
Fix navigating after leaving chat from swrhp
WojtekBoman Jan 13, 2026
00a041b
Hide receipt empty state for invoice on narrow layout
WojtekBoman Jan 13, 2026
c39abbb
Fix issue: Expense - Review duplicates RHP loads infinitely after del…
WojtekBoman Jan 13, 2026
733910b
Adjust deleting expenses from ReportDetailsPage
WojtekBoman Jan 13, 2026
5e08b39
Remove todo comments
WojtekBoman Jan 13, 2026
dd1b78e
Remove isFromRHP param from navigateBackOnDeleteTransaction as it is …
WojtekBoman Jan 13, 2026
7ceccd1
Fix issue: Expense - Report loads infinitely after removing expenses …
WojtekBoman Jan 14, 2026
c0a093f
Fix new messages button on reports displayed in RHP
WojtekBoman Jan 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ const ROUTES = {
return getUrlWithBackToParam(baseRoute, backTo);
},
},

EXPENSE_REPORT_RHP: {
route: 'e/:reportID',
getRoute: ({reportID, backTo}: {reportID: string; backTo?: string}) => {
const baseRoute = `e/${reportID}` as const;

// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
return getUrlWithBackToParam(baseRoute, backTo);
},
},

SEARCH_REPORT_VERIFY_ACCOUNT: {
route: `search/view/:reportID/${VERIFY_ACCOUNT}`,
getRoute: (reportID: string) => `search/view/${reportID}/${VERIFY_ACCOUNT}` as const,
Expand Down Expand Up @@ -593,6 +604,10 @@ const ROUTES = {
route: `r/:reportID/${VERIFY_ACCOUNT}`,
getRoute: (reportID: string) => `r/${reportID}/${VERIFY_ACCOUNT}` as const,
},
EXPENSE_REPORT_VERIFY_ACCOUNT: {
route: `e/:reportID/${VERIFY_ACCOUNT}`,
getRoute: (reportID: string) => `e/${reportID}/${VERIFY_ACCOUNT}` as const,
},
REPORT_PARTICIPANTS: {
route: 'r/:reportID/participants',

Expand Down
4 changes: 2 additions & 2 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ const SCREENS = {
TRAVEL: 'Travel',
SEARCH_REPORT: 'SearchReport',
SEARCH_REPORT_ACTIONS: 'SearchReportActions',
// These two routes will be added in a separate PR adding Super Wide RHP routes
EXPENSE_REPORT: 'ExpenseReport',
SEARCH_MONEY_REQUEST_REPORT: 'SearchMoneyRequestReport',

SEARCH_COLUMNS: 'SearchColumns',
Expand All @@ -277,6 +275,7 @@ const SCREENS = {
MERGE_TRANSACTION: 'MergeTransaction',
REPORT_CARD_ACTIVATE: 'Report_Card_Activate',
DOMAIN: 'Domain',
EXPENSE_REPORT: 'ExpenseReport',
},
REPORT_CARD_ACTIVATE: 'Report_Card_Activate_Root',
PUBLIC_CONSOLE_DEBUG: 'Console_Debug',
Expand Down Expand Up @@ -826,6 +825,7 @@ const SCREENS = {
REIMBURSEMENT_ACCOUNT_ENTER_SIGNER_INFO: 'Reimbursement_Account_Signer_Info',
REFERRAL_DETAILS: 'Referral_Details',
REPORT_VERIFY_ACCOUNT: 'Report_Verify_Account',
EXPENSE_REPORT_VERIFY_ACCOUNT: 'Expense_Report_Verify_Account',
KEYBOARD_SHORTCUTS: 'KeyboardShortcuts',
SHARE: {
ROOT: 'Share_Root',
Expand Down
2 changes: 1 addition & 1 deletion src/components/AddUnreportedExpenseFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function AddUnreportedExpenseFooter({selectedIds, report, reportToConfirm, repor
setErrorMessage(translate('iou.selectUnreportedExpense'));
return;
}
Navigation.dismissModal();
Navigation.dismissToSuperWideRHP();
// eslint-disable-next-line @typescript-eslint/no-deprecated
InteractionManager.runAfterInteractions(() => {
if (report && isIOUReport(report)) {
Expand Down
23 changes: 14 additions & 9 deletions src/components/MoneyReportHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import usePermissions from '@hooks/usePermissions';
import usePolicy from '@hooks/usePolicy';
import useReportIsArchived from '@hooks/useReportIsArchived';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useResponsiveLayoutOnWideRHP from '@hooks/useResponsiveLayoutOnWideRHP';
import useSearchShouldCalculateTotals from '@hooks/useSearchShouldCalculateTotals';
import useSelectedTransactionsActions from '@hooks/useSelectedTransactionsActions';
import useStrictPolicyRules from '@hooks/useStrictPolicyRules';
Expand All @@ -45,7 +46,7 @@ import Log from '@libs/Log';
import {getThreadReportIDsForTransactions, getTotalAmountForIOUReportPreviewButton} from '@libs/MoneyRequestReportUtils';
import Navigation from '@libs/Navigation/Navigation';
import type {PlatformStackRouteProp} from '@libs/Navigation/PlatformStackNavigation/types';
import type {ReportsSplitNavigatorParamList, RightModalNavigatorParamList, SearchFullscreenNavigatorParamList} from '@libs/Navigation/types';
import type {ReportsSplitNavigatorParamList, RightModalNavigatorParamList} from '@libs/Navigation/types';
import {
buildOptimisticNextStepForDEWOfflineSubmission,
buildOptimisticNextStepForDynamicExternalWorkflowError,
Expand Down Expand Up @@ -156,7 +157,6 @@ import ProcessMoneyReportHoldMenu from './ProcessMoneyReportHoldMenu';
import {useSearchContext} from './Search/SearchContext';
import AnimatedSettlementButton from './SettlementButton/AnimatedSettlementButton';
import Text from './Text';
import {WideRHPContext} from './WideRHPContextProvider';

type MoneyReportHeaderProps = {
/** The report currently being looked at */
Expand Down Expand Up @@ -197,7 +197,8 @@ function MoneyReportHeader({
const shouldDisplayNarrowVersion = shouldUseNarrowLayout || isMediumScreenWidth;
const route = useRoute<
| PlatformStackRouteProp<ReportsSplitNavigatorParamList, typeof SCREENS.REPORT>
| PlatformStackRouteProp<SearchFullscreenNavigatorParamList, typeof SCREENS.SEARCH.MONEY_REQUEST_REPORT>
| PlatformStackRouteProp<RightModalNavigatorParamList, typeof SCREENS.RIGHT_MODAL.EXPENSE_REPORT>
| PlatformStackRouteProp<RightModalNavigatorParamList, typeof SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT>
| PlatformStackRouteProp<RightModalNavigatorParamList, typeof SCREENS.RIGHT_MODAL.SEARCH_REPORT>
>();
const {login: currentUserLogin, accountID, email} = useCurrentUserPersonalDetails();
Expand Down Expand Up @@ -402,9 +403,11 @@ function MoneyReportHeader({
const shouldCalculateTotals = useSearchShouldCalculateTotals(currentSearchKey, currentSearchQueryJSON?.similarSearchHash, true);
const [currentSearchResults] = useOnyx(`${ONYXKEYS.COLLECTION.SNAPSHOT}${currentSearchQueryJSON?.hash}`, {canBeMissing: true});

const {wideRHPRouteKeys} = useContext(WideRHPContext);
const [network] = useOnyx(ONYXKEYS.NETWORK, {canBeMissing: true});
const shouldDisplayNarrowMoreButton = !shouldDisplayNarrowVersion || (wideRHPRouteKeys.length > 0 && !isSmallScreenWidth);

const {isWideRHPDisplayedOnWideLayout, isSuperWideRHPDisplayedOnWideLayout} = useResponsiveLayoutOnWideRHP();

const shouldDisplayNarrowMoreButton = !shouldDisplayNarrowVersion || isWideRHPDisplayedOnWideLayout || isSuperWideRHPDisplayedOnWideLayout;

const showExportProgressModal = useCallback(() => {
return showConfirmModal({
Expand Down Expand Up @@ -509,9 +512,9 @@ function MoneyReportHeader({
const shouldShowLoadingBar = useLoadingBarVisibility();
const kycWallRef = useContext(KYCWallContext);

const isReportInRHP = route.name === SCREENS.RIGHT_MODAL.SEARCH_REPORT;
const isReportInRHP = route.name !== SCREENS.REPORT;
const shouldDisplaySearchRouter = !isReportInRHP || isSmallScreenWidth;
const isReportInSearch = route.name === SCREENS.SEARCH.MONEY_REQUEST_REPORT;
const isReportInSearch = route.name === SCREENS.RIGHT_MODAL.SEARCH_REPORT || route.name === SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT;
const isReportSubmitter = isCurrentUserSubmitter(chatIOUReport);
const isChatReportDM = isDM(chatReport);

Expand Down Expand Up @@ -1549,7 +1552,9 @@ function MoneyReportHeader({
const backToRoute = route.params?.backTo ?? (chatReport?.reportID ? ROUTES.REPORT_WITH_ID.getRoute(chatReport.reportID) : undefined);
Navigation.goBack(backToRoute);
}
handleDeleteTransactions();
// It has been handled like the rest of the delete cases. It will be refactored along with other cases.
// eslint-disable-next-line @typescript-eslint/no-deprecated
InteractionManager.runAfterInteractions(() => handleDeleteTransactions());
});
}, [showConfirmModal, translate, selectedTransactionIDs.length, transactions, handleDeleteTransactions, route.params?.backTo, chatReport?.reportID]);

Expand Down Expand Up @@ -1731,7 +1736,7 @@ function MoneyReportHeader({
{isReportInSearch && (
<MoneyRequestReportNavigation
reportID={moneyRequestReport?.reportID}
shouldDisplayNarrowVersion={shouldDisplayNarrowVersion}
shouldDisplayNarrowVersion={!shouldDisplayNarrowMoreButton}
/>
)}
</View>
Expand Down
7 changes: 6 additions & 1 deletion src/components/MoneyRequestHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ type MoneyRequestHeaderProps = {
function MoneyRequestHeader({report, parentReportAction, policy, onBackButtonPress}: MoneyRequestHeaderProps) {
// We need to use isSmallScreenWidth instead of shouldUseNarrowLayout to use a correct layout for the hold expense modal https://github.com/Expensify/App/pull/47990#issuecomment-2362382026
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
const {shouldUseNarrowLayout, isSmallScreenWidth} = useResponsiveLayout();
const {shouldUseNarrowLayout, isSmallScreenWidth, isInNarrowPaneModal} = useResponsiveLayout();
const route = useRoute<
PlatformStackRouteProp<ReportsSplitNavigatorParamList, typeof SCREENS.REPORT> | PlatformStackRouteProp<RightModalNavigatorParamList, typeof SCREENS.RIGHT_MODAL.SEARCH_REPORT>
>();
Expand Down Expand Up @@ -570,6 +570,11 @@ function MoneyRequestHeader({report, parentReportAction, policy, onBackButtonPre
deleteTransactions([transaction.transactionID], duplicateTransactions, duplicateTransactionViolations, currentSearchHash, true);
removeTransaction(transaction.transactionID);
}
if (isInNarrowPaneModal) {
Navigation.navigateBackToLastSuperWideRHPScreen();
return;
}

onBackButtonPress();
}}
onCancel={() => setIsDeleteModalVisible(false)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import useParentReportAction from '@hooks/useParentReportAction';
import usePrevious from '@hooks/usePrevious';
import useReportIsArchived from '@hooks/useReportIsArchived';
import useReportScrollManager from '@hooks/useReportScrollManager';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useResponsiveLayoutOnWideRHP from '@hooks/useResponsiveLayoutOnWideRHP';
import useSelectedTransactionsActions from '@hooks/useSelectedTransactionsActions';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
Expand Down Expand Up @@ -172,7 +172,7 @@ function MoneyRequestReportActionsList({
const isReportArchived = useReportIsArchived(reportID);
const canPerformWriteAction = canUserPerformWriteAction(report, isReportArchived);

const {shouldUseNarrowLayout} = useResponsiveLayout();
const {shouldUseNarrowLayout} = useResponsiveLayoutOnWideRHP();

const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: false});
const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${getNonEmptyStringOnyxID(reportID)}`, {canBeMissing: true});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Checkbox from '@components/Checkbox';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useResponsiveLayoutOnWideRHP from '@hooks/useResponsiveLayoutOnWideRHP';
import useThemeStyles from '@hooks/useThemeStyles';
import {convertToDisplayString} from '@libs/CurrencyUtils';
import {getCommaSeparatedTagNameWithSanitizedColons} from '@libs/PolicyUtils';
Expand Down Expand Up @@ -64,7 +64,7 @@ function MoneyRequestReportGroupHeader({
}: MoneyRequestReportGroupHeaderProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const {shouldUseNarrowLayout} = useResponsiveLayout();
const {shouldUseNarrowLayout} = useResponsiveLayoutOnWideRHP();

const cleanedGroupName = isGroupedByTag && group.groupName ? getCommaSeparatedTagNameWithSanitizedColons(group.groupName) : group.groupName;
const displayName = cleanedGroupName || translate(isGroupedByTag ? 'reportLayout.noTag' : 'reportLayout.uncategorized');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import TransactionItemRow from '@components/TransactionItemRow';
import useAnimatedHighlightStyle from '@hooks/useAnimatedHighlightStyle';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useResponsiveLayoutOnWideRHP from '@hooks/useResponsiveLayoutOnWideRHP';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import ControlSelection from '@libs/ControlSelection';
Expand Down Expand Up @@ -81,7 +82,8 @@ function MoneyRequestReportTransactionItem({
const {translate} = useLocalize();
const styles = useThemeStyles();
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
const {isSmallScreenWidth, isMediumScreenWidth, shouldUseNarrowLayout} = useResponsiveLayout();
const {isSmallScreenWidth, isMediumScreenWidth} = useResponsiveLayout();
const {shouldUseNarrowLayout} = useResponsiveLayoutOnWideRHP();
const theme = useTheme();
const isPendingDelete = isTransactionPendingDelete(transaction);
const pendingAction = getTransactionPendingAction(transaction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import useOnyx from '@hooks/useOnyx';
import useReportIsArchived from '@hooks/useReportIsArchived';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useResponsiveLayoutOnWideRHP from '@hooks/useResponsiveLayoutOnWideRHP';
import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import {turnOnMobileSelectionMode} from '@libs/actions/MobileSelectionMode';
Expand Down Expand Up @@ -168,7 +169,8 @@
const expensifyIcons = useMemoizedLazyExpensifyIcons(['Location', 'CheckSquare', 'ReceiptPlus']);
const {translate, localeCompare} = useLocalize();
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
const {shouldUseNarrowLayout, isSmallScreenWidth, isMediumScreenWidth} = useResponsiveLayout();
const {isSmallScreenWidth, isMediumScreenWidth} = useResponsiveLayout();
const {shouldUseNarrowLayout} = useResponsiveLayoutOnWideRHP();
const {markReportIDAsExpense} = useContext(WideRHPContext);
const [isModalVisible, setIsModalVisible] = useState(false);
const [selectedTransactionID, setSelectedTransactionID] = useState<string>('');
Expand All @@ -189,7 +191,7 @@

const addExpenseDropdownOptions = useMemo(
() => getAddExpenseDropdownOptions(expensifyIcons, report?.reportID, policy, undefined, undefined, lastDistanceExpenseType),
[report?.reportID, policy, lastDistanceExpenseType, expensifyIcons.Location],

Check warning on line 194 in src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

React Hook useMemo has a missing dependency: 'expensifyIcons'. Either include it or remove the dependency array

Check warning on line 194 in src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

React Hook useMemo has a missing dependency: 'expensifyIcons'. Either include it or remove the dependency array

Check warning on line 194 in src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

React Hook useMemo has a missing dependency: 'expensifyIcons'. Either include it or remove the dependency array

Check warning on line 194 in src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

React Hook useMemo has a missing dependency: 'expensifyIcons'. Either include it or remove the dependency array
);

const hasPendingAction = useMemo(() => {
Expand Down
Loading
Loading