Skip to content

Commit e9ae7cd

Browse files
cvxluoryan953
authored andcommitted
feat(top-issues): flex column heights (#104380)
Allow cards to be separate heights for a brick-layer pattern.
1 parent e37dc75 commit e9ae7cd

File tree

1 file changed

+45
-37
lines changed

1 file changed

+45
-37
lines changed

static/app/views/issueList/pages/dynamicGrouping.tsx

Lines changed: 45 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ function ClusterCard({
353353
selectedTags?: Set<string>;
354354
}) {
355355
const organization = useOrganization();
356-
const issueCount = cluster.group_ids.length;
357356
const [showDescription, setShowDescription] = useState(false);
358357
const clusterStats = useClusterStats(cluster.group_ids);
359358
const {copy} = useCopyToClipboard();
@@ -445,16 +444,11 @@ function ClusterCard({
445444
<IssuesSection>
446445
<IssuesSectionHeader>
447446
<Text size="sm" bold uppercase>
448-
{tn('%s Issue', '%s Issues', issueCount)}
447+
{t('Preview Issues')}
449448
</Text>
450449
</IssuesSectionHeader>
451450
<IssuesList>
452451
<ClusterIssues groupIds={cluster.group_ids} />
453-
{cluster.group_ids.length > 3 && (
454-
<MoreIssuesIndicator>
455-
{t('+ %s more similar issues', cluster.group_ids.length - 3)}
456-
</MoreIssuesIndicator>
457-
)}
458452
</IssuesList>
459453
</IssuesSection>
460454

@@ -493,7 +487,9 @@ function ClusterCard({
493487
<Link
494488
to={`/organizations/${organization.slug}/issues/?query=issue.id:[${cluster.group_ids.join(',')}]`}
495489
>
496-
<Button size="sm">{t('View All Issues')}</Button>
490+
<Button size="sm">
491+
{t('View All Issues') + ` (${cluster.group_ids.length})`}
492+
</Button>
497493
</Link>
498494
</CardFooter>
499495
</CardContainer>
@@ -916,23 +912,37 @@ function DynamicGrouping() {
916912
</Text>
917913
</Container>
918914
) : (
919-
<Fragment>
920-
<CardsGrid>
921-
{displayedClusters.map(cluster => (
922-
<ClusterCard
923-
key={cluster.cluster_id}
924-
cluster={cluster}
925-
onTagClick={handleTagClick}
926-
selectedTags={selectedTags}
927-
/>
928-
))}
929-
</CardsGrid>
930-
{hasMoreClusters && (
931-
<ShowMoreButton onClick={handleShowMore}>
932-
{t('Show more clusters (%s more)', remainingClusterCount)}
933-
</ShowMoreButton>
934-
)}
935-
</Fragment>
915+
<CardsGrid>
916+
<CardsColumn>
917+
{displayedClusters
918+
.filter((_, index) => index % 2 === 0)
919+
.map(cluster => (
920+
<ClusterCard
921+
key={cluster.cluster_id}
922+
cluster={cluster}
923+
onTagClick={handleTagClick}
924+
selectedTags={selectedTags}
925+
/>
926+
))}
927+
</CardsColumn>
928+
<CardsColumn>
929+
{displayedClusters
930+
.filter((_, index) => index % 2 === 1)
931+
.map(cluster => (
932+
<ClusterCard
933+
key={cluster.cluster_id}
934+
cluster={cluster}
935+
onTagClick={handleTagClick}
936+
selectedTags={selectedTags}
937+
/>
938+
))}
939+
</CardsColumn>
940+
</CardsGrid>
941+
)}
942+
{hasMoreClusters && (
943+
<ShowMoreButton onClick={handleShowMore}>
944+
{t('Show more clusters (%s more)', remainingClusterCount)}
945+
</ShowMoreButton>
936946
)}
937947
</CardsSection>
938948
</PageWrapper>
@@ -961,16 +971,22 @@ const CardsSection = styled('div')`
961971
`;
962972

963973
const CardsGrid = styled('div')`
964-
display: grid;
965-
grid-template-columns: repeat(2, 1fr);
974+
display: flex;
966975
gap: ${space(3)};
967-
align-items: stretch;
968976
969977
@media (max-width: ${p => p.theme.breakpoints.lg}) {
970-
grid-template-columns: 1fr;
978+
flex-direction: column;
971979
}
972980
`;
973981

982+
const CardsColumn = styled('div')`
983+
flex: 1;
984+
display: flex;
985+
flex-direction: column;
986+
gap: ${space(3)};
987+
min-width: 0;
988+
`;
989+
974990
// Card with subtle hover effect
975991
const CardContainer = styled('div')`
976992
background: ${p => p.theme.background};
@@ -1073,14 +1089,6 @@ const IssuesList = styled('div')`
10731089
gap: ${space(1.5)};
10741090
`;
10751091

1076-
const MoreIssuesIndicator = styled('div')`
1077-
font-size: ${p => p.theme.fontSize.sm};
1078-
color: ${p => p.theme.subText};
1079-
text-align: center;
1080-
font-style: italic;
1081-
padding-top: ${space(1)};
1082-
`;
1083-
10841092
// Zone 4: Footer with actions
10851093
const CardFooter = styled('div')`
10861094
padding: ${space(2)} ${space(3)};

0 commit comments

Comments
 (0)