Skip to content

Commit b1a66aa

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

File tree

5 files changed

+81
-15
lines changed

5 files changed

+81
-15
lines changed

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,25 @@ function AgentNameForm({
182182
<Stack gap="md">
183183
<field.Layout.Row
184184
label={t('Default Preferred Coding Agent')}
185-
hintText={t(
186-
'For new projects, select which coding agent to use when proposing code changes.'
187-
)}
185+
hintText={
186+
<Text>
187+
{tct(
188+
'For new projects, select which coding agent to use when proposing code changes. [manageLink:Manage Coding Agent Integrations]',
189+
{
190+
manageLink: (
191+
<Link
192+
to={{
193+
pathname: `/settings/${organization.slug}/integrations/`,
194+
query: {category: 'coding agent'},
195+
}}
196+
>
197+
{t('Manage Coding Agent Integrations')}
198+
</Link>
199+
),
200+
}
201+
)}
202+
</Text>
203+
}
188204
>
189205
<Container flexGrow={1}>
190206
{preferredAgent.isPending || codingAgentSelectOptions.isPending ? (

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

Lines changed: 15 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';
@@ -78,7 +78,7 @@ export function AutofixAgent({canWrite, preference, project}: Props) {
7878

7979
return (
8080
<PanelNoMargin>
81-
<PanelHeader>{t('Autofix Handoff')}</PanelHeader>
81+
<PanelHeader>{t('Autofix')}</PanelHeader>
8282
<PanelBody>
8383
{isPending ? (
8484
<Flex justify="center" align="center" padding="xl">
@@ -88,22 +88,29 @@ export function AutofixAgent({canWrite, preference, project}: Props) {
8888
<LoadingError />
8989
) : (
9090
<Fragment>
91-
{/* If the `agent` is undefined then we have a problem! Show an alert? */}
91+
{/* If the `agent` is undefined then we default to Seer Agent */}
9292
<SelectField
9393
disabled={Boolean(disabledReason)}
9494
disabledReason={disabledReason}
9595
name="autofixAgent"
96-
label={t('Autofix Handoff')}
96+
label={t('Preferred Coding Agent')}
9797
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.',
98+
'Select the coding agent to use when proposing code changes. [manageLink:Manage Coding Agent Integrations]',
9999
{
100-
docsLink: (
101-
<ExternalLink href="https://docs.sentry.io/product/ai-in-sentry/" />
100+
manageLink: (
101+
<Link
102+
to={{
103+
pathname: `/settings/${organization.slug}/integrations/`,
104+
query: {category: 'coding agent'},
105+
}}
106+
>
107+
{t('Manage Coding Agent Integrations')}
108+
</Link>
102109
),
103110
}
104111
)}
105112
options={options.data ?? []}
106-
value={selected}
113+
value={selected ?? 'seer'}
107114
onChange={(integration: 'seer' | CodingAgentIntegration) => {
108115
mutateSelectedAgent(integration, {
109116
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: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
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 {useOrganization} from 'sentry/utils/useOrganization';
67
import {SettingsPageHeader} from 'sentry/views/settings/components/settingsPageHeader';
78

89
import {SeerProjectTable} from 'getsentry/views/seerAutomation/components/projectTable/seerProjectTable';
910
import {SeerSettingsPageContent} from 'getsentry/views/seerAutomation/components/seerSettingsPageContent';
1011
import {SeerSettingsPageWrapper} from 'getsentry/views/seerAutomation/components/seerSettingsPageWrapper';
1112

1213
export default function SeerAutomationProjects() {
14+
const organization = useOrganization();
1315
return (
1416
<AnalyticsArea name="projects">
1517
<SeerSettingsPageWrapper>
@@ -25,6 +27,17 @@ export default function SeerAutomationProjects() {
2527
docs: (
2628
<ExternalLink href="https://docs.sentry.io/product/ai-in-sentry/seer/#seer-capabilities" />
2729
),
30+
31+
manageLink: (
32+
<Link
33+
to={{
34+
pathname: `/settings/${organization.slug}/integrations/`,
35+
query: {category: 'coding agent'},
36+
}}
37+
>
38+
{t('Manage Coding Agent Integrations')}
39+
</Link>
40+
),
2841
}
2942
)}
3043
/>

0 commit comments

Comments
 (0)