Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(issue-stream): Use stacked primary secondary counts designs #79070

Merged
merged 1 commit into from
Oct 15, 2024
Merged
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
88 changes: 57 additions & 31 deletions static/app/components/stream/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -442,15 +442,20 @@ function BaseGroupRow({
</CountTooltipContent>
}
>
<PrimaryCount
value={primaryCount}
hasNewLayout={organization.features.includes('issue-stream-table-layout')}
/>
{secondaryCount !== undefined && useFilteredStats && (
<SecondaryCount
value={secondaryCount}
hasNewLayout={organization.features.includes('issue-stream-table-layout')}
/>
{hasNewLayout ? (
<CountsWrapper>
<PrimaryCount value={primaryCount} hasNewLayout={hasNewLayout} />
{secondaryCount !== undefined && useFilteredStats && (
<SecondaryCount value={secondaryCount} hasNewLayout={hasNewLayout} />
)}
</CountsWrapper>
) : (
<Fragment>
<PrimaryCount value={primaryCount} />
{secondaryCount !== undefined && useFilteredStats && (
<SecondaryCount value={secondaryCount} />
)}
</Fragment>
)}
</Tooltip>
</GuideAnchor>
Expand Down Expand Up @@ -488,16 +493,20 @@ function BaseGroupRow({
</CountTooltipContent>
}
>
<PrimaryCount
value={primaryUserCount}
hasNewLayout={organization.features.includes('issue-stream-table-layout')}
/>
{secondaryUserCount !== undefined && useFilteredStats && (
<SecondaryCount
dark
value={secondaryUserCount}
hasNewLayout={organization.features.includes('issue-stream-table-layout')}
/>
{hasNewLayout ? (
<CountsWrapper>
<PrimaryCount value={primaryUserCount} hasNewLayout={hasNewLayout} />
{secondaryUserCount !== undefined && useFilteredStats && (
<SecondaryCount value={secondaryUserCount} hasNewLayout={hasNewLayout} />
)}
</CountsWrapper>
) : (
<Fragment>
<PrimaryCount value={primaryUserCount} />
{secondaryUserCount !== undefined && useFilteredStats && (
<SecondaryCount value={secondaryUserCount} />
)}
</Fragment>
)}
</Tooltip>
);
Expand Down Expand Up @@ -542,17 +551,14 @@ function BaseGroupRow({
query={query}
source={referrer}
/>
<EventOrGroupExtraDetails
data={group}
showLifetime={!organization.features.includes('issue-stream-table-layout')}
/>
<EventOrGroupExtraDetails data={group} showLifetime={!hasNewLayout} />
</GroupSummary>
{hasGuideAnchor && issueStreamAnchor}

{withChart &&
!displayReprocessingLayout &&
issueTypeConfig.stats.enabled &&
organization.features.includes('issue-stream-table-layout') ? (
hasNewLayout ? (
<NarrowChartWrapper breakpoint={COLUMN_BREAKPOINTS.TREND}>
<GroupStatusChart
hideZeros
Expand Down Expand Up @@ -596,7 +602,7 @@ function BaseGroupRow({
)}
{withColumns.includes('event') &&
issueTypeConfig.stats.enabled &&
organization.features.includes('issue-stream-table-layout') ? (
hasNewLayout ? (
<NarrowEventsOrUsersCountsWrapper breakpoint={COLUMN_BREAKPOINTS.EVENTS}>
<InnerCountsWrapper>{groupCount}</InnerCountsWrapper>
</NarrowEventsOrUsersCountsWrapper>
Expand All @@ -609,15 +615,15 @@ function BaseGroupRow({
)}
{withColumns.includes('users') &&
issueTypeConfig.stats.enabled &&
organization.features.includes('issue-stream-table-layout') ? (
hasNewLayout ? (
<NarrowEventsOrUsersCountsWrapper breakpoint={COLUMN_BREAKPOINTS.USERS}>
<InnerCountsWrapper>{groupUsersCount}</InnerCountsWrapper>
</NarrowEventsOrUsersCountsWrapper>
) : (
<EventCountsWrapper>{groupUsersCount}</EventCountsWrapper>
)}
{withColumns.includes('priority') ? (
organization.features.includes('issue-stream-table-layout') ? (
hasNewLayout ? (
<NarrowPriorityWrapper breakpoint={COLUMN_BREAKPOINTS.PRIORITY}>
{group.priority ? (
<GroupPriority group={group} onChange={onPriorityChange} />
Expand All @@ -632,7 +638,7 @@ function BaseGroupRow({
)
) : null}
{withColumns.includes('assignee') &&
(organization.features.includes('issue-stream-table-layout') ? (
(hasNewLayout ? (
<NarrowAssigneeWrapper breakpoint={COLUMN_BREAKPOINTS.ASSIGNEE}>
<AssigneeSelector
group={group}
Expand Down Expand Up @@ -750,15 +756,35 @@ const GroupCheckBoxWrapper = styled('div')<{hasNewLayout: boolean}>`
`}
`;

const PrimaryCount = styled(Count)<{hasNewLayout: boolean}>`
const CountsWrapper = styled('div')`
display: flex;
flex-direction: column;
`;

const PrimaryCount = styled(Count)<{hasNewLayout?: boolean}>`
font-size: ${p => (p.hasNewLayout ? p.theme.fontSizeMedium : p.theme.fontSizeLarge)};
${p =>
p.hasNewLayout &&
`
display: flex;
justify-content: right;
margin-bottom: ${space(0.25)};
`}
font-variant-numeric: tabular-nums;
`;

const SecondaryCount = styled(({value, ...p}) => <Count {...p} value={value} />)<{
hasNewLayout: boolean;
hasNewLayout?: boolean;
}>`
font-size: ${p => (p.hasNewLayout ? p.theme.fontSizeMedium : p.theme.fontSizeLarge)};
font-size: ${p => (p.hasNewLayout ? p.theme.fontSizeSmall : p.theme.fontSizeLarge)};
${p =>
p.hasNewLayout &&
css`
display: flex;
justify-content: right;
color: ${p.theme.subText};
`}

font-variant-numeric: tabular-nums;

:before {
Expand Down
Loading