Skip to content

Commit d6e169c

Browse files
authored
fix(ai-consent): Use new generative AI privacy notice in Seer drawer (#103116)
1 parent d64cff8 commit d6e169c

File tree

7 files changed

+70
-77
lines changed

7 files changed

+70
-77
lines changed

static/app/components/aiPrivacyTooltip.tsx

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,56 @@
1-
import type {ReactNode} from 'react';
1+
import type {ComponentProps, ReactNode} from 'react';
22

33
import {ExternalLink} from '@sentry/scraps/link/link';
44

55
import {Tooltip, type TooltipProps} from 'sentry/components/core/tooltip';
66
import {tct} from 'sentry/locale';
77

8-
interface AiPrivacyTooltipProps extends Omit<TooltipProps, 'title' | 'children'> {
8+
interface AiPrivacyNoticeProps {
9+
linkProps?: Partial<ComponentProps<typeof ExternalLink>>;
10+
}
11+
12+
interface AiPrivacyTooltipProps
13+
extends Omit<TooltipProps, 'title' | 'children'>,
14+
AiPrivacyNoticeProps {
915
children: ReactNode;
1016
}
1117

18+
const AI_PRIVACY_NOTICE_LINK =
19+
'https://docs.sentry.io/product/ai-in-sentry/ai-privacy-and-security/';
20+
21+
/**
22+
* This notice should be presented along with any AI-powered feature.
23+
*/
24+
export function AiPrivacyNotice({linkProps = {}}: AiPrivacyNoticeProps) {
25+
return tct(
26+
'Powered by generative AI. Learn more about our [link:AI privacy principles].',
27+
{
28+
link: <ExternalLink href={AI_PRIVACY_NOTICE_LINK} {...linkProps} />,
29+
}
30+
);
31+
}
32+
33+
/**
34+
* A shortened version of the privacy noice, useful for tooltips or places where space is limited.
35+
*/
36+
function AiPrivacyNoticeShort({linkProps = {}}: AiPrivacyNoticeProps) {
37+
return tct(`Powered by genAI. [link:Learn more.]`, {
38+
link: <ExternalLink href={AI_PRIVACY_NOTICE_LINK} {...linkProps} />,
39+
});
40+
}
41+
1242
/**
13-
* A tooltip wrapper that links to AI privacy and security documentation.
43+
* A tooltip wrapper for the privacy notice.
1444
*/
15-
export function AiPrivacyTooltip({children, ...tooltipProps}: AiPrivacyTooltipProps) {
45+
export function AiPrivacyTooltip({
46+
children,
47+
linkProps,
48+
...tooltipProps
49+
}: AiPrivacyTooltipProps) {
1650
return (
1751
<Tooltip
1852
isHoverable
19-
title={tct(`Powered by genAI. [link:Learn more.]`, {
20-
link: (
21-
<ExternalLink href="https://docs.sentry.io/product/ai-in-sentry/ai-privacy-and-security/" />
22-
),
23-
})}
53+
title={<AiPrivacyNoticeShort linkProps={linkProps} />}
2454
{...tooltipProps}
2555
>
2656
{children}

static/app/components/group/groupSummary.tsx

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import {isValidElement, useEffect, useLayoutEffect, useState} from 'react';
22
import styled from '@emotion/styled';
33
import {motion} from 'framer-motion';
44

5-
import {ExternalLink} from '@sentry/scraps/link';
6-
import {Tooltip} from '@sentry/scraps/tooltip';
7-
5+
import {AiPrivacyTooltip} from 'sentry/components/aiPrivacyTooltip';
86
import {Button} from 'sentry/components/core/button';
97
import {Flex} from 'sentry/components/core/layout';
108
import {Text} from 'sentry/components/core/text';
@@ -18,7 +16,7 @@ import {
1816
IconRefresh,
1917
IconSpan,
2018
} from 'sentry/icons';
21-
import {t, tct} from 'sentry/locale';
19+
import {t} from 'sentry/locale';
2220
import {space} from 'sentry/styles/space';
2321
import type {Event} from 'sentry/types/event';
2422
import type {Group} from 'sentry/types/group';
@@ -217,20 +215,9 @@ function GroupSummaryPreview({
217215
<InsightCard key={card.id}>
218216
<CardTitle>
219217
<CardTitleIcon>{card.icon}</CardTitleIcon>
220-
<Tooltip
221-
title={tct(
222-
'Powered by generative AI. Learn more about our [link:AI privacy principles].',
223-
{
224-
link: (
225-
<ExternalLink href="https://docs.sentry.io/product/ai-in-sentry/ai-privacy-and-security/" />
226-
),
227-
}
228-
)}
229-
showUnderline
230-
isHoverable
231-
>
218+
<AiPrivacyTooltip showUnderline isHoverable>
232219
<CardTitleText>{card.title}</CardTitleText>
233-
</Tooltip>
220+
</AiPrivacyTooltip>
234221
</CardTitle>
235222
<CardContentContainer>
236223
<CardLineDecorationWrapper>

static/app/components/searchQueryBuilder/askSeer/askSeerOption.tsx

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import {useRef, useState} from 'react';
22
import {useOption} from '@react-aria/listbox';
33
import type {ComboBoxState} from '@react-stately/combobox';
44

5-
import {ExternalLink} from '@sentry/scraps/link';
6-
import {Tooltip} from '@sentry/scraps/tooltip';
7-
5+
import {AiPrivacyTooltip} from 'sentry/components/aiPrivacyTooltip';
86
import {FeatureBadge} from 'sentry/components/core/badge/featureBadge';
97
import InteractionStateLayer from 'sentry/components/core/interactionStateLayer';
108
import {
@@ -13,7 +11,7 @@ import {
1311
} from 'sentry/components/searchQueryBuilder/askSeer/components';
1412
import {useSearchQueryBuilder} from 'sentry/components/searchQueryBuilder/context';
1513
import {IconSeer} from 'sentry/icons';
16-
import {t, tct} from 'sentry/locale';
14+
import {t} from 'sentry/locale';
1715
import {trackAnalytics} from 'sentry/utils/analytics';
1816
import useOrganization from 'sentry/utils/useOrganization';
1917

@@ -56,27 +54,18 @@ export function AskSeerOption<T>({state}: {state: ComboBoxState<T>}) {
5654
<AskSeerListItem ref={ref} onClick={handleClick} {...optionProps}>
5755
<InteractionStateLayer isHovered={isFocused} isPressed={isPressed} />
5856
<IconSeer />
59-
<Tooltip
60-
title={tct(
61-
'Powered by generative AI. Learn more about our [dataProcessingPolicy:AI privacy principles].',
62-
{
63-
dataProcessingPolicy: (
64-
<ExternalLink
65-
onMouseOver={() => setOptionDisableOverride(true)}
66-
onMouseOut={() => setOptionDisableOverride(false)}
67-
href="https://docs.sentry.io/product/ai-in-sentry/ai-privacy-and-security/"
68-
/>
69-
),
70-
}
71-
)}
72-
isHoverable
57+
<AiPrivacyTooltip
58+
linkProps={{
59+
onMouseOver: () => setOptionDisableOverride(true),
60+
onMouseOut: () => setOptionDisableOverride(false),
61+
}}
7362
showUnderline={hasAskSeerConsentFlowChanges}
7463
disabled={!hasAskSeerConsentFlowChanges}
7564
>
7665
<AskSeerLabel {...labelProps}>
7766
{t('Ask Seer to build your query')} <FeatureBadge type="beta" />
7867
</AskSeerLabel>
79-
</Tooltip>
68+
</AiPrivacyTooltip>
8069
</AskSeerListItem>
8170
);
8271
}

static/app/components/searchQueryBuilder/index.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4875,11 +4875,11 @@ describe('SearchQueryBuilder', () => {
48754875

48764876
await userEvent.hover(askSeerText);
48774877

4878-
const tooltipTitle = await screen.findByText(/Powered by generative AI/);
4878+
const tooltipTitle = await screen.findByText(/Powered by genAI/);
48794879
expect(tooltipTitle).toBeInTheDocument();
48804880
expect(tooltipTitle).toBeVisible();
48814881

4882-
const tooltipLink = screen.getByText(/AI privacy principles/);
4882+
const tooltipLink = screen.getByText(/Learn more/);
48834883
expect(tooltipLink).toBeInTheDocument();
48844884
expect(tooltipLink).toBeVisible();
48854885
expect(tooltipLink).toHaveAttribute(

static/app/data/forms/userFeedback.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import {Fragment} from 'react';
2+
3+
import {AiPrivacyNotice} from 'sentry/components/aiPrivacyTooltip';
14
import type {JsonFormObject} from 'sentry/components/forms/types';
25
import {t, tct} from 'sentry/locale';
36

@@ -43,15 +46,13 @@ const formGroups: JsonFormObject[] = [
4346
name: 'sentry:feedback_ai_spam_detection',
4447
type: 'boolean',
4548
label: t('Enable Spam Detection'),
46-
help: () =>
47-
tct(
48-
'Toggles whether or not to enable auto spam detection in User Feedback. Powered by generative AI. Learn more about our [link:AI privacy principles].',
49-
{
50-
link: (
51-
<a href="https://docs.sentry.io/product/ai-in-sentry/ai-privacy-and-security/" />
52-
),
53-
}
54-
),
49+
help: () => (
50+
<Fragment>
51+
{t('Toggles whether or not to enable auto spam detection in User Feedback.')}
52+
<br />
53+
<AiPrivacyNotice />
54+
</Fragment>
55+
),
5556
getData: data => ({options: data}),
5657
visible: ({features, hasAiEnabled}) =>
5758
features.has('user-feedback-spam-ingest') && hasAiEnabled,

static/app/views/issueDetails/streamline/sidebar/seerDrawer.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ import {css} from '@emotion/react';
33
import styled from '@emotion/styled';
44

55
import Feature from 'sentry/components/acl/feature';
6+
import {AiPrivacyNotice} from 'sentry/components/aiPrivacyTooltip';
67
import {Breadcrumbs as NavigationBreadcrumbs} from 'sentry/components/breadcrumbs';
78
import {ProjectAvatar} from 'sentry/components/core/avatar/projectAvatar';
89
import {Button} from 'sentry/components/core/button';
910
import {ButtonBar} from 'sentry/components/core/button/buttonBar';
1011
import {LinkButton} from 'sentry/components/core/button/linkButton';
1112
import {Flex, Stack} from 'sentry/components/core/layout';
12-
import {ExternalLink, Link} from 'sentry/components/core/link';
13+
import {Link} from 'sentry/components/core/link';
1314
import {DateTime} from 'sentry/components/dateTime';
1415
import AutofixFeedback from 'sentry/components/events/autofix/autofixFeedback';
1516
import {AutofixStartBox} from 'sentry/components/events/autofix/autofixStartBox';
@@ -249,14 +250,7 @@ export function SeerDrawer({group, project, event}: SeerDrawerProps) {
249250
title={
250251
<Flex direction="column" gap="md">
251252
<div>
252-
{tct(
253-
'Seer models are powered by generative Al. Per our [dataDocs:data usage policies], Sentry does not use your data to train Seer models or share your data with other customers without your express consent.',
254-
{
255-
dataDocs: (
256-
<ExternalLink href="https://docs.sentry.io/product/issues/issue-details/sentry-ai/#data-processing" />
257-
),
258-
}
259-
)}
253+
<AiPrivacyNotice />
260254
</div>
261255
<div>
262256
{tct('Seer can be turned off in [settingsDocs:Settings].', {

static/gsApp/components/ai/AiSetupDataConsent.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import styled from '@emotion/styled';
44
import autofixSetupImg from 'sentry-images/features/autofix-setup.svg';
55

66
import {addSuccessMessage} from 'sentry/actionCreators/indicator';
7+
import {AiPrivacyNotice} from 'sentry/components/aiPrivacyTooltip';
78
import {Alert} from 'sentry/components/core/alert';
89
import {Button} from 'sentry/components/core/button';
910
import {Flex} from 'sentry/components/core/layout';
@@ -282,18 +283,9 @@ function AiSetupDataConsent({groupId}: AiSetupDataConsentProps) {
282283
</ButtonWrapper>
283284
</Fragment>
284285
)}
285-
{!orgHasAcknowledged && (
286-
<LegalText>
287-
{tct(
288-
'Seer models are powered by generative AI. Per our [dataLink:data usage policies], Sentry does not share AI-generated output from your data with other customers or use your data to train generative AI models without your express consent.',
289-
{
290-
dataLink: (
291-
<ExternalLink href="https://docs.sentry.io/product/security/ai-ml-policy/#use-of-identifying-data-for-generative-ai-features" />
292-
),
293-
}
294-
)}
295-
</LegalText>
296-
)}
286+
<LegalText>
287+
<AiPrivacyNotice />
288+
</LegalText>
297289
</SingleCard>
298290
{warnAboutGithubIntegration && (
299291
<Alert type="warning" showIcon={false}>

0 commit comments

Comments
 (0)