Skip to content

Commit 3a35a58

Browse files
roagaiamrajjoshi
authored andcommitted
feat(issue stream): Add seer icon when autofix available (#91413)
If an autofix run is present on an issue, show a little icon next to the comment and replay count icons. Clicking it will open the issue and the autofix drawer (same pattern as the comments icon). [Designs](https://www.figma.com/design/p2DOzd1RwAHQbq0v6KaYmF/Issue-Details?node-id=7729-53615&t=wzJejEaQM3rAARdV-1) <img width="956" alt="Screenshot 2025-05-10 at 11 48 19 AM" src="https://github.com/user-attachments/assets/623f4a51-e912-45a7-bf2b-12f88d877da6" />
1 parent cc92877 commit 3a35a58

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

static/app/components/eventOrGroupExtraDetails.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import {Fragment} from 'react';
22
import styled from '@emotion/styled';
33

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';
47
import EventAnnotation from 'sentry/components/events/eventAnnotation';
58
import GlobalSelectionLink from 'sentry/components/globalSelectionLink';
69
import ShortId from 'sentry/components/group/inboxBadges/shortId';
@@ -75,6 +78,19 @@ function EventOrGroupExtraDetails({data, showAssignee, showLifetime = true}: Pro
7578
data.issueCategory &&
7679
!!getReplayCountForIssue(data.id, data.issueCategory);
7780

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+
7894
const {subtitle} = getTitle(data);
7995

8096
const items = [
@@ -107,6 +123,13 @@ function EventOrGroupExtraDetails({data, showAssignee, showLifetime = true}: Pro
107123
</CommentsLink>
108124
) : null,
109125
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,
110133
logger ? (
111134
<LoggerAnnotation>
112135
<GlobalSelectionLink

static/app/components/events/autofix/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,3 +266,5 @@ export interface SeerRepoDefinition {
266266
export interface ProjectSeerPreferences {
267267
repositories: SeerRepoDefinition[];
268268
}
269+
270+
export const AUTOFIX_TTL_IN_DAYS = 30;

static/app/types/group.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,8 @@ export interface BaseGroup {
882882
latestEventHasAttachments?: boolean;
883883
openPeriods?: GroupOpenPeriod[] | null;
884884
owners?: SuggestedOwner[] | null;
885+
seerAutofixLastTriggered?: string | null;
886+
seerFixabilityScore?: number | null;
885887
sentryAppIssues?: PlatformExternalIssue[];
886888
substatus?: GroupSubstatus | null;
887889
}

0 commit comments

Comments
 (0)