Skip to content

Commit 8f0e5df

Browse files
authored
Wire up frontend for new multiple architectures insight (#103415)
<img width="2236" height="161" alt="Screenshot 2025-11-14 at 3 29 14 PM" src="https://github.com/user-attachments/assets/c5155fbb-c4cd-4019-a036-e87dd56d5092" /> <img width="686" height="492" alt="Screenshot 2025-11-14 at 3 23 37 PM" src="https://github.com/user-attachments/assets/74e2a479-4c95-48a5-b564-31dfed4fff0a" /> Also renames `AppleInsightResults` to `InsightResults` since it's not apple-specific Resolves EME-643
1 parent a396fe4 commit 8f0e5df

File tree

5 files changed

+24
-13
lines changed

5 files changed

+24
-13
lines changed

static/app/views/preprod/buildDetails/main/insights/appSizeInsights.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {AppleInsightResultsFixture} from 'sentry-fixture/preProdAppSize';
1+
import {InsightResultsFixture} from 'sentry-fixture/preProdAppSize';
22

33
import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
44

@@ -9,7 +9,7 @@ import {AppSizeInsights} from './appSizeInsights';
99
describe('AppSizeInsights', () => {
1010
const getDefaultProps = () => {
1111
const totalSize = 10240000;
12-
const insights = AppleInsightResultsFixture();
12+
const insights = InsightResultsFixture();
1313
return {
1414
processedInsights: processInsights(insights, totalSize),
1515
totalSize,
@@ -24,7 +24,7 @@ describe('AppSizeInsights', () => {
2424
});
2525

2626
it('displays only top 5 insights in the main view', () => {
27-
const manyInsights = AppleInsightResultsFixture({
27+
const manyInsights = InsightResultsFixture({
2828
image_optimization: {
2929
total_savings: 600000,
3030
optimizable_files: [

static/app/views/preprod/buildDetails/main/insights/appSizeInsightsSidebar.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {AppleInsightResultsFixture} from 'sentry-fixture/preProdAppSize';
1+
import {InsightResultsFixture} from 'sentry-fixture/preProdAppSize';
22

33
import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
44

@@ -8,7 +8,7 @@ import {AppSizeInsightsSidebar} from './appSizeInsightsSidebar';
88

99
describe('AppSizeInsightsSidebar', () => {
1010
const getDefaultProps = () => {
11-
const insights = AppleInsightResultsFixture({
11+
const insights = InsightResultsFixture({
1212
large_images: {
1313
total_savings: 128000,
1414
files: [

static/app/views/preprod/types/appSizeTypes.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type {BuildDetailsApiResponse} from 'sentry/views/preprod/types/buildDeta
77
export interface AppSizeApiResponse {
88
generated_at: string;
99
treemap: TreemapResults;
10-
insights?: AppleInsightResults;
10+
insights?: InsightResults;
1111
missing_dsym_binaries?: string[];
1212
}
1313

@@ -189,7 +189,9 @@ interface AudioCompressionInsightResult extends FilesInsightResult {}
189189

190190
interface VideoCompressionInsightResult extends FilesInsightResult {}
191191

192-
export interface AppleInsightResults {
192+
interface MultipleNativeLibraryArchsInsightResult extends FilesInsightResult {}
193+
194+
export interface InsightResults {
193195
alternate_icons_optimization?: ImageOptimizationInsightResult;
194196
audio_compression?: AudioCompressionInsightResult;
195197
duplicate_files?: DuplicateFilesInsightResult;
@@ -202,6 +204,7 @@ export interface AppleInsightResults {
202204
localized_strings_minify?: LocalizedStringCommentsInsightResult;
203205
loose_images?: LooseImagesInsightResult;
204206
main_binary_exported_symbols?: MainBinaryExportMetadataResult;
207+
multiple_native_library_archs?: MultipleNativeLibraryArchsInsightResult;
205208
small_files?: SmallFilesInsightResult;
206209
strip_binary?: StripBinaryInsightResult;
207210
unnecessary_files?: UnnecessaryFilesInsightResult;

static/app/views/preprod/utils/insightProcessing.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {t} from 'sentry/locale';
22
import type {
3-
AppleInsightResults,
43
FileSavingsResult,
54
FileSavingsResultGroup,
65
FilesInsightResult,
76
GroupsInsightResult,
7+
InsightResults,
88
OptimizableImageFile,
99
StripBinaryFileInfo,
1010
} from 'sentry/views/preprod/types/appSizeTypes';
@@ -131,6 +131,13 @@ const INSIGHT_CONFIGS: InsightConfig[] = [
131131
"Alternate icons don't need full size quality because they are only shown downscaled in the homescreen."
132132
),
133133
},
134+
{
135+
key: 'multiple_native_library_archs',
136+
name: t('Multiple native library architectures'),
137+
description: t(
138+
'Only one native library architecture is needed. Non-arm64 architectures can be removed.'
139+
),
140+
},
134141
];
135142

136143
function markDuplicateImageVariants(processedInsights: ProcessedInsight[]): void {
@@ -163,7 +170,7 @@ function markDuplicateImageVariants(processedInsights: ProcessedInsight[]): void
163170
* Process all insights into a standardized format for display
164171
*/
165172
export function processInsights(
166-
insights: AppleInsightResults,
173+
insights: InsightResults,
167174
totalSize: number
168175
): ProcessedInsight[] {
169176
const processedInsights: ProcessedInsight[] = [];
@@ -326,6 +333,7 @@ export function processInsights(
326333
'hermes_debug_info',
327334
'audio_compression',
328335
'video_compression',
336+
'multiple_native_library_archs',
329337
] as const;
330338

331339
regularInsightKeys.forEach(key => {

tests/js/fixtures/preProdAppSize.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {AppleInsightResults} from 'sentry/views/preprod/types/appSizeTypes';
1+
import type {InsightResults} from 'sentry/views/preprod/types/appSizeTypes';
22
import type {ProcessedInsight} from 'sentry/views/preprod/utils/insightProcessing';
33

44
export function ProcessedInsightFixture(
@@ -61,9 +61,9 @@ export function ProcessedInsightFixture(
6161
};
6262
}
6363

64-
export function AppleInsightResultsFixture(
65-
params: Partial<AppleInsightResults> = {}
66-
): AppleInsightResults {
64+
export function InsightResultsFixture(
65+
params: Partial<InsightResults> = {}
66+
): InsightResults {
6767
return {
6868
duplicate_files: {
6969
total_savings: 768000,

0 commit comments

Comments
 (0)