|
1 | 1 | import {Fragment} from 'react';
|
2 | 2 | import styled from '@emotion/styled';
|
3 | 3 |
|
| 4 | +import {SeerIcon} from 'sentry/components/ai/SeerIcon'; |
| 5 | +import {Tooltip} from 'sentry/components/core/tooltip'; |
| 6 | +import {AUTOFIX_TTL_IN_DAYS} from 'sentry/components/events/autofix/types'; |
4 | 7 | import EventAnnotation from 'sentry/components/events/eventAnnotation';
|
5 | 8 | import GlobalSelectionLink from 'sentry/components/globalSelectionLink';
|
6 | 9 | import ShortId from 'sentry/components/group/inboxBadges/shortId';
|
@@ -75,6 +78,19 @@ function EventOrGroupExtraDetails({data, showAssignee, showLifetime = true}: Pro
|
75 | 78 | data.issueCategory &&
|
76 | 79 | !!getReplayCountForIssue(data.id, data.issueCategory);
|
77 | 80 |
|
| 81 | + const seerAutofixLastTriggered = (data as Group).seerAutofixLastTriggered; |
| 82 | + const autofixLastRunAsDate = seerAutofixLastTriggered |
| 83 | + ? new Date(seerAutofixLastTriggered) |
| 84 | + : null; |
| 85 | + const autofixRanWithinTtl = autofixLastRunAsDate |
| 86 | + ? autofixLastRunAsDate > |
| 87 | + new Date(Date.now() - AUTOFIX_TTL_IN_DAYS * 24 * 60 * 60 * 1000) |
| 88 | + : false; |
| 89 | + const showSeer = |
| 90 | + organization.features.includes('gen-ai-features') && |
| 91 | + !organization.hideAiFeatures && |
| 92 | + autofixRanWithinTtl; |
| 93 | + |
78 | 94 | const {subtitle} = getTitle(data);
|
79 | 95 |
|
80 | 96 | const items = [
|
@@ -107,6 +123,13 @@ function EventOrGroupExtraDetails({data, showAssignee, showLifetime = true}: Pro
|
107 | 123 | </CommentsLink>
|
108 | 124 | ) : null,
|
109 | 125 | showReplayCount ? <IssueReplayCount group={data as Group} /> : null,
|
| 126 | + showSeer ? ( |
| 127 | + <Tooltip title="Seer has a potential fix for this issue" skipWrapper> |
| 128 | + <CommentsLink to={{pathname: `${issuesPath}${id}`, query: {seerDrawer: true}}}> |
| 129 | + <SeerIcon size="sm" /> |
| 130 | + </CommentsLink> |
| 131 | + </Tooltip> |
| 132 | + ) : null, |
110 | 133 | logger ? (
|
111 | 134 | <LoggerAnnotation>
|
112 | 135 | <GlobalSelectionLink
|
|
0 commit comments