diff --git a/static/app/components/events/groupingInfo/groupingInfo.tsx b/static/app/components/events/groupingInfo/groupingInfo.tsx index 7d316aedcd38d9..1e1022eddef425 100644 --- a/static/app/components/events/groupingInfo/groupingInfo.tsx +++ b/static/app/components/events/groupingInfo/groupingInfo.tsx @@ -41,10 +41,13 @@ export default function GroupingInfo({ const variants = groupInfo ? Object.values(groupInfo).sort((a, b) => { - // Sort variants with hashes before those without - if (a.hash && !b.hash) { + // Sort contributing variants before non-contributing ones + if (a.contributes && !b.contributes) { return -1; } + if (b.contributes && !a.contributes) { + return 1; + } // Sort by description alphabetically const descA = a.description?.toLowerCase() ?? ''; @@ -101,7 +104,7 @@ export default function GroupingInfo({ {isPending && !hasPerformanceGrouping ? : null} {hasPerformanceGrouping || isSuccess ? variants - .filter(variant => variant.hash !== null || showNonContributing) + .filter(variant => variant.contributes || showNonContributing) .map((variant, index, filteredVariants) => ( { url: `/projects/org-slug/project-slug/events/${event.id}/grouping-info/`, body: { app: { + contributes: true, description: 'variant description', hash: '123', hashMismatch: false, diff --git a/static/app/components/events/groupingInfo/groupingSummary.tsx b/static/app/components/events/groupingInfo/groupingSummary.tsx index f6a6e503f7430a..e84424d6a5e7a3 100644 --- a/static/app/components/events/groupingInfo/groupingSummary.tsx +++ b/static/app/components/events/groupingInfo/groupingSummary.tsx @@ -24,7 +24,7 @@ export function GroupInfoSummary({ }); const groupedBy = groupInfo ? Object.values(groupInfo) - .filter(variant => variant.hash !== null && variant.description !== null) + .filter(variant => variant.contributes && variant.description !== null) .map(variant => variant.description!) .sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase())) .join(', ') diff --git a/static/app/components/events/groupingInfo/groupingVariant.spec.tsx b/static/app/components/events/groupingInfo/groupingVariant.spec.tsx index 33530dfee78c38..9ffacd71e57260 100644 --- a/static/app/components/events/groupingInfo/groupingVariant.spec.tsx +++ b/static/app/components/events/groupingInfo/groupingVariant.spec.tsx @@ -38,6 +38,7 @@ describe('Grouping Variant', () => { }); const performanceIssueVariant = { type: EventGroupVariantType.PERFORMANCE_PROBLEM, + contributes: true, description: 'performance issue', hash: 'hash3', hashMismatch: false, diff --git a/static/app/components/events/groupingInfo/groupingVariant.tsx b/static/app/components/events/groupingInfo/groupingVariant.tsx index bf61292304988b..2a85efd9b927ed 100644 --- a/static/app/components/events/groupingInfo/groupingVariant.tsx +++ b/static/app/components/events/groupingInfo/groupingVariant.tsx @@ -74,7 +74,7 @@ function GroupingVariant({event, variant, showNonContributing}: GroupingVariantP const data: VariantData = []; let component: EventGroupComponent | undefined; - if (!showNonContributing && variant.hash === null) { + if (!showNonContributing && !variant.contributes) { return [data, component]; } @@ -156,7 +156,7 @@ function GroupingVariant({event, variant, showNonContributing}: GroupingVariantP }; const renderTitle = () => { - const isContributing = variant.hash !== null; + const isContributing = variant.contributes; const hint = variant.hint; diff --git a/static/app/components/events/groupingInfo/useEventGroupingInfo.tsx b/static/app/components/events/groupingInfo/useEventGroupingInfo.tsx index d4683283c05f6d..bfa8aca59befdd 100644 --- a/static/app/components/events/groupingInfo/useEventGroupingInfo.tsx +++ b/static/app/components/events/groupingInfo/useEventGroupingInfo.tsx @@ -28,6 +28,7 @@ function generatePerformanceGroupInfo({ return group ? { [group.issueType]: { + contributes: true, description: t('performance problem'), hash: event.occurrence?.fingerprint[0] || '', hashMismatch: false, diff --git a/static/app/types/event.tsx b/static/app/types/event.tsx index c7a31069c06d83..8edd0041c011b7 100644 --- a/static/app/types/event.tsx +++ b/static/app/types/event.tsx @@ -58,6 +58,7 @@ export const enum EventGroupVariantType { } interface BaseVariant { + contributes: boolean; description: string | null; hash: string | null; hashMismatch: boolean;