Skip to content

Commit 9defcdd

Browse files
committed
genai consent
1 parent 9636a8f commit 9defcdd

File tree

3 files changed

+45
-36
lines changed

3 files changed

+45
-36
lines changed

static/app/components/events/autofix/autofixSetupModal.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
useAutofixSetup,
99
} from 'sentry/components/events/autofix/useAutofixSetup';
1010
import {GuidedSteps} from 'sentry/components/guidedSteps/guidedSteps';
11-
import HookOrDefault from 'sentry/components/hookOrDefault';
1211
import ExternalLink from 'sentry/components/links/externalLink';
1312
import LoadingError from 'sentry/components/loadingError';
1413
import LoadingIndicator from 'sentry/components/loadingIndicator';
@@ -18,11 +17,6 @@ import {space} from 'sentry/styles/space';
1817
import {trackAnalytics} from 'sentry/utils/analytics';
1918
import useOrganization from 'sentry/utils/useOrganization';
2019

21-
const ConsentStep = HookOrDefault({
22-
hookName: 'component:ai-setup-data-consent',
23-
defaultComponent: null,
24-
});
25-
2620
function AutofixIntegrationStep({autofixSetup}: {autofixSetup: AutofixSetupResponse}) {
2721
if (autofixSetup.integration.ok) {
2822
return (
@@ -283,7 +277,6 @@ function AutofixSetupSteps({
283277
}) {
284278
return (
285279
<GuidedSteps>
286-
<ConsentStep hasConsented={autofixSetup.genAIConsent.ok} />
287280
<GuidedSteps.Step
288281
stepKey="integration"
289282
title={t('Install the GitHub Integration')}
@@ -349,7 +342,8 @@ export function AutofixSetupContent({
349342

350343
return (
351344
<Fragment>
352-
<Header>Set up Sentry AI</Header>
345+
<Divider />
346+
<Header>Set up Autofix</Header>
353347
<p>
354348
Sentry's AI-enabled Autofix uses all of the contextual data surrounding this error
355349
to work with you to find the root cause and create a fix.
@@ -401,3 +395,8 @@ const GithubLink = styled('div')`
401395
align-items: center;
402396
gap: ${space(0.5)};
403397
`;
398+
399+
const Divider = styled('div')`
400+
margin: ${space(3)} 0;
401+
border-bottom: 2px solid ${p => p.theme.gray100};
402+
`;

static/app/types/hooks.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ export type RouteHooks = {
7272
* Component specific hooks for DateRange and SelectorItems
7373
* These components have plan specific overrides in getsentry
7474
*/
75+
type AiSetupDataConsentProps = {
76+
groupId: string;
77+
};
7578
type AutofixSetupConsentStepProps = {hasConsented: boolean};
7679
type DateRangeProps = React.ComponentProps<typeof DateRange>;
7780

@@ -184,7 +187,7 @@ export type MembershipSettingsProps = {
184187
* Component wrapping hooks
185188
*/
186189
export type ComponentHooks = {
187-
'component:ai-setup-data-consent': () => React.ComponentType<{}>;
190+
'component:ai-setup-data-consent': () => React.ComponentType<AiSetupDataConsentProps> | null;
188191
'component:autofix-setup-step-consent': () => React.ComponentType<AutofixSetupConsentStepProps> | null;
189192
'component:codecov-integration-settings-link': () => React.ComponentType<CodecovLinkProps>;
190193
'component:confirm-account-close': () => React.ComponentType<AttemptCloseAttemptProps>;

static/app/views/issueDetails/streamline/solutionsHubDrawer.tsx

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,20 @@ export function SolutionsHubDrawer({group, project, event}: SolutionsHubDrawerPr
156156

157157
const config = getConfigForIssueType(group, project);
158158

159-
const isSetupComplete = setupData?.integration.ok && setupData?.genAIConsent.ok;
160-
const hasSummary = summaryData && !isError && setupData?.genAIConsent.ok;
159+
const hasConsent = Boolean(setupData?.genAIConsent.ok);
160+
const isAutofixSetupComplete = setupData?.integration.ok && hasConsent;
161+
162+
const hasSummary = summaryData && !isError && hasConsent;
161163

162164
const organization = useOrganization();
163165
const isSampleError = useIsSampleEvent();
166+
164167
const displayAiAutofix =
165168
shouldDisplayAiAutofixForOrganization(organization) &&
166169
config.autofix &&
167170
!shouldShowCustomErrorResourceConfig(group, project) &&
168-
hasStacktraceWithFrames(event);
169-
// !isSampleError;
171+
hasStacktraceWithFrames(event) &&
172+
!isSampleError;
170173

171174
return (
172175
<SolutionsDrawerContainer>
@@ -234,30 +237,34 @@ export function SolutionsHubDrawer({group, project, event}: SolutionsHubDrawerPr
234237
)}
235238
/>
236239
</HeaderText>
237-
{hasSummary && (
238-
<StyledCard>
239-
<GroupSummaryBody data={summaryData} isError={isError} />
240-
</StyledCard>
241-
)}
242-
{displayAiAutofix && (
240+
{!hasConsent ? (
241+
<AiSetupDataConsent groupId={group.id} />
242+
) : (
243243
<Fragment>
244-
{!isSetupLoading && !isSetupComplete ? (
245-
<SetupContainer>
246-
<AutofixSetupContent
247-
projectId={project.id}
248-
groupId={group.id}
249-
onComplete={refetchSetup}
250-
/>
251-
</SetupContainer>
252-
) : !autofixData ? (
253-
<AutofixStartBox onSend={triggerAutofix} groupId={group.id} />
254-
) : (
255-
<AutofixSteps
256-
data={autofixData}
257-
groupId={group.id}
258-
runId={autofixData.run_id}
259-
onRetry={reset}
260-
/>
244+
{hasSummary && (
245+
<StyledCard>
246+
<GroupSummaryBody data={summaryData} isError={isError} />
247+
</StyledCard>
248+
)}
249+
{displayAiAutofix && (
250+
<Fragment>
251+
{!isSetupLoading && !isAutofixSetupComplete ? (
252+
<AutofixSetupContent
253+
groupId={group.id}
254+
projectId={project.id}
255+
refetchSetup={refetchSetup}
256+
/>
257+
) : !autofixData ? (
258+
<AutofixStartBox onSend={triggerAutofix} groupId={group.id} />
259+
) : (
260+
<AutofixSteps
261+
data={autofixData}
262+
groupId={group.id}
263+
runId={autofixData.run_id}
264+
onRetry={reset}
265+
/>
266+
)}
267+
</Fragment>
261268
)}
262269
</Fragment>
263270
)}

0 commit comments

Comments
 (0)