Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions static/app/components/events/groupingInfo/groupingInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,22 @@ export default function GroupingInfo({
});

const variants = groupInfo?.variants
? Object.values(groupInfo.variants).sort((a, b) => {
// Sort contributing variants before non-contributing ones
if (a.contributes && !b.contributes) {
return -1;
}
if (b.contributes && !a.contributes) {
return 1;
}
? Object.values(groupInfo.variants)
.filter((variant): variant is NonNullable<typeof variant> => variant !== null)
.sort((a, b) => {
// 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() ?? '';
const descB = b.description?.toLowerCase() ?? '';
return descA.localeCompare(descB);
})
// Sort by description alphabetically
const descA = a.description?.toLowerCase() ?? '';
const descB = b.description?.toLowerCase() ?? '';
return descA.localeCompare(descB);
})
: [];

const feedbackComponent = (
Expand Down
Loading