Skip to content

Commit 471491b

Browse files
armenzgevanh
authored andcommitted
feat(related_groups): Move same title issues below similar stack traces (#81177)
Similar Issues changes: * Show "issues with similar stack trace" before "issues with same root cause" * Rename "issues with same root cause" with "issues with similar titles" * Added description to the section * Removed events, users and assignee * Reduce title font Next steps: * Bring further UI & style consistency between the two sections * Refactor the code into the same directory Before: <img width="463" alt="image" src="https://github.com/user-attachments/assets/6ff67422-e145-46d7-a3bd-2d79d227ee23"> After: <img width="922" alt="image" src="https://github.com/user-attachments/assets/0015bc20-37c9-4f19-b7d7-6b0bad22cb1a"> Narrow view: <img width="463" alt="image" src="https://github.com/user-attachments/assets/ce13c37f-199d-46f3-a855-afd3023bda94"> Wide view: <img width="942" alt="image" src="https://github.com/user-attachments/assets/c1faab56-c96c-42e0-91e2-f5715cefd0a6">
1 parent f7b773d commit 471491b

File tree

3 files changed

+66
-44
lines changed

3 files changed

+66
-44
lines changed

static/app/views/issueDetails/groupRelatedIssues/index.tsx

Lines changed: 62 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -74,47 +74,28 @@ function RelatedIssuesSection({
7474
// This is important for traces since issues can be for any project in the org
7575
const baseUrl = `/organizations/${orgSlug}/issues/?project=-1`;
7676
let title: React.ReactNode = null;
77-
let linkToTrace: React.ReactNode = null;
77+
let extraInfo: React.ReactNode = null;
7878
let openIssuesButton: React.ReactNode = null;
7979
if (relationType === 'trace_connected' && traceMeta) {
80-
title = t('Issues in the same trace');
81-
linkToTrace = (
82-
<small>
83-
{t('These issues were all found within ')}
84-
<Link
85-
to={`/organizations/${orgSlug}/performance/trace/${traceMeta.trace_id}/?node=error-${traceMeta.event_id}`}
86-
>
87-
{t('this trace')}
88-
</Link>
89-
.
90-
</small>
91-
);
92-
openIssuesButton = (
93-
<LinkButton
94-
to={`${baseUrl}&query=trace:${traceMeta.trace_id}`}
95-
size="xs"
96-
analyticsEventName="Clicked Open Issues from trace-connected related issues"
97-
analyticsEventKey="similar_issues.trace_connected_issues_clicked_open_issues"
98-
>
99-
{t('Open in Issues')}
100-
</LinkButton>
101-
);
80+
({title, extraInfo, openIssuesButton} = getTraceConnectedContent(
81+
traceMeta,
82+
baseUrl,
83+
orgSlug
84+
));
10285
} else {
103-
title = t('Issues caused by the same root cause');
104-
openIssuesButton = (
105-
<LinkButton
106-
to={`${baseUrl}&query=issue.id:[${groupId},${issues}]`}
107-
size="xs"
108-
analyticsEventName="Clicked Open Issues from same-root related issues"
109-
analyticsEventKey="similar_issues.same_root_cause_clicked_open_issues"
110-
>
111-
{t('Open in Issues')}
112-
</LinkButton>
86+
title = t('Issues with similar titles');
87+
extraInfo = t(
88+
'These issues have the same title and may have been caused by the same root cause.'
89+
);
90+
openIssuesButton = getLinkButton(
91+
`${baseUrl}&query=issue.id:[${groupId},${issues}]`,
92+
'Clicked Open Issues from same-root related issues',
93+
'similar_issues.same_root_cause_clicked_open_issues'
11394
);
11495
}
11596

11697
return (
117-
<HeaderWrapper>
98+
<Fragment>
11899
{isPending ? (
119100
<LoadingIndicator />
120101
) : isError ? (
@@ -124,28 +105,67 @@ function RelatedIssuesSection({
124105
/>
125106
) : issues.length > 0 ? (
126107
<Fragment>
127-
<Title>{title}</Title>
128-
<TextButtonWrapper>
129-
{linkToTrace}
130-
{openIssuesButton}
131-
</TextButtonWrapper>
108+
<HeaderWrapper>
109+
<Title>{title}</Title>
110+
<TextButtonWrapper>
111+
<span>{extraInfo}</span>
112+
{openIssuesButton}
113+
</TextButtonWrapper>
114+
</HeaderWrapper>
132115
<GroupList
133116
orgSlug={orgSlug}
134117
queryParams={{query: query}}
135118
source="similar-issues-tab"
136119
canSelectGroups={false}
137120
withChart={false}
121+
withColumns={['event']}
138122
/>
139123
</Fragment>
140124
) : null}
141-
</HeaderWrapper>
125+
</Fragment>
142126
);
143127
}
144128

129+
const getTraceConnectedContent = (
130+
traceMeta: RelatedIssuesResponse['meta'],
131+
baseUrl: string,
132+
orgSlug: string
133+
) => {
134+
const title = t('Issues in the same trace');
135+
const url = `/organizations/${orgSlug}/performance/trace/${traceMeta.trace_id}/?node=error-${traceMeta.event_id}`;
136+
const extraInfo = (
137+
<small>
138+
{t('These issues were all found within')}
139+
<Link to={url}>{t('this trace')}</Link>.
140+
</small>
141+
);
142+
const openIssuesButton = getLinkButton(
143+
`${baseUrl}&query=trace:${traceMeta.trace_id}`,
144+
'Clicked Open Issues from trace-connected related issues',
145+
'similar_issues.trace_connected_issues_clicked_open_issues'
146+
);
147+
148+
return {title, extraInfo, openIssuesButton};
149+
};
150+
151+
const getLinkButton = (to: string, eventName: string, eventKey: string) => {
152+
return (
153+
<LinkButton
154+
to={to}
155+
size="xs"
156+
analyticsEventName={eventName}
157+
analyticsEventKey={eventKey}
158+
>
159+
{t('Open in Issues')}
160+
</LinkButton>
161+
);
162+
};
163+
145164
// Export the component without feature flag controls
146165
export {GroupRelatedIssues};
147166

148167
const Title = styled('h4')`
168+
font-size: ${p => p.theme.fontSizeLarge};
149169
margin-bottom: ${space(0.75)};
150170
`;
151171

@@ -158,7 +178,9 @@ const HeaderWrapper = styled('div')`
158178
`;
159179

160180
const TextButtonWrapper = styled('div')`
181+
align-items: center;
161182
display: flex;
162183
justify-content: space-between;
163184
margin-bottom: ${space(1)};
185+
width: 100%;
164186
`;

static/app/views/issueDetails/groupSimilarIssues/similarIssues.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ function GroupSimilarIssues() {
3535

3636
return (
3737
<Fragment>
38-
<Feature features="related-issues">
39-
<GroupRelatedIssues />
40-
</Feature>
4138
<Feature features="similarity-view" project={project}>
4239
<SimilarStackTrace project={project} />
4340
</Feature>
41+
<Feature features="related-issues">
42+
<GroupRelatedIssues />
43+
</Feature>
4444
</Fragment>
4545
);
4646
}

static/app/views/issueDetails/groupSimilarIssues/similarStackTrace/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ function SimilarStackTrace({project}: Props) {
193193
{status === 'ready' && !hasSimilarItems && !hasSimilarityEmbeddingsFeature && (
194194
<Panel>
195195
<EmptyStateWarning>
196-
<p>{t("There don't seem to be any similar issues.")}</p>
196+
<Title>{t("There don't seem to be any similar issues.")}</Title>
197197
</EmptyStateWarning>
198198
</Panel>
199199
)}

0 commit comments

Comments
 (0)