Skip to content

Commit 474ca1a

Browse files
authored
ref(insights): abstract ScreenLoadSpanSamples side panel for mobile modules (#70890)
Currently, the app starts module depends on `ScreenLoadSpanSamples` in `mobile/screenload` to display the side panel. However, we therefore cannot identify which module the panel comes from, which we will need for analytics (e.g. # of times a sample span is clicked per module) - #70822. This PR moves the component under `mobile/components` and adds a moduleName prop to identify the originating module.
1 parent 8e8095a commit 474ca1a

File tree

5 files changed

+30
-17
lines changed

5 files changed

+30
-17
lines changed

Diff for: static/app/views/performance/mobile/appStarts/screenSummary/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ import {
2525
StartTypeSelector,
2626
} from 'sentry/views/performance/mobile/appStarts/screenSummary/startTypeSelector';
2727
import {BASE_URL} from 'sentry/views/performance/mobile/appStarts/settings';
28+
import {SpanSamplesPanel} from 'sentry/views/performance/mobile/components/spanSamplesPanel';
2829
import {MetricsRibbon} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/metricsRibbon';
29-
import {ScreenLoadSpanSamples} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/samples';
3030
import {ModulePageProviders} from 'sentry/views/performance/modulePageProviders';
3131
import {
3232
PRIMARY_RELEASE_ALIAS,
3333
ReleaseComparisonSelector,
3434
SECONDARY_RELEASE_ALIAS,
3535
} from 'sentry/views/starfish/components/releaseSelector';
36-
import {SpanMetricsField} from 'sentry/views/starfish/types';
36+
import {ModuleName, SpanMetricsField} from 'sentry/views/starfish/types';
3737
import {ROUTE_NAMES} from 'sentry/views/starfish/utils/routeNames';
3838
import {QueryParameterNames} from 'sentry/views/starfish/views/queryParameters';
3939

@@ -187,12 +187,13 @@ export function ScreenSummary() {
187187
<SamplesTables transactionName={transactionName} />
188188
</SamplesContainer>
189189
{spanGroup && spanOp && appStartType && (
190-
<ScreenLoadSpanSamples
190+
<SpanSamplesPanel
191191
additionalFilters={{
192192
[SpanMetricsField.APP_START_TYPE]: appStartType,
193193
...(deviceClass ? {[SpanMetricsField.DEVICE_CLASS]: deviceClass} : {}),
194194
}}
195195
groupId={spanGroup}
196+
moduleName={ModuleName.STARTUP}
196197
transactionName={transactionName}
197198
spanDescription={spanDescription}
198199
spanOp={spanOp}

Diff for: static/app/views/performance/mobile/screenload/screenLoadSpans/samples/index.tsx renamed to static/app/views/performance/mobile/components/spanSamplesPanel.tsx

+9-4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ import useOrganization from 'sentry/utils/useOrganization';
1414
import useProjects from 'sentry/utils/useProjects';
1515
import useRouter from 'sentry/utils/useRouter';
1616
import {normalizeUrl} from 'sentry/utils/withDomainRequired';
17-
import {ScreenLoadSampleContainer} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/samples/samplesContainer';
17+
import {SpanSamplesContainer} from 'sentry/views/performance/mobile/components/spanSamplesPanelContainer';
1818
import DetailPanel from 'sentry/views/starfish/components/detailPanel';
1919
import {useReleaseSelection} from 'sentry/views/starfish/queries/useReleases';
20+
import type {ModuleName} from 'sentry/views/starfish/types';
2021

2122
type Props = {
2223
groupId: string;
24+
moduleName: ModuleName;
2325
transactionName: string;
2426
additionalFilters?: Record<string, string>;
2527
onClose?: () => void;
@@ -29,8 +31,9 @@ type Props = {
2931
transactionRoute?: string;
3032
};
3133

32-
export function ScreenLoadSpanSamples({
34+
export function SpanSamplesPanel({
3335
groupId,
36+
moduleName,
3437
transactionName,
3538
transactionMethod,
3639
spanDescription,
@@ -112,8 +115,9 @@ export function ScreenLoadSpanSamples({
112115
<PageAlert />
113116
<ChartsContainer>
114117
<ChartsContainerItem key="release1">
115-
<ScreenLoadSampleContainer
118+
<SpanSamplesContainer
116119
groupId={groupId}
120+
moduleName={moduleName}
117121
transactionName={transactionName}
118122
transactionMethod={transactionMethod}
119123
release={primaryRelease}
@@ -124,8 +128,9 @@ export function ScreenLoadSpanSamples({
124128
/>
125129
</ChartsContainerItem>
126130
<ChartsContainerItem key="release2">
127-
<ScreenLoadSampleContainer
131+
<SpanSamplesContainer
128132
groupId={groupId}
133+
moduleName={moduleName}
129134
transactionName={transactionName}
130135
transactionMethod={transactionMethod}
131136
release={secondaryRelease}

Diff for: static/app/views/performance/mobile/screenload/screenLoadSpans/samples/samplesContainer.tsx renamed to static/app/views/performance/mobile/components/spanSamplesPanelContainer.tsx

+9-4
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ import {
2323
} from 'sentry/views/performance/mobile/screenload/screens/platformSelector';
2424
import {isCrossPlatform} from 'sentry/views/performance/mobile/screenload/screens/utils';
2525
import {useSpanMetrics} from 'sentry/views/starfish/queries/useDiscover';
26-
import type {SpanMetricsQueryFilters} from 'sentry/views/starfish/types';
27-
import {ModuleName, SpanMetricsField} from 'sentry/views/starfish/types';
26+
import {
27+
type ModuleName,
28+
SpanMetricsField,
29+
type SpanMetricsQueryFilters,
30+
} from 'sentry/views/starfish/types';
2831
import {formatVersionAndCenterTruncate} from 'sentry/views/starfish/utils/centerTruncate';
2932
import {DataTitles} from 'sentry/views/starfish/views/spans/types';
3033
import DurationChart from 'sentry/views/starfish/views/spanSummaryPage/sampleList/durationChart';
@@ -34,6 +37,7 @@ const {SPAN_SELF_TIME, SPAN_OP} = SpanMetricsField;
3437

3538
type Props = {
3639
groupId: string;
40+
moduleName: ModuleName;
3741
transactionName: string;
3842
additionalFilters?: Record<string, string>;
3943
project?: Project | null;
@@ -44,8 +48,9 @@ type Props = {
4448
transactionMethod?: string;
4549
};
4650

47-
export function ScreenLoadSampleContainer({
51+
export function SpanSamplesContainer({
4852
groupId,
53+
moduleName,
4954
transactionName,
5055
transactionMethod,
5156
release,
@@ -182,7 +187,7 @@ export function ScreenLoadSampleContainer({
182187
onMouseOverSample={sample => setHighlightedSpanId(sample.span_id)}
183188
groupId={groupId}
184189
transactionName={transactionName}
185-
moduleName={ModuleName.SCREEN}
190+
moduleName={moduleName}
186191
release={release}
187192
columnOrder={[
188193
{

Diff for: static/app/views/performance/mobile/screenload/screenLoadSpans/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ import useOrganization from 'sentry/utils/useOrganization';
2121
import useProjects from 'sentry/utils/useProjects';
2222
import useRouter from 'sentry/utils/useRouter';
2323
import {normalizeUrl} from 'sentry/utils/withDomainRequired';
24+
import {SpanSamplesPanel} from 'sentry/views/performance/mobile/components/spanSamplesPanel';
2425
import {
2526
ScreenCharts,
2627
YAxis,
2728
} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/charts';
2829
import {ScreenLoadEventSamples} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/eventSamples';
2930
import {MetricsRibbon} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/metricsRibbon';
30-
import {ScreenLoadSpanSamples} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/samples';
3131
import {ScreenLoadSpansTable} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/table';
3232
import {
3333
MobileCursors,
@@ -42,7 +42,7 @@ import {
4242
ReleaseComparisonSelector,
4343
SECONDARY_RELEASE_ALIAS,
4444
} from 'sentry/views/starfish/components/releaseSelector';
45-
import {SpanMetricsField} from 'sentry/views/starfish/types';
45+
import {ModuleName, SpanMetricsField} from 'sentry/views/starfish/types';
4646
import {QueryParameterNames} from 'sentry/views/starfish/views/queryParameters';
4747

4848
type Query = {
@@ -209,8 +209,9 @@ function ScreenLoadSpans() {
209209
project={project}
210210
/>
211211
{spanGroup && (
212-
<ScreenLoadSpanSamples
212+
<SpanSamplesPanel
213213
groupId={spanGroup}
214+
moduleName={ModuleName.SCREEN}
214215
transactionName={transactionName}
215216
spanDescription={spanDescription}
216217
onClose={() => {

Diff for: static/app/views/performance/mobile/ui/screenSummary/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ import useOrganization from 'sentry/utils/useOrganization';
1414
import useRouter from 'sentry/utils/useRouter';
1515
import {normalizeUrl} from 'sentry/utils/withDomainRequired';
1616
import {SamplesTables} from 'sentry/views/performance/mobile/components/samplesTables';
17-
import {ScreenLoadSpanSamples} from 'sentry/views/performance/mobile/screenload/screenLoadSpans/samples';
17+
import {SpanSamplesPanel} from 'sentry/views/performance/mobile/components/spanSamplesPanel';
1818
import {SpanOperationTable} from 'sentry/views/performance/mobile/ui/screenSummary/spanOperationTable';
1919
import {BASE_URL} from 'sentry/views/performance/mobile/ui/settings';
2020
import {ModulePageProviders} from 'sentry/views/performance/modulePageProviders';
2121
import {ReleaseComparisonSelector} from 'sentry/views/starfish/components/releaseSelector';
22-
import {SpanMetricsField} from 'sentry/views/starfish/types';
22+
import {ModuleName, SpanMetricsField} from 'sentry/views/starfish/types';
2323
import {QueryParameterNames} from 'sentry/views/starfish/views/queryParameters';
2424

2525
type Query = {
@@ -102,11 +102,12 @@ function ScreenSummary() {
102102
</SamplesContainer>
103103

104104
{spanGroup && spanOp && (
105-
<ScreenLoadSpanSamples
105+
<SpanSamplesPanel
106106
additionalFilters={{
107107
...(deviceClass ? {[SpanMetricsField.DEVICE_CLASS]: deviceClass} : {}),
108108
}}
109109
groupId={spanGroup}
110+
moduleName={ModuleName.OTHER}
110111
transactionName={transactionName}
111112
spanDescription={spanDescription}
112113
spanOp={spanOp}

0 commit comments

Comments
 (0)