@@ -5,11 +5,25 @@ import SearchRowSkeleton from '@components/Skeletons/SearchRowSkeleton';
55import useResponsiveLayout from '@hooks/useResponsiveLayout' ;
66import useThemeStyles from '@hooks/useThemeStyles' ;
77import { endSpanWithAttributes } from '@libs/telemetry/activeSpans' ;
8+ import { endSubmitFollowUpActionSpan , getPendingSubmitFollowUpAction } from '@libs/telemetry/submitFollowUpAction' ;
89import CONST from '@src/CONST' ;
910import Search from './index' ;
1011
1112const REASON_ATTRIBUTES = { context : 'SearchPage.NavigationDeferred' } as const ;
1213
14+ function handleSkeletonLayout ( ) {
15+ endSpanWithAttributes ( CONST . TELEMETRY . SPAN_NAVIGATE_TO_REPORTS , { [ CONST . TELEMETRY . ATTRIBUTE_IS_WARM ] : true } ) ;
16+
17+ // Skeleton paint is the first user-perceivable signal that the submit destination
18+ // (Search) is up. End the submit-to-destination-visible span here for any pending
19+ // action that targets Search. DISMISS_MODAL_AND_OPEN_REPORT is excluded because
20+ // that flow's destination is the report, not Search.
21+ const pending = getPendingSubmitFollowUpAction ( ) ;
22+ if ( pending && pending . followUpAction !== CONST . TELEMETRY . SUBMIT_FOLLOW_UP_ACTION . DISMISS_MODAL_AND_OPEN_REPORT ) {
23+ endSubmitFollowUpActionSpan ( pending . followUpAction , undefined , { [ CONST . TELEMETRY . ATTRIBUTE_IS_WARM ] : true } ) ;
24+ }
25+ }
26+
1327function SearchWithNavigationDeferredMount ( props : ComponentProps < typeof Search > ) {
1428 const styles = useThemeStyles ( ) ;
1529 const { shouldUseNarrowLayout} = useResponsiveLayout ( ) ;
@@ -21,7 +35,7 @@ function SearchWithNavigationDeferredMount(props: ComponentProps<typeof Search>)
2135 placeholder = {
2236 < SearchRowSkeleton
2337 shouldAnimate
24- onLayout = { ( ) => endSpanWithAttributes ( CONST . TELEMETRY . SPAN_NAVIGATE_TO_REPORTS , { [ CONST . TELEMETRY . ATTRIBUTE_IS_WARM ] : true } ) }
38+ onLayout = { handleSkeletonLayout }
2539 containerStyle = { containerStyle }
2640 reasonAttributes = { REASON_ATTRIBUTES }
2741 />
0 commit comments