Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,25 @@ function AgentNameForm({
<Stack gap="md">
<field.Layout.Row
label={t('Default Preferred Coding Agent')}
hintText={t(
'For new projects, select which coding agent to use when proposing code changes.'
)}
hintText={
<Text>
{tct(
'For new projects, select which coding agent to use when proposing code changes. [manageLink:Manage Coding Agent Integrations]',
{
manageLink: (
<Link
to={{
pathname: `/settings/${organization.slug}/integrations/`,
query: {category: 'coding agent'},
}}
>
{t('Manage Coding Agent Integrations')}
</Link>
),
}
)}
</Text>
}
>
<Container flexGrow={1}>
{preferredAgent.isPending || codingAgentSelectOptions.isPending ? (
Expand Down
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wanna migrate this form to the scraps form 🥺 ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can happen as a followup

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Fragment} from 'react';
import styled from '@emotion/styled';

import {Flex} from '@sentry/scraps/layout';
import {ExternalLink} from '@sentry/scraps/link';
import {ExternalLink, Link} from '@sentry/scraps/link';

import {addErrorMessage, addSuccessMessage} from 'sentry/actionCreators/indicator';
import type {ProjectSeerPreferences} from 'sentry/components/events/autofix/types';
Expand Down Expand Up @@ -78,7 +78,7 @@ export function AutofixAgent({canWrite, preference, project}: Props) {

return (
<PanelNoMargin>
<PanelHeader>{t('Autofix Handoff')}</PanelHeader>
<PanelHeader>{t('Autofix')}</PanelHeader>
<PanelBody>
{isPending ? (
<Flex justify="center" align="center" padding="xl">
Expand All @@ -88,22 +88,29 @@ export function AutofixAgent({canWrite, preference, project}: Props) {
<LoadingError />
) : (
<Fragment>
{/* If the `agent` is undefined then we have a problem! Show an alert? */}
{/* If the `agent` is undefined then we default to Seer Agent */}
<SelectField
disabled={Boolean(disabledReason)}
disabledReason={disabledReason}
name="autofixAgent"
label={t('Autofix Handoff')}
label={t('Preferred Coding Agent')}
help={tct(
'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.',
'Select the coding agent to use when proposing code changes. [manageLink:Manage Coding Agent Integrations]',
{
docsLink: (
<ExternalLink href="https://docs.sentry.io/product/ai-in-sentry/" />
manageLink: (
<Link
to={{
pathname: `/settings/${organization.slug}/integrations/`,
query: {category: 'coding agent'},
}}
>
{t('Manage Coding Agent Integrations')}
</Link>
),
}
)}
options={options.data ?? []}
value={selected}
value={selected ?? 'seer'}
onChange={(integration: 'seer' | CodingAgentIntegration) => {
mutateSelectedAgent(integration, {
onSuccess: () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ import {Alert} from '@sentry/scraps/alert';
import {Checkbox} from '@sentry/scraps/checkbox';
import {InfoTip} from '@sentry/scraps/info';
import {Flex} from '@sentry/scraps/layout';
import {Link} from '@sentry/scraps/link';

import {addErrorMessage, addSuccessMessage} from 'sentry/actionCreators/indicator';
import {DropdownMenu} from 'sentry/components/dropdownMenu';
import type {useUpdateBulkAutofixAutomationSettings} from 'sentry/components/events/autofix/preferences/hooks/useBulkAutofixAutomationSettings';
import {SimpleTable} from 'sentry/components/tables/simpleTable';
import {t, tct, tn} from 'sentry/locale';
import type {Organization} from 'sentry/types/organization';
import type {Project} from 'sentry/types/project';
import {parseQueryKey} from 'sentry/utils/api/apiQueryKey';
import type {Sort} from 'sentry/utils/discover/fields';
import {useListItemCheckboxContext} from 'sentry/utils/list/useListItemCheckboxState';
import {normalizeUrl} from 'sentry/utils/url/normalizeUrl';
import {useOrganization} from 'sentry/utils/useOrganization';
import {
useBulkMutateSelectedAgent,
Expand All @@ -34,7 +37,34 @@ interface Props {

const COLUMNS = [
{title: t('Project'), key: 'project', sortKey: 'project'},
{title: t('Agent'), key: 'fixes', sortKey: 'agent'},
{
title: ({organization}: {organization: Organization}) => (
<Flex gap="sm" align="center">
{t('Preferred Coding Agent')}
<InfoTip
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥔 for using InfoTip here ❤️

title={tct(
'Select the coding agent to use when proposing code changes. [manageLink:Manage Coding Agent Integrations]',
{
manageLink: (
<Link
to={{
pathname: normalizeUrl(
`/settings/${organization.slug}/integrations/`
),
query: {category: 'coding agent'},
}}
>
{t('Manage Coding Agent Integrations')}
</Link>
),
}
)}
/>
</Flex>
),
key: 'fixes',
sortKey: 'agent',
},
{
title: (
<Flex gap="sm" align="center">
Expand Down Expand Up @@ -126,7 +156,7 @@ export function ProjectTableHeader({
}
sort={sort?.field === sortKey ? sort.kind : undefined}
>
{title}
{typeof title === 'function' ? title({organization}) : title}
</SimpleTable.HeaderCell>
))}
</TableHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function SeerProjectTableRow({
disabled={!canWrite}
name="autofixAgent"
options={agentOptions.data ?? []}
value={autofixAgent}
value={autofixAgent ?? 'seer'}
onChange={option => {
mutateSelectedAgent(option.value, {
onSuccess: () => {
Expand Down
Loading