-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(related_groups): Move same title issues below similar stack traces #81177
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,47 +74,28 @@ function RelatedIssuesSection({ | |
// This is important for traces since issues can be for any project in the org | ||
const baseUrl = `/organizations/${orgSlug}/issues/?project=-1`; | ||
let title: React.ReactNode = null; | ||
let linkToTrace: React.ReactNode = null; | ||
let extraInfo: React.ReactNode = null; | ||
let openIssuesButton: React.ReactNode = null; | ||
if (relationType === 'trace_connected' && traceMeta) { | ||
title = t('Issues in the same trace'); | ||
linkToTrace = ( | ||
<small> | ||
{t('These issues were all found within ')} | ||
<Link | ||
to={`/organizations/${orgSlug}/performance/trace/${traceMeta.trace_id}/?node=error-${traceMeta.event_id}`} | ||
> | ||
{t('this trace')} | ||
</Link> | ||
. | ||
</small> | ||
); | ||
openIssuesButton = ( | ||
<LinkButton | ||
to={`${baseUrl}&query=trace:${traceMeta.trace_id}`} | ||
size="xs" | ||
analyticsEventName="Clicked Open Issues from trace-connected related issues" | ||
analyticsEventKey="similar_issues.trace_connected_issues_clicked_open_issues" | ||
> | ||
{t('Open in Issues')} | ||
</LinkButton> | ||
); | ||
({title, extraInfo, openIssuesButton} = getTraceConnectedContent( | ||
traceMeta, | ||
baseUrl, | ||
orgSlug | ||
)); | ||
} else { | ||
title = t('Issues caused by the same root cause'); | ||
openIssuesButton = ( | ||
<LinkButton | ||
to={`${baseUrl}&query=issue.id:[${groupId},${issues}]`} | ||
size="xs" | ||
analyticsEventName="Clicked Open Issues from same-root related issues" | ||
analyticsEventKey="similar_issues.same_root_cause_clicked_open_issues" | ||
> | ||
{t('Open in Issues')} | ||
</LinkButton> | ||
title = t('Issues with similar titles'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed the section. |
||
extraInfo = t( | ||
'These issues have the same title and may have been caused by the same root cause.' | ||
); | ||
openIssuesButton = getLinkButton( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're now using a function to generate the button to share functionality. |
||
`${baseUrl}&query=issue.id:[${groupId},${issues}]`, | ||
'Clicked Open Issues from same-root related issues', | ||
'similar_issues.same_root_cause_clicked_open_issues' | ||
); | ||
} | ||
|
||
return ( | ||
<HeaderWrapper> | ||
<Fragment> | ||
{isPending ? ( | ||
<LoadingIndicator /> | ||
) : isError ? ( | ||
|
@@ -124,28 +105,67 @@ function RelatedIssuesSection({ | |
/> | ||
) : issues.length > 0 ? ( | ||
<Fragment> | ||
<Title>{title}</Title> | ||
<TextButtonWrapper> | ||
{linkToTrace} | ||
{openIssuesButton} | ||
</TextButtonWrapper> | ||
<HeaderWrapper> | ||
<Title>{title}</Title> | ||
<TextButtonWrapper> | ||
<span>{extraInfo}</span> | ||
{openIssuesButton} | ||
</TextButtonWrapper> | ||
</HeaderWrapper> | ||
<GroupList | ||
orgSlug={orgSlug} | ||
queryParams={{query: query}} | ||
source="similar-issues-tab" | ||
canSelectGroups={false} | ||
withChart={false} | ||
withColumns={['event']} | ||
/> | ||
</Fragment> | ||
) : null} | ||
</HeaderWrapper> | ||
</Fragment> | ||
); | ||
} | ||
|
||
const getTraceConnectedContent = ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code here is the same as what I grabbed from above. |
||
traceMeta: RelatedIssuesResponse['meta'], | ||
baseUrl: string, | ||
orgSlug: string | ||
) => { | ||
const title = t('Issues in the same trace'); | ||
const url = `/organizations/${orgSlug}/performance/trace/${traceMeta.trace_id}/?node=error-${traceMeta.event_id}`; | ||
const extraInfo = ( | ||
<small> | ||
{t('These issues were all found within')} | ||
<Link to={url}>{t('this trace')}</Link>. | ||
</small> | ||
); | ||
const openIssuesButton = getLinkButton( | ||
`${baseUrl}&query=trace:${traceMeta.trace_id}`, | ||
'Clicked Open Issues from trace-connected related issues', | ||
'similar_issues.trace_connected_issues_clicked_open_issues' | ||
); | ||
|
||
return {title, extraInfo, openIssuesButton}; | ||
}; | ||
|
||
const getLinkButton = (to: string, eventName: string, eventKey: string) => { | ||
return ( | ||
<LinkButton | ||
to={to} | ||
size="xs" | ||
analyticsEventName={eventName} | ||
analyticsEventKey={eventKey} | ||
> | ||
{t('Open in Issues')} | ||
</LinkButton> | ||
); | ||
}; | ||
|
||
// Export the component without feature flag controls | ||
export {GroupRelatedIssues}; | ||
|
||
const Title = styled('h4')` | ||
font-size: ${p => p.theme.fontSizeLarge}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make it the same size as issue with similar stack traces header. |
||
margin-bottom: ${space(0.75)}; | ||
`; | ||
|
||
|
@@ -158,7 +178,9 @@ const HeaderWrapper = styled('div')` | |
`; | ||
|
||
const TextButtonWrapper = styled('div')` | ||
align-items: center; | ||
display: flex; | ||
justify-content: space-between; | ||
margin-bottom: ${space(1)}; | ||
width: 100%; | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,7 +193,7 @@ function SimilarStackTrace({project}: Props) { | |
{status === 'ready' && !hasSimilarItems && !hasSimilarityEmbeddingsFeature && ( | ||
<Panel> | ||
<EmptyStateWarning> | ||
<p>{t("There don't seem to be any similar issues.")}</p> | ||
<Title>{t("There don't seem to be any similar issues.")}</Title> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should change the font for similarity embeddings as well here to match |
||
</EmptyStateWarning> | ||
</Panel> | ||
)} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved these lines into a function.