From 58db378879c4741300fe55a535c9d50b11a7639d Mon Sep 17 00:00:00 2001 From: Hubert Sosinski Date: Tue, 10 Mar 2026 11:37:06 +0100 Subject: [PATCH] Add reasonAttributes to FullscreenLoadingIndicator in settings pages --- .../Profile/Contacts/ContactMethodDetailsPage.tsx | 9 ++++++++- .../settings/Profile/CustomStatus/SetDatePage.tsx | 11 +++++++++-- src/pages/settings/Profile/DisplayNamePage.tsx | 6 +++++- .../Profile/PersonalDetails/BaseLegalNamePage.tsx | 6 +++++- .../Profile/PersonalDetails/DateOfBirthPage.tsx | 6 +++++- .../Profile/PersonalDetails/PersonalAddressPage.tsx | 8 +++++++- .../Profile/PersonalDetails/PhoneNumberPage.tsx | 6 +++++- src/pages/settings/Profile/PronounsPage.tsx | 3 ++- src/pages/settings/Troubleshoot/TroubleshootPage.tsx | 3 ++- src/pages/settings/VerifyAccountPageBase.tsx | 6 +++++- 10 files changed, 53 insertions(+), 11 deletions(-) diff --git a/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx b/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx index b564b9aee230..e6c69723c913 100644 --- a/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx +++ b/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx @@ -40,6 +40,7 @@ import {getEarliestErrorField, getLatestErrorField} from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types'; import type {SettingsNavigatorParamList} from '@libs/Navigation/types'; +import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan'; import {close} from '@userActions/Modal'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; @@ -234,8 +235,14 @@ function ContactMethodDetailsPage({route}: ContactMethodDetailsPageProps) { return menuItems; }, [isValidateCodeFormVisible, translate, turnOnDeleteModal, isDefaultContactMethod, icons.Trashcan]); + const reasonAttributes: SkeletonSpanReasonAttributes = { + context: 'ContactMethodDetailsPage', + isLoadingOnyxValues, + isLoadingReportData, + }; + if (isLoadingOnyxValues || (isLoadingReportData && isEmptyObject(loginList))) { - return ; + return ; } if (!contactMethod || !loginData) { diff --git a/src/pages/settings/Profile/CustomStatus/SetDatePage.tsx b/src/pages/settings/Profile/CustomStatus/SetDatePage.tsx index f8dffc682e9b..26121e250e82 100644 --- a/src/pages/settings/Profile/CustomStatus/SetDatePage.tsx +++ b/src/pages/settings/Profile/CustomStatus/SetDatePage.tsx @@ -11,6 +11,7 @@ import useOnyx from '@hooks/useOnyx'; import useThemeStyles from '@hooks/useThemeStyles'; import DateUtils from '@libs/DateUtils'; import Navigation from '@libs/Navigation/Navigation'; +import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan'; import {getDatePassedError, getFieldRequiredErrors} from '@libs/ValidationUtils'; import {updateStatusDraftCustomClearAfterDate} from '@userActions/User'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -46,8 +47,14 @@ function SetDatePage() { [translate], ); - if (isLoadingOnyxValue(statusDraftCustomClearAfterDateMetaData)) { - return ; + const isLoadingStatusDraft = isLoadingOnyxValue(statusDraftCustomClearAfterDateMetaData); + const reasonAttributes: SkeletonSpanReasonAttributes = { + context: 'SetDatePage', + isLoadingStatusDraft, + }; + + if (isLoadingStatusDraft) { + return ; } return ( diff --git a/src/pages/settings/Profile/DisplayNamePage.tsx b/src/pages/settings/Profile/DisplayNamePage.tsx index 5274c9162a99..6e91420ba2a1 100644 --- a/src/pages/settings/Profile/DisplayNamePage.tsx +++ b/src/pages/settings/Profile/DisplayNamePage.tsx @@ -16,6 +16,7 @@ import useOnyx from '@hooks/useOnyx'; import useThemeStyles from '@hooks/useThemeStyles'; import {addErrorMessage} from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; +import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan'; import {doesContainReservedWord, isValidDisplayName} from '@libs/ValidationUtils'; import {updateDisplayName as updateDisplayNamePersonalDetails} from '@userActions/PersonalDetails'; import CONST from '@src/CONST'; @@ -81,7 +82,10 @@ function DisplayNamePage({currentUserPersonalDetails}: DisplayNamePageProps) { onBackButtonPress={() => Navigation.goBack()} /> {isLoadingApp ? ( - + ) : ( ({ onBackButtonPress={onBackButtonPress ?? (() => Navigation.goBack())} /> {isLoadingApp ? ( - + ) : ( Navigation.goBack()} /> {isLoadingApp ? ( - + ) : ( normalizeCountryCode(getCurrentAddress(privatePersonalDetails)) as Address, [privatePersonalDetails]); + const reasonAttributes: SkeletonSpanReasonAttributes = { + context: 'PersonalAddressPage', + isLoading, + }; + if (isLoading) { - return ; + return ; } return ( Navigation.goBack()} /> {isLoadingApp ? ( - + ) : ( {isLoadingApp && !currentUserPersonalDetails.pronouns ? ( - + ) : ( <> - {isLoading && } + {isLoading && }
- + ); }