Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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/Attachments/AttachmentCarousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function AttachmentCarousel({
if (page == null) {
return (
<View style={[styles.flex1, styles.attachmentCarouselContainer]}>
<FullScreenLoadingIndicator />
<FullScreenLoadingIndicator reasonAttributes={{context: 'AttachmentCarousel'}} />
</View>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {ConnectToQuickbooksOnlineFlowProps} from './types';

const renderLoading = () => <FullScreenLoadingIndicator />;
const renderLoading = () => <FullScreenLoadingIndicator reasonAttributes={{context: 'ConnectToQuickbooksOnlineFlow'}} />;

function ConnectToQuickbooksOnlineFlow({policyID}: ConnectToQuickbooksOnlineFlowProps) {
const {translate} = useLocalize();
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConnectToXeroFlow/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function ConnectToXeroFlow({policyID}: ConnectToXeroFlowProps) {
const isUserValidated = account?.validated;
const is2FAEnabled = account?.requiresTwoFactorAuth ?? false;

const renderLoading = () => <FullScreenLoadingIndicator />;
const renderLoading = () => <FullScreenLoadingIndicator reasonAttributes={{context: 'ConnectToXeroFlow'}} />;
const [isRequire2FAModalOpen, setIsRequire2FAModalOpen] = useState(false);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/FullScreenLoaderContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function FullScreenLoaderContextProvider({children}: FullScreenLoaderContextProv
<FullScreenLoaderActionsContext.Provider value={actionsContextValue}>
<FullScreenLoaderStateContext.Provider value={stateContextValue}>
{children}
{isLoaderVisible && <FullScreenLoadingIndicator />}
{isLoaderVisible && <FullScreenLoadingIndicator reasonAttributes={{context: 'FullScreenLoaderContext'}} />}
</FullScreenLoaderStateContext.Provider>
</FullScreenLoaderActionsContext.Provider>
);
Expand Down
4 changes: 4 additions & 0 deletions src/components/Image/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type {ImagePrefetchOptions, ImageSource} from 'expo-image';
import type {ImageRequireSource, ImageResizeMode, ImageStyle, ImageURISource, StyleProp, ViewStyle} from 'react-native';
import type {ValueOf} from 'type-fest';
import type {FullScreenLoadingIndicatorIconSize} from '@components/FullscreenLoadingIndicator';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import type CONST from '@src/CONST';

type ExpoImageSource = ImageSource | number | ImageSource[];
Expand Down Expand Up @@ -53,6 +54,9 @@ type ImageOwnProps = BaseImageProps & {
/** The style of the loading indicator */
loadingIndicatorStyles?: StyleProp<ViewStyle>;

/** Reason attributes for skeleton span telemetry */
reasonAttributes?: SkeletonSpanReasonAttributes;

/** Event for when the image begins loading */
onLoadStart?: () => void;

Expand Down
6 changes: 6 additions & 0 deletions src/components/ImageWithSizeCalculation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, {useMemo} from 'react';
import type {ImageResizeMode, ImageSourcePropType, StyleProp, ViewStyle} from 'react-native';
import useThemeStyles from '@hooks/useThemeStyles';
import Log from '@libs/Log';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import CONST from '@src/CONST';
import type {FullScreenLoadingIndicatorIconSize} from './FullscreenLoadingIndicator';
import RESIZE_MODES from './Image/resizeModes';
Expand Down Expand Up @@ -49,6 +50,9 @@ type ImageWithSizeCalculationProps = {

/** The resize mode of the image */
resizeMode?: ImageResizeMode;

/** Reason attributes for skeleton span telemetry */
reasonAttributes?: SkeletonSpanReasonAttributes;
};

/**
Expand All @@ -69,6 +73,7 @@ function ImageWithSizeCalculation({
loadingIndicatorStyles,
onLoad,
resizeMode,
reasonAttributes,
}: ImageWithSizeCalculationProps) {
const styles = useThemeStyles();

Expand Down Expand Up @@ -98,6 +103,7 @@ function ImageWithSizeCalculation({
objectPosition={objectPosition}
loadingIconSize={loadingIconSize}
loadingIndicatorStyles={loadingIndicatorStyles}
reasonAttributes={reasonAttributes}
/>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Onfido/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function Onfido({sdkToken, onUserExit, onSuccess, onError}: OnfidoProps) {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

return <FullscreenLoadingIndicator />;
return <FullscreenLoadingIndicator reasonAttributes={{context: 'Onfido'}} />;
}

export default Onfido;
7 changes: 7 additions & 0 deletions src/components/ReceiptImage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ReceiptEmptyState from '@components/ReceiptEmptyState';
import type {TransactionListItemType} from '@components/SelectionListWithSections/types';
import ThumbnailImage from '@components/ThumbnailImage';
import useThemeStyles from '@hooks/useThemeStyles';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import CONST from '@src/CONST';
import type {Transaction} from '@src/types/onyx';
import type {ReceiptSource} from '@src/types/onyx/Transaction';
Expand Down Expand Up @@ -104,6 +105,9 @@ type ReceiptImageProps = (

isEmptyReceipt?: boolean;

/** Reason attributes for skeleton span telemetry */
reasonAttributes?: SkeletonSpanReasonAttributes;

/** Callback to be called on pressing the image */
onPress?: () => void;

Expand Down Expand Up @@ -149,6 +153,7 @@ function ReceiptImage({
fallbackIconColor,
fallbackIconBackground,
isEmptyReceipt = false,
reasonAttributes,
onPress,
transactionItem,
isPerDiemRequest,
Expand Down Expand Up @@ -229,6 +234,7 @@ function ReceiptImage({
onLoad={onLoad}
onLoadFailure={onLoadFailure}
resizeMode={resizeMode}
reasonAttributes={reasonAttributes}
/>
);
}
Expand All @@ -253,6 +259,7 @@ function ReceiptImage({
imageWidthToCalculateHeight={receiptImageWidth}
onError={onLoadFailure}
resizeMode={resizeMode}
reasonAttributes={reasonAttributes}
/>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Rule/RuleNotFoundPageWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function RuleNotFoundPageWrapper({children, hash, shouldPreventShow}: RuleNotFou
const shouldShowNotFoundPage = !!hash && !doesRuleExist;

if (shouldShowFullScreenLoadingIndicator) {
return <FullscreenLoadingIndicator />;
return <FullscreenLoadingIndicator reasonAttributes={{context: 'RuleNotFoundPageWrapper'}} />;
}

if (!shouldPreventShow && shouldShowNotFoundPage) {
Expand Down
6 changes: 6 additions & 0 deletions src/components/ThumbnailImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import useStyleUtils from '@hooks/useStyleUtils';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import useThumbnailDimensions from '@hooks/useThumbnailDimensions';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import type IconAsset from '@src/types/utils/IconAsset';
Expand Down Expand Up @@ -79,6 +80,9 @@ type ThumbnailImageProps = {

/** The resize mode of the image */
resizeMode?: ImageResizeMode;

/** Reason attributes for skeleton span telemetry */
reasonAttributes?: SkeletonSpanReasonAttributes;
};

function ThumbnailImage({
Expand All @@ -101,6 +105,7 @@ function ThumbnailImage({
loadingIndicatorStyles,
onLoad,
resizeMode,
reasonAttributes,
}: ThumbnailImageProps) {
const icons = useMemoizedLazyExpensifyIcons(['Gallery', 'OfflineCloud']);
const styles = useThemeStyles();
Expand Down Expand Up @@ -166,6 +171,7 @@ function ThumbnailImage({
loadingIndicatorStyles={loadingIndicatorStyles}
onLoad={onLoad}
resizeMode={resizeMode}
reasonAttributes={reasonAttributes}
/>
</View>
</View>
Expand Down
2 changes: 1 addition & 1 deletion src/components/WalletStatementModal/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type WebViewMessageType = ValueOf<typeof CONST.WALLET.WEB_MESSAGE_TYPE>;

type WebViewNavigationEvent = WebViewNavigation & {type?: WebViewMessageType};

const renderLoading = () => <FullScreenLoadingIndicator />;
const renderLoading = () => <FullScreenLoadingIndicator reasonAttributes={{context: 'WalletStatementModal'}} />;

function WalletStatementModal({statementPageURL}: WalletStatementProps) {
const [session] = useOnyx(ONYXKEYS.SESSION);
Expand Down
2 changes: 1 addition & 1 deletion src/components/WalletStatementModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function WalletStatementModal({statementPageURL}: WalletStatementProps) {

return (
<>
{isLoading && <FullScreenLoadingIndicator />}
{isLoading && <FullScreenLoadingIndicator reasonAttributes={{context: 'WalletStatementModal'}} />}
<View style={[styles.flex1]}>
<iframe
src={`${statementPageURL}&authToken=${authToken}`}
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Navigation/OnyxTabNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function OnyxTabNavigator<TTabName extends string = SelectedTabRequest>({
const validInitialTab = selectedTab && tabNames.includes(selectedTab) ? selectedTab : defaultSelectedTab;

const LazyPlaceholder = useCallback(() => {
return <FullScreenLoadingIndicator />;
return <FullScreenLoadingIndicator reasonAttributes={{context: 'OnyxTabNavigator.LazyPlaceholder'}} />;
}, []);

// This callback is used to register the focus trap container element of each available tab screen
Expand Down
8 changes: 7 additions & 1 deletion src/pages/AddressPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import type {BackToParams} from '@libs/Navigation/types';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import type {FormOnyxValues} from '@src/components/Form/types';
import type {Country} from '@src/CONST';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -83,6 +84,8 @@ function AddressPage({title, address, updateAddress, isLoadingApp = true, backTo
[currentCountry],
);

const reasonAttributes: SkeletonSpanReasonAttributes = {context: 'AddressPage', isLoadingApp: !!isLoadingApp};

return (
<ScreenWrapper
enableEdgeToEdgeBottomSafeAreaPadding
Expand All @@ -95,7 +98,10 @@ function AddressPage({title, address, updateAddress, isLoadingApp = true, backTo
onBackButtonPress={() => Navigation.goBack(backTo)}
/>
{isLoadingApp ? (
<FullscreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
<FullscreenLoadingIndicator
style={[styles.flex1, styles.pRelative]}
reasonAttributes={reasonAttributes}
/>
) : (
<AddressForm
formID={ONYXKEYS.FORMS.HOME_ADDRESS_FORM}
Expand Down
9 changes: 8 additions & 1 deletion src/pages/LoadingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ActivityIndicator from '@components/ActivityIndicator';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import ScreenWrapper from '@components/ScreenWrapper';
import useThemeStyles from '@hooks/useThemeStyles';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import CONST from '@src/CONST';

type LoadingPageProps = {
Expand All @@ -15,6 +16,9 @@ type LoadingPageProps = {

function LoadingPage({onBackButtonPress, title}: LoadingPageProps) {
const styles = useThemeStyles();

const reasonAttributes: SkeletonSpanReasonAttributes = {context: 'LoadingPage'};

return (
<ScreenWrapper testID="LoadingPage">
<HeaderWithBackButton
Expand All @@ -23,7 +27,10 @@ function LoadingPage({onBackButtonPress, title}: LoadingPageProps) {
title={title}
/>
<View style={[styles.flex1, styles.fullScreenLoading]}>
<ActivityIndicator size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE} />
<ActivityIndicator
size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE}
reasonAttributes={reasonAttributes}
/>
</View>
</ScreenWrapper>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type SetPersonalDetailsAndShipExpensifyCardsParams from '@libs/API/parame
import {normalizeCountryCode} from '@libs/CountryUtils';
import Navigation from '@libs/Navigation/Navigation';
import {findPageIndex} from '@libs/SubPageUtils';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand Down Expand Up @@ -118,7 +119,8 @@ function MissingPersonalDetailsContent({privatePersonalDetails, draftValues, hea
});

if (isRedirecting) {
return <FullScreenLoadingIndicator />;
const reasonAttributes: SkeletonSpanReasonAttributes = {context: 'MissingPersonalDetailsContent', isRedirecting};
return <FullScreenLoadingIndicator reasonAttributes={reasonAttributes} />;
}

const handleBackButtonPress = () => {
Expand Down
4 changes: 3 additions & 1 deletion src/pages/MissingPersonalDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, {useCallback} from 'react';
import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator';
import useOnyx from '@hooks/useOnyx';
import Navigation from '@libs/Navigation/Navigation';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';
Expand All @@ -18,7 +19,8 @@ function MissingPersonalDetails({route: {params: {cardID = ''} = {}}}) {
}, [cardID]);

if (isLoading) {
return <FullScreenLoadingIndicator />;
const reasonAttributes: SkeletonSpanReasonAttributes = {context: 'MissingPersonalDetails'};
return <FullScreenLoadingIndicator reasonAttributes={reasonAttributes} />;
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function MultifactorAuthenticationBiometricsTestPage() {
/>
)}
<FullPageOfflineBlockingView>
<FullScreenLoadingIndicator />
<FullScreenLoadingIndicator reasonAttributes={{context: 'BiometricsTestPage', isOffline}} />
</FullPageOfflineBlockingView>
</ScreenWrapper>
);
Expand Down
5 changes: 4 additions & 1 deletion src/pages/NewReportWorkspaceSelectionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ function NewReportWorkspaceSelectionPage({route}: NewReportWorkspaceSelectionPag
/>
{CreateReportConfirmationModal}
{shouldShowLoadingIndicator ? (
<FullScreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
<FullScreenLoadingIndicator
style={[styles.flex1, styles.pRelative]}
reasonAttributes={{context: 'NewReportWorkspaceSelectionPage', isLoadingApp: !!isLoadingApp}}
/>
) : (
<>
<Text style={[styles.ph5, styles.mb3]}>{translate('report.newReport.chooseWorkspace')}</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
import {addErrorMessage} from '@libs/ErrorUtils';
import Navigation from '@libs/Navigation/Navigation';
import {isPaidGroupPolicy, isPolicyAdmin} from '@libs/PolicyUtils';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
import {isRequiredFulfilled} from '@libs/ValidationUtils';
import {clearWorkspaceDetailsDraft} from '@userActions/Onboarding';
import {createWorkspace, generateDefaultWorkspaceName, generatePolicyID} from '@userActions/Policy/Policy';
Expand Down Expand Up @@ -127,7 +128,8 @@ function BaseOnboardingWorkspaceConfirmation({shouldUseNativeStyles}: BaseOnboar
};

if (isLoadingOnyxValue(draftValuesMetadata, sessionMetadata)) {
return <FullScreenLoadingIndicator />;
const reasonAttributes: SkeletonSpanReasonAttributes = {context: 'BaseOnboardingWorkspaceConfirmation'};
return <FullScreenLoadingIndicator reasonAttributes={reasonAttributes} />;
}

return (
Expand Down
7 changes: 6 additions & 1 deletion src/pages/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,12 @@ function ProfilePage({route}: ProfilePageProps) {
/>
)}
</ScrollView>
{!hasAvatar && isLoading && <FullScreenLoadingIndicator style={styles.flex1} />}
{!hasAvatar && isLoading && (
<FullScreenLoadingIndicator
style={styles.flex1}
reasonAttributes={{context: 'ProfilePage', isLoading}}
/>
)}
</View>
</FullPageNotFoundView>
</ScreenWrapper>
Expand Down
5 changes: 4 additions & 1 deletion src/pages/ReportChangeWorkspacePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ function ReportChangeWorkspacePage({report, route}: ReportChangeWorkspacePagePro
}}
/>
{shouldShowLoadingIndicator ? (
<FullScreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
<FullScreenLoadingIndicator
style={[styles.flex1, styles.pRelative]}
reasonAttributes={{context: 'ReportChangeWorkspacePage', isLoadingApp: !!isLoadingApp}}
/>
) : (
<SelectionList<WorkspaceListItemType>
ListItem={UserListItem}
Expand Down
5 changes: 4 additions & 1 deletion src/pages/ScheduleCall/ScheduleCallPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ function ScheduleCallPage() {
/>
<FullPageOfflineBlockingView>
{adminReportNameValuePairs?.calendlySchedule?.isLoading ? (
<FullScreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
<FullScreenLoadingIndicator
style={[styles.flex1, styles.pRelative]}
reasonAttributes={{context: 'ScheduleCallPage', isLoading: !!adminReportNameValuePairs?.calendlySchedule?.isLoading}}
/>
) : (
<ScrollView style={styles.flexGrow1}>
<View style={styles.ph5}>
Expand Down
5 changes: 4 additions & 1 deletion src/pages/SetDefaultWorkspacePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ function SetDefaultWorkspacePage({route}: SetDefaultWorkspacePageProps) {
onBackButtonPress={Navigation.goBack}
/>
{shouldShowLoadingIndicator ? (
<FullScreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
<FullScreenLoadingIndicator
style={[styles.flex1, styles.pRelative]}
reasonAttributes={{context: 'SetDefaultWorkspacePage', isLoadingApp: !!isLoadingApp}}
/>
) : (
<SelectionList<WorkspaceListItemType>
data={data}
Expand Down
Loading
Loading