Skip to content

Commit dd3c630

Browse files
committed
fix(seer): Add links to manage your agent integrations, whenever a user can choose an agent
1 parent b62f69f commit dd3c630

File tree

5 files changed

+103
-15
lines changed

5 files changed

+103
-15
lines changed

static/app/views/settings/seer/overview/autofixOverviewSection.tsx

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import type {Project} from 'sentry/types/project';
2424
import {useFetchAllPages} from 'sentry/utils/api/apiFetch';
2525
import {fetchMutation} from 'sentry/utils/queryClient';
2626
import {useInfiniteQuery} from 'sentry/utils/queryClient';
27+
import {normalizeUrl} from 'sentry/utils/url/normalizeUrl';
2728
import {useOrganization} from 'sentry/utils/useOrganization';
2829
import {useProjects} from 'sentry/utils/useProjects';
2930
import {
@@ -182,9 +183,27 @@ function AgentNameForm({
182183
<Stack gap="md">
183184
<field.Layout.Row
184185
label={t('Default Preferred Coding Agent')}
185-
hintText={t(
186-
'For new projects, select which coding agent to use when proposing code changes.'
187-
)}
186+
hintText={
187+
<Text>
188+
{tct(
189+
'For new projects, select which coding agent to use when proposing code changes. [manageLink:Manage Coding Agent Integrations]',
190+
{
191+
manageLink: (
192+
<Link
193+
to={{
194+
pathname: normalizeUrl(
195+
`/settings/${organization.slug}/integrations/`
196+
),
197+
query: {category: 'coding agent'},
198+
}}
199+
>
200+
{t('Manage Coding Agent Integrations')}
201+
</Link>
202+
),
203+
}
204+
)}
205+
</Text>
206+
}
188207
>
189208
<Container flexGrow={1}>
190209
{preferredAgent.isPending || codingAgentSelectOptions.isPending ? (
@@ -209,6 +228,19 @@ function AgentNameForm({
209228
</field.Layout.Row>
210229

211230
<Flex align="center" alignSelf="end" gap="md" width="50%" paddingLeft="xl">
231+
{/* <Text variant="secondary" size="sm">
232+
<Link
233+
to={{
234+
pathname: normalizeUrl(
235+
`/settings/${organization.slug}/integrations/`
236+
),
237+
query: {category: 'coding agent'},
238+
}}
239+
>
240+
{t('Manage Coding Agent Integrations')}
241+
</Link>
242+
</Text> */}
243+
212244
<Button
213245
size="xs"
214246
busy={isPending || isBulkMutatingAgent}

static/gsApp/views/seerAutomation/components/projectDetails/autofixAgent.tsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {Fragment} from 'react';
22
import styled from '@emotion/styled';
33

44
import {Flex} from '@sentry/scraps/layout';
5-
import {ExternalLink} from '@sentry/scraps/link';
5+
import {ExternalLink, Link} from '@sentry/scraps/link';
66

77
import {addErrorMessage, addSuccessMessage} from 'sentry/actionCreators/indicator';
88
import type {ProjectSeerPreferences} from 'sentry/components/events/autofix/types';
@@ -19,6 +19,7 @@ import {Placeholder} from 'sentry/components/placeholder';
1919
import {t, tct} from 'sentry/locale';
2020
import type {Project} from 'sentry/types/project';
2121
import {useMutation, useQuery, useQueryClient} from 'sentry/utils/queryClient';
22+
import {normalizeUrl} from 'sentry/utils/url/normalizeUrl';
2223
import {useOrganization} from 'sentry/utils/useOrganization';
2324
import {useFetchAgentOptions} from 'sentry/views/settings/seer/overview/utils/seerPreferredAgent';
2425
import {
@@ -78,7 +79,7 @@ export function AutofixAgent({canWrite, preference, project}: Props) {
7879

7980
return (
8081
<PanelNoMargin>
81-
<PanelHeader>{t('Autofix Handoff')}</PanelHeader>
82+
<PanelHeader>{t('Autofix')}</PanelHeader>
8283
<PanelBody>
8384
{isPending ? (
8485
<Flex justify="center" align="center" padding="xl">
@@ -88,22 +89,31 @@ export function AutofixAgent({canWrite, preference, project}: Props) {
8889
<LoadingError />
8990
) : (
9091
<Fragment>
91-
{/* If the `agent` is undefined then we have a problem! Show an alert? */}
92+
{/* If the `agent` is undefined then we default to Seer Agent */}
9293
<SelectField
9394
disabled={Boolean(disabledReason)}
9495
disabledReason={disabledReason}
9596
name="autofixAgent"
96-
label={t('Autofix Handoff')}
97+
label={t('Preferred Coding Agent')}
9798
help={tct(
98-
'Seer will orchestrate the autofix process, and automatically hand off issue data to the coding agent for processing. You can choose to automatically process Issues, and which agent to use here. You can also manually trigger autofix with different agents from the Issue Details page. [docsLink:Read the docs] to learn more.',
99+
'Select the coding agent to use when proposing code changes. [manageLink:Manage Coding Agent Integrations]',
99100
{
100-
docsLink: (
101-
<ExternalLink href="https://docs.sentry.io/product/ai-in-sentry/" />
101+
manageLink: (
102+
<Link
103+
to={{
104+
pathname: normalizeUrl(
105+
`/settings/${organization.slug}/integrations/`
106+
),
107+
query: {category: 'coding agent'},
108+
}}
109+
>
110+
{t('Manage Coding Agent Integrations')}
111+
</Link>
102112
),
103113
}
104114
)}
105115
options={options.data ?? []}
106-
value={selected}
116+
value={selected ?? 'seer'}
107117
onChange={(integration: 'seer' | CodingAgentIntegration) => {
108118
mutateSelectedAgent(integration, {
109119
onSuccess: () =>

static/gsApp/views/seerAutomation/components/projectTable/seerProjectTableHeader.tsx

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ import {Alert} from '@sentry/scraps/alert';
55
import {Checkbox} from '@sentry/scraps/checkbox';
66
import {InfoTip} from '@sentry/scraps/info';
77
import {Flex} from '@sentry/scraps/layout';
8+
import {Link} from '@sentry/scraps/link';
89

910
import {addErrorMessage, addSuccessMessage} from 'sentry/actionCreators/indicator';
1011
import {DropdownMenu} from 'sentry/components/dropdownMenu';
1112
import type {useUpdateBulkAutofixAutomationSettings} from 'sentry/components/events/autofix/preferences/hooks/useBulkAutofixAutomationSettings';
1213
import {SimpleTable} from 'sentry/components/tables/simpleTable';
1314
import {t, tct, tn} from 'sentry/locale';
15+
import type {Organization} from 'sentry/types/organization';
1416
import type {Project} from 'sentry/types/project';
1517
import {parseQueryKey} from 'sentry/utils/api/apiQueryKey';
1618
import type {Sort} from 'sentry/utils/discover/fields';
1719
import {useListItemCheckboxContext} from 'sentry/utils/list/useListItemCheckboxState';
20+
import {normalizeUrl} from 'sentry/utils/url/normalizeUrl';
1821
import {useOrganization} from 'sentry/utils/useOrganization';
1922
import {
2023
useBulkMutateSelectedAgent,
@@ -34,7 +37,34 @@ interface Props {
3437

3538
const COLUMNS = [
3639
{title: t('Project'), key: 'project', sortKey: 'project'},
37-
{title: t('Agent'), key: 'fixes', sortKey: 'agent'},
40+
{
41+
title: ({organization}: {organization: Organization}) => (
42+
<Flex gap="sm" align="center">
43+
{t('Preferred Coding Agent')}
44+
<InfoTip
45+
title={tct(
46+
'Select the coding agent to use when proposing code changes. [manageLink:Manage Coding Agent Integrations]',
47+
{
48+
manageLink: (
49+
<Link
50+
to={{
51+
pathname: normalizeUrl(
52+
`/settings/${organization.slug}/integrations/`
53+
),
54+
query: {category: 'coding agent'},
55+
}}
56+
>
57+
{t('Manage Coding Agent Integrations')}
58+
</Link>
59+
),
60+
}
61+
)}
62+
/>
63+
</Flex>
64+
),
65+
key: 'fixes',
66+
sortKey: 'agent',
67+
},
3868
{
3969
title: (
4070
<Flex gap="sm" align="center">
@@ -126,7 +156,7 @@ export function ProjectTableHeader({
126156
}
127157
sort={sort?.field === sortKey ? sort.kind : undefined}
128158
>
129-
{title}
159+
{typeof title === 'function' ? title({organization}) : title}
130160
</SimpleTable.HeaderCell>
131161
))}
132162
</TableHeader>

static/gsApp/views/seerAutomation/components/projectTable/seerProjectTableRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export function SeerProjectTableRow({
9696
disabled={!canWrite}
9797
name="autofixAgent"
9898
options={agentOptions.data ?? []}
99-
value={autofixAgent}
99+
value={autofixAgent ?? 'seer'}
100100
onChange={option => {
101101
mutateSelectedAgent(option.value, {
102102
onSuccess: () => {

static/gsApp/views/seerAutomation/projects.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
import {ExternalLink} from '@sentry/scraps/link';
1+
import {ExternalLink, Link} from '@sentry/scraps/link';
22

33
import {AnalyticsArea} from 'sentry/components/analyticsArea';
44
import {SentryDocumentTitle} from 'sentry/components/sentryDocumentTitle';
55
import {t, tct} from 'sentry/locale';
6+
import {normalizeUrl} from 'sentry/utils/url/normalizeUrl';
7+
import {useOrganization} from 'sentry/utils/useOrganization';
68
import {SettingsPageHeader} from 'sentry/views/settings/components/settingsPageHeader';
79

810
import {SeerProjectTable} from 'getsentry/views/seerAutomation/components/projectTable/seerProjectTable';
911
import {SeerSettingsPageContent} from 'getsentry/views/seerAutomation/components/seerSettingsPageContent';
1012
import {SeerSettingsPageWrapper} from 'getsentry/views/seerAutomation/components/seerSettingsPageWrapper';
1113

1214
export default function SeerAutomationProjects() {
15+
const organization = useOrganization();
1316
return (
1417
<AnalyticsArea name="projects">
1518
<SeerSettingsPageWrapper>
@@ -25,6 +28,19 @@ export default function SeerAutomationProjects() {
2528
docs: (
2629
<ExternalLink href="https://docs.sentry.io/product/ai-in-sentry/seer/#seer-capabilities" />
2730
),
31+
32+
manageLink: (
33+
<Link
34+
to={{
35+
pathname: normalizeUrl(
36+
`/settings/${organization.slug}/integrations/`
37+
),
38+
query: {category: 'coding agent'},
39+
}}
40+
>
41+
{t('Manage Coding Agent Integrations')}
42+
</Link>
43+
),
2844
}
2945
)}
3046
/>

0 commit comments

Comments
 (0)