import {useEffect} from 'react'; import styled from '@emotion/styled'; import omit from 'lodash/omit'; import Breadcrumbs from 'sentry/components/breadcrumbs'; import ErrorBoundary from 'sentry/components/errorBoundary'; import * as Layout from 'sentry/components/layouts/thirds'; import {DatePageFilter} from 'sentry/components/organizations/datePageFilter'; import PageFilterBar from 'sentry/components/organizations/pageFilterBar'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import {browserHistory} from 'sentry/utils/browserHistory'; import {DurationUnit} from 'sentry/utils/discover/fields'; import {DiscoverDatasets} from 'sentry/utils/discover/types'; import {PageAlert, PageAlertProvider} from 'sentry/utils/performance/contexts/pageAlert'; import {useLocation} from 'sentry/utils/useLocation'; import useRouter from 'sentry/utils/useRouter'; import {SamplesTables} from 'sentry/views/performance/mobile/appStarts/screenSummary/samples'; import { COLD_START_TYPE, StartTypeSelector, } from 'sentry/views/performance/mobile/appStarts/screenSummary/startTypeSelector'; import {SpanSamplesPanel} from 'sentry/views/performance/mobile/components/spanSamplesPanel'; import {MetricsRibbon} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/metricsRibbon'; import {ModulePageProviders} from 'sentry/views/performance/modulePageProviders'; import {useModuleBreadcrumbs} from 'sentry/views/performance/utils/useModuleBreadcrumbs'; import { PRIMARY_RELEASE_ALIAS, ReleaseComparisonSelector, SECONDARY_RELEASE_ALIAS, } from 'sentry/views/starfish/components/releaseSelector'; import {ModuleName, SpanMetricsField} from 'sentry/views/starfish/types'; import {ROUTE_NAMES} from 'sentry/views/starfish/utils/routeNames'; import AppStartWidgets from './widgets'; type Query = { [SpanMetricsField.APP_START_TYPE]: string; 'device.class': string; primaryRelease: string; project: string; secondaryRelease: string; spanDescription: string; spanGroup: string; spanOp: string; transaction: string; }; export function ScreenSummary() { const location = useLocation(); const router = useRouter(); const { primaryRelease, secondaryRelease, transaction: transactionName, spanGroup, spanDescription, spanOp, [SpanMetricsField.APP_START_TYPE]: appStartType, 'device.class': deviceClass, } = location.query; useEffect(() => { // Default the start type to cold start if not present if (!appStartType) { browserHistory.replace({ ...location, query: { ...location.query, [SpanMetricsField.APP_START_TYPE]: COLD_START_TYPE, }, }); } }, [location, appStartType]); const crumbs = useModuleBreadcrumbs('app_start'); return ( {transactionName} {spanGroup && spanOp && appStartType && ( { router.replace({ pathname: router.location.pathname, query: omit( router.location.query, 'spanGroup', 'transactionMethod', 'spanDescription', 'spanOp' ), }); }} /> )} ); } function PageWithProviders() { const location = useLocation(); const {transaction} = location.query; return ( ); } export default PageWithProviders; const ControlsContainer = styled('div')` display: flex; gap: ${space(1.5)}; `; const HeaderContainer = styled('div')` display: flex; flex-wrap: wrap; gap: ${space(2)}; justify-content: space-between; `; const SamplesContainer = styled('div')` margin-top: ${space(2)}; `;