Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
07f1d81
Remove Onyx.connect() for the key: ONYXKEYS.COLLECTION.REPORT in src/…
abzokhattab Dec 31, 2025
1bac4b4
Merge remote-tracking branch 'origin/main' into Remove-onyx-connect-f…
abzokhattab Jan 4, 2026
af1499f
Merge remote-tracking branch 'origin/main' into Remove-onyx-connect-f…
abzokhattab Jan 16, 2026
687ab58
fixing eslint warning
abzokhattab Jan 16, 2026
aefc340
fix: pass reports collection to computeReportName for proper name res…
abzokhattab Jan 16, 2026
5cc558b
minor ts fix
abzokhattab Jan 16, 2026
b7fd95c
minor fix
abzokhattab Jan 16, 2026
03d2a20
Merge remote-tracking branch 'origin' into Remove-onyx-connect-from-o…
abzokhattab Jan 17, 2026
dee323b
Merge remote-tracking branch 'origin/main' into Remove-onyx-connect-f…
abzokhattab Jan 22, 2026
5fe1ebc
Merge remote-tracking branch 'origin/main' into Remove-onyx-connect-f…
abzokhattab Feb 2, 2026
060aea4
minor refactoring
abzokhattab Feb 2, 2026
fe4c126
fixing ts
abzokhattab Feb 2, 2026
4b91876
making new param as required
abzokhattab Feb 2, 2026
d12186c
making chatReport as required
abzokhattab Feb 2, 2026
5ef9211
reverting back onyx connect to be handled in a follow up PR
abzokhattab Feb 2, 2026
e6fb4d5
making reports as required
abzokhattab Feb 2, 2026
4595c67
fixing tests
abzokhattab Feb 2, 2026
12903dd
fixing eslint
abzokhattab Feb 2, 2026
6a90d9b
fixing prettier
abzokhattab Feb 2, 2026
adf96a4
fixing eslint
abzokhattab Feb 2, 2026
e2e787b
fixing dependecies
abzokhattab Feb 2, 2026
1d50552
fixing sentry eslint
abzokhattab Feb 2, 2026
5f5ea13
fixing sentry eslint
abzokhattab Feb 2, 2026
f2f9bad
adding test cases
abzokhattab Feb 2, 2026
401e7f9
fixing prettier
abzokhattab Feb 2, 2026
459d04d
Merge remote-tracking branch 'origin/main' into Remove-onyx-connect-f…
abzokhattab Feb 10, 2026
d64cdb9
Merge remote-tracking branch 'origin/main' into Remove-onyx-connect-f…
abzokhattab Feb 10, 2026
fc7cd0a
fix prettier
abzokhattab Feb 10, 2026
e3d1ecd
fixing missing dependencies
abzokhattab Feb 10, 2026
382f5c5
fix tests
abzokhattab Feb 10, 2026
e2c063a
removing reports and using chatreport instead
abzokhattab Feb 10, 2026
ea7f30d
Revert accidental Mobile-Expensify submodule change
abzokhattab Feb 10, 2026
a6fdeb2
fixing prettier
abzokhattab Feb 10, 2026
137f434
replace getReportOrDraftReport with top-down report params in getPoli…
abzokhattab Feb 11, 2026
6898459
fixing eslint
abzokhattab Feb 11, 2026
bb8ea09
fixing prettier
abzokhattab Feb 11, 2026
f668a7c
using allreports instead of getReportOrDraftReport
abzokhattab Feb 11, 2026
e439bc0
minor code refactoring
abzokhattab Feb 11, 2026
fa12a03
Merge remote-tracking branch 'origin/main' into Remove-onyx-connect-f…
abzokhattab Feb 11, 2026
78b64f4
fixing ts
abzokhattab Feb 11, 2026
65f93f9
Simplify chatReport lookups by removing redundant ternaries
abzokhattab Feb 11, 2026
aab30a3
Add TODO comments for temporary allReports usages
abzokhattab Feb 17, 2026
9efb78c
Merge remote-tracking branch 'origin/main' into Remove-onyx-connect-f…
abzokhattab Feb 17, 2026
7fb689e
Merge remote-tracking branch 'origin/main' into Remove-onyx-connect-f…
abzokhattab Feb 18, 2026
262b819
fixing typescript
abzokhattab Feb 18, 2026
29a2ce8
Merge remote-tracking branch 'origin/main' into Remove-onyx-connect-f…
abzokhattab Feb 20, 2026
b0d5144
adding tests to the OptionListContextProvider
abzokhattab Feb 20, 2026
9930f02
Extract useUserToInviteReports hook to deduplicate chatReport lookups
abzokhattab Feb 20, 2026
452ca95
Address review comments: fix relative import, use ordered options, ad…
abzokhattab Feb 24, 2026
964ab04
Merge remote-tracking branch 'origin/main' into Remove-onyx-connect-f…
abzokhattab Feb 24, 2026
eb615f3
fixing ts
abzokhattab Feb 24, 2026
3e21c2e
fixing prettier
abzokhattab Feb 24, 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
2 changes: 1 addition & 1 deletion src/components/AvatarCropModal/AvatarCropModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import ImageSize from 'react-native-image-size';
import {interpolate, useSharedValue} from 'react-native-reanimated';
import {scheduleOnUI} from 'react-native-worklets';
import ActivityIndicator from '@components/ActivityIndicator';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import Button from '@components/Button';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import Icon from '@components/Icon';
Expand All @@ -24,6 +23,7 @@ import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import cropOrRotateImage from '@libs/cropOrRotateImage';
import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage/types';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import CONST from '@src/CONST';
import type IconAsset from '@src/types/utils/IconAsset';
import ImageCropView from './ImageCropView';
Expand Down
2 changes: 1 addition & 1 deletion src/components/HeaderWithBackButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, {useMemo} from 'react';
import {Keyboard, StyleSheet, View} from 'react-native';
import type {SvgProps} from 'react-native-svg';
import ActivityIndicator from '@components/ActivityIndicator';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import Avatar from '@components/Avatar';
import AvatarWithDisplayName from '@components/AvatarWithDisplayName';
import Header from '@components/Header';
Expand All @@ -21,6 +20,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
import useThrottledButtonState from '@hooks/useThrottledButtonState';
import getButtonState from '@libs/getButtonState';
import Navigation from '@libs/Navigation/Navigation';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
Expand Down
8 changes: 5 additions & 3 deletions src/components/LHNOptionsList/LHNOptionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import type {BlockingViewProps} from '@components/BlockingViews/BlockingView';
import BlockingView from '@components/BlockingViews/BlockingView';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
import {ScrollOffsetContext} from '@components/ScrollOffsetContextProvider';
import TextBlock from '@components/TextBlock';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
Expand Down Expand Up @@ -49,7 +48,7 @@
const flashListRef = useRef<FlashListRef<Report>>(null);
const route = useRoute();
const isScreenFocused = useIsFocused();
const expensifyIcons = useMemoizedLazyExpensifyIcons(['MagnifyingGlass']);
const expensifyIcons = useMemoizedLazyExpensifyIcons(['MagnifyingGlass', 'Plus']);

const [reports] = useOnyx(ONYXKEYS.COLLECTION.REPORT);
const reportAttributes = useReportAttributes();
Expand Down Expand Up @@ -132,7 +131,7 @@
text={translate('common.emptyLHN.subtitleText2')}
/>
<Icon
src={Expensicons.Plus}
src={expensifyIcons.Plus}
width={variables.emptyLHNIconWidth}
height={variables.emptyLHNIconHeight}
fill={theme.icon}
Expand All @@ -158,6 +157,7 @@
styles.textNormal,
translate,
expensifyIcons.MagnifyingGlass,
expensifyIcons.Plus,
],
);

Expand Down Expand Up @@ -219,6 +219,7 @@
}
const movedFromReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${getMovedReportID(lastReportAction, CONST.REPORT.MOVE_TYPE.FROM)}`];
const movedToReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${getMovedReportID(lastReportAction, CONST.REPORT.MOVE_TYPE.TO)}`];
const chatReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${item?.chatReportID}`];
const itemReportMetadata = reportMetadataCollection?.[`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportID}`];
const lastMessageTextFromReport = getLastMessageTextForReport({
translate,
Expand All @@ -230,6 +231,7 @@
isReportArchived: !!itemReportNameValuePairs?.private_isArchived,
policyForMovingExpensesID,
reportMetadata: itemReportMetadata,
chatReport,
reportAttributesDerived: reportAttributes,
});

Expand Down Expand Up @@ -283,7 +285,7 @@
/>
);
},
[

Check warning on line 288 in src/components/LHNOptionsList/LHNOptionsList.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

React Hook useCallback has an unnecessary dependency: 'isOffline'. Either exclude it or remove the dependency array

Check warning on line 288 in src/components/LHNOptionsList/LHNOptionsList.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

React Hook useCallback has an unnecessary dependency: 'isOffline'. Either exclude it or remove the dependency array
reports,
reportNameValuePairs,
reportActions,
Expand Down
3 changes: 3 additions & 0 deletions src/components/LHNOptionsList/OptionRowLHNData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function OptionRowLHNData({

const [movedFromReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getMovedReportID(lastAction, CONST.REPORT.MOVE_TYPE.FROM)}`);
const [movedToReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getMovedReportID(lastAction, CONST.REPORT.MOVE_TYPE.TO)}`);
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${fullReport?.chatReportID}`);
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
// Check the report errors equality to avoid re-rendering when there are no changes
const prevReportErrors = usePrevious(reportAttributes?.reportErrors);
Expand Down Expand Up @@ -81,6 +82,7 @@ function OptionRowLHNData({
movedFromReport,
movedToReport,
currentUserAccountID,
chatReport,
reportAttributesDerived,
});
if (deepEqual(item, optionItemRef.current)) {
Expand Down Expand Up @@ -119,6 +121,7 @@ function OptionRowLHNData({
movedFromReport,
movedToReport,
currentUserAccountID,
chatReport,
reportAttributesDerived,
]);

Expand Down
2 changes: 1 addition & 1 deletion src/components/Lightbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type {LayoutChangeEvent, StyleProp, ViewStyle} from 'react-native';
import {PixelRatio, StyleSheet, View} from 'react-native';
import {useSharedValue} from 'react-native-reanimated';
import ActivityIndicator from '@components/ActivityIndicator';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import AttachmentOfflineIndicator from '@components/AttachmentOfflineIndicator';
import {useAttachmentCarouselPagerActions, useAttachmentCarouselPagerState} from '@components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPagerContext';
import type {Attachment} from '@components/Attachments/types';
Expand All @@ -17,6 +16,7 @@ import usePrevious from '@hooks/usePrevious';
import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import {isLocalFile} from '@libs/fileDownload/FileUtils';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import CONST from '@src/CONST';
import type {Dimensions} from '@src/types/utils/Layout';
import NUMBER_OF_CONCURRENT_LIGHTBOXES from './numberOfConcurrentLightboxes';
Expand Down
16 changes: 11 additions & 5 deletions src/components/OptionListContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) {
const report = changedReportsEntries[reportKey];
const reportID = reportKey.replace(ONYXKEYS.COLLECTION.REPORT, '');
const privateIsArchived = privateIsArchivedMap[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${reportID}`];
const {reportOption} = processReport(report, personalDetails, privateIsArchived, currentUserAccountID, reportAttributes?.reports);
const chatReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${report?.chatReportID}`];
const {reportOption} = processReport(report, personalDetails, privateIsArchived, currentUserAccountID, chatReport, reportAttributes?.reports);

if (reportOption) {
updatedReportsMap.set(reportID, reportOption);
Expand All @@ -138,7 +139,7 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) {
reports: Array.from(updatedReportsMap.values()),
};
});
}, [changedReportsEntries, personalDetails, currentUserAccountID, reportAttributes?.reports, privateIsArchivedMap]);
}, [changedReportsEntries, personalDetails, currentUserAccountID, reports, reportAttributes?.reports, privateIsArchivedMap]);

useEffect(() => {
if (!changedReportActions || !areOptionsInitialized.current) {
Expand All @@ -158,8 +159,10 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) {
}

const reportID = key.replace(ONYXKEYS.COLLECTION.REPORT_ACTIONS, '');
const reportItem = updatedReportsMap.get(reportID)?.item;
const privateIsArchived = privateIsArchivedMap[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${reportID}`];
const {reportOption} = processReport(updatedReportsMap.get(reportID)?.item, personalDetails, privateIsArchived, currentUserAccountID, reportAttributes?.reports);
const chatReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportItem?.chatReportID}`];
const {reportOption} = processReport(reportItem, personalDetails, privateIsArchived, currentUserAccountID, chatReport, reportAttributes?.reports);

if (reportOption) {
updatedReportsMap.set(reportID, reportOption);
Expand All @@ -171,7 +174,7 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) {
reports: Array.from(updatedReportsMap.values()),
};
});
}, [changedReportActions, personalDetails, currentUserAccountID, reportAttributes?.reports, privateIsArchivedMap]);
}, [changedReportActions, personalDetails, currentUserAccountID, reports, reportAttributes?.reports, privateIsArchivedMap]);

/**
* This effect is used to update the options list when personal details change.
Expand Down Expand Up @@ -229,7 +232,10 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) {
}

const privateIsArchived = privateIsArchivedMap[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID}`];
const newReportOption = createOptionFromReport(report, personalDetails, currentUserAccountID, privateIsArchived, reportAttributes?.reports, {showPersonalDetails: true});
const chatReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${report.chatReportID}`];
const newReportOption = createOptionFromReport(report, personalDetails, currentUserAccountID, chatReport, privateIsArchived, reportAttributes?.reports, {
showPersonalDetails: true,
});
const replaceIndex = options.reports.findIndex((option) => option.reportID === report.reportID);
newReportOptions.push({
newReportOption,
Expand Down
2 changes: 1 addition & 1 deletion src/components/PDFThumbnail/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React, {useState} from 'react';
import {View} from 'react-native';
import Pdf from 'react-native-pdf';
import LoadingIndicator from '@components/LoadingIndicator';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import useThemeStyles from '@hooks/useThemeStyles';
import addEncryptedAuthTokenToURL from '@libs/addEncryptedAuthTokenToURL';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import PDFThumbnailError from './PDFThumbnailError';
import type PDFThumbnailProps from './types';

Expand Down
4 changes: 3 additions & 1 deletion src/components/Search/SearchFiltersChatsSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ function SearchFiltersChatsSelector({initialReportIDs, onFiltersUpdate, isScreen

const selectedOptions: OptionData[] = selectedReportIDs.map((id) => {
const privateIsArchived = privateIsArchivedMap[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${id}`];
const reportData = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${id}`];
const chatReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportData?.chatReportID}`];
const report = getSelectedOptionData(
createOptionFromReport({...reports?.[`${ONYXKEYS.COLLECTION.REPORT}${id}`], reportID: id}, personalDetails, currentUserAccountID, privateIsArchived, reportAttributesDerived),
createOptionFromReport({...reportData, reportID: id}, personalDetails, currentUserAccountID, chatReport, privateIsArchived, reportAttributesDerived),
);
const isReportArchived = !!privateIsArchived;
const alternateText = getAlternateText(report, {}, isReportArchived, currentUserAccountID, {}, reportAttributesDerived);
Expand Down
3 changes: 2 additions & 1 deletion src/components/Search/SearchRouter/SearchRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ function SearchRouter({onRouterClose, shouldHideInputCaret, isSearchRouterDispla
}

const privateIsArchived = privateIsArchivedMap[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${contextualReportID}`];
const option = createOptionFromReport(report, personalDetails, currentUserAccountID, privateIsArchived, undefined, {showPersonalDetails: true});
const chatReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${report.chatReportID}`];
const option = createOptionFromReport(report, personalDetails, currentUserAccountID, chatReport, privateIsArchived, undefined, {showPersonalDetails: true});
reportForContextualSearch = option;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import type {LayoutChangeEvent} from 'react-native';
import {StyleSheet, View} from 'react-native';
import Animated, {FadeIn, FadeOut} from 'react-native-reanimated';
import ActivityIndicator from '@components/ActivityIndicator';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import DistanceEReceipt from '@components/DistanceEReceipt';
import EReceiptWithSizeCalculation from '@components/EReceiptWithSizeCalculation';
import type {ImageOnLoadEvent} from '@components/Image/types';
import useDebouncedState from '@hooks/useDebouncedState';
import useResponsiveLayoutOnWideRHP from '@hooks/useResponsiveLayoutOnWideRHP';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import {hasReceiptSource, isDistanceRequest, isManualDistanceRequest, isPerDiemRequest} from '@libs/TransactionUtils';
import variables from '@styles/variables';
import Image from '@src/components/Image';
Expand Down
15 changes: 15 additions & 0 deletions src/hooks/useUserToInviteReports.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
import type {SearchOptionData} from '@libs/OptionsListUtils/types';
import ONYXKEYS from '@src/ONYXKEYS';
import useOnyx from './useOnyx';

/**
* For policy expense chat invitees, resolves the expense report and its associated chat report.
*/
export default function useUserToInviteReports(userToInvite: SearchOptionData | null | undefined) {
const userToInviteReportID = userToInvite?.isPolicyExpenseChat ? userToInvite.reportID : undefined;
const [userToInviteExpenseReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(userToInviteReportID)}`);
const [userToInviteChatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(userToInviteExpenseReport?.chatReportID)}`);

return {userToInviteExpenseReport, userToInviteChatReport};
}
Loading
Loading