1- import { Fragment } from 'react' ;
1+ import { Fragment , useMemo } from 'react' ;
22import * as qs from 'query-string' ;
33
44import GridEditable , { GridColumnHeader } from 'sentry/components/gridEditable' ;
55import SortLink from 'sentry/components/gridEditable/sortLink' ;
6+ import ExternalLink from 'sentry/components/links/externalLink' ;
67import Link from 'sentry/components/links/link' ;
78import Pagination from 'sentry/components/pagination' ;
8- import { t } from 'sentry/locale' ;
9+ import { Tooltip } from 'sentry/components/tooltip' ;
10+ import { t , tct } from 'sentry/locale' ;
911import {
1012 TableData ,
1113 TableDataRow ,
@@ -16,6 +18,8 @@ import {getFieldRenderer} from 'sentry/utils/discover/fieldRenderers';
1618import { fieldAlignment } from 'sentry/utils/discover/fields' ;
1719import { useLocation } from 'sentry/utils/useLocation' ;
1820import useOrganization from 'sentry/utils/useOrganization' ;
21+ import usePageFilters from 'sentry/utils/usePageFilters' ;
22+ import useProjects from 'sentry/utils/useProjects' ;
1923import TopResultsIndicator from 'sentry/views/discover/table/topResultsIndicator' ;
2024import { TableColumn } from 'sentry/views/discover/table/types' ;
2125import { useReleaseSelection } from 'sentry/views/starfish/queries/useReleases' ;
@@ -32,11 +36,20 @@ type Props = {
3236
3337export function ScreensTable ( { data, eventView, isLoading, pageLinks} : Props ) {
3438 const location = useLocation ( ) ;
39+ const { selection} = usePageFilters ( ) ;
40+ const { projects} = useProjects ( ) ;
3541 const organization = useOrganization ( ) ;
3642 const { primaryRelease, secondaryRelease} = useReleaseSelection ( ) ;
3743 const truncatedPrimary = formatVersionAndCenterTruncate ( primaryRelease ?? '' , 15 ) ;
3844 const truncatedSecondary = formatVersionAndCenterTruncate ( secondaryRelease ?? '' , 15 ) ;
3945
46+ const project = useMemo ( ( ) => {
47+ if ( selection . projects . length !== 1 ) {
48+ return null ;
49+ }
50+ return projects . find ( p => p . id === String ( selection . projects ) ) ;
51+ } , [ projects , selection . projects ] ) ;
52+
4053 const eventViewColumns = eventView . getColumns ( ) ;
4154
4255 const columnNameMap = {
@@ -97,6 +110,34 @@ export function ScreensTable({data, eventView, isLoading, pageLinks}: Props) {
97110 organization,
98111 unit : data ?. meta . units ?. [ column . key ] ,
99112 } ) ;
113+ if (
114+ column . key . includes ( 'time_to_full_display' ) &&
115+ row [ column . key ] === 0 &&
116+ project ?. platform &&
117+ [ 'android' , 'apple-ios' ] . includes ( project . platform )
118+ ) {
119+ const docsUrl =
120+ project ?. platform === 'android'
121+ ? 'https://docs.sentry.io/platforms/android/performance/instrumentation/automatic-instrumentation/#time-to-full-display'
122+ : 'https://docs.sentry.io/platforms/apple/guides/ios/performance/instrumentation/automatic-instrumentation/#time-to-full-display' ;
123+ return (
124+ < div style = { { textAlign : 'right' } } >
125+ < Tooltip
126+ title = { tct (
127+ 'Measuring TTFD requires manual instrumentation in your application. To learn how to collect TTFD, see the documentation [link].' ,
128+ {
129+ link : < ExternalLink href = { docsUrl } > { t ( 'here' ) } </ ExternalLink > ,
130+ }
131+ ) }
132+ showUnderline
133+ isHoverable
134+ >
135+ { rendered }
136+ </ Tooltip >
137+ </ div >
138+ ) ;
139+ }
140+
100141 return rendered ;
101142 }
102143
0 commit comments