diff --git a/static/app/components/agentHandoff/agentHandoffProductPrompt.spec.tsx b/static/app/components/agentHandoff/agentHandoffProductPrompt.spec.tsx index 6780edfee4f2..bbdd9c3f3ebd 100644 --- a/static/app/components/agentHandoff/agentHandoffProductPrompt.spec.tsx +++ b/static/app/components/agentHandoff/agentHandoffProductPrompt.spec.tsx @@ -51,10 +51,9 @@ describe('AgentHandoffProductPrompt', () => { {organization} ); - expect(screen.getByRole('link', {name: 'View all instructions'})).toHaveAttribute( - 'href', - 'https://sentry.io/agent-handoff.md' - ); + expect( + screen.queryByRole('link', {name: 'View all instructions'}) + ).not.toBeInTheDocument(); expect(screen.getByText(/Read and follow/)).toHaveTextContent( 'Read and follow https://sentry-jest-tests.example.com/agent-handoff.md verbatim to set up tracing. Your handoff code is sntryh_****.' ); @@ -89,8 +88,10 @@ describe('AgentHandoffProductPrompt', () => { {organization} ); - await userEvent.click(screen.getByRole('button', {name: 'Advanced options'})); - await userEvent.click(screen.getByRole('menuitemradio', {name: /Use IP pinning/})); + const ipPinning = screen.getByRole('checkbox', {name: 'Only allow this network'}); + expect(ipPinning).toBeChecked(); + await userEvent.click(ipPinning); + expect(ipPinning).not.toBeChecked(); expect( screen.getByText(/anyone with this prompt can use its handoff code/) diff --git a/static/app/components/agentHandoff/agentHandoffProductPrompt.tsx b/static/app/components/agentHandoff/agentHandoffProductPrompt.tsx index 05dfdf731f0e..31f0fb3621ca 100644 --- a/static/app/components/agentHandoff/agentHandoffProductPrompt.tsx +++ b/static/app/components/agentHandoff/agentHandoffProductPrompt.tsx @@ -1,21 +1,15 @@ +import styled from '@emotion/styled'; import {IconCopy} from '@sentry/icons/copy'; -import {IconOpen} from '@sentry/icons/open'; -import {useStore} from 'zustand'; import {Button} from '@sentry/scraps/button'; -import {Flex, Stack} from '@sentry/scraps/layout'; -import {ExternalLink} from '@sentry/scraps/link'; -import {Text} from '@sentry/scraps/text'; +import {Flex, Grid, Stack} from '@sentry/scraps/layout'; +import {Heading, Text} from '@sentry/scraps/text'; import {FeedbackButton} from 'sentry/components/feedbackButton/feedbackButton'; -import {List} from 'sentry/components/list'; -import {ListItem} from 'sentry/components/list/listItem'; import {t} from 'sentry/locale'; -import {ConfigStore} from 'sentry/stores/configStore'; import { - getHandoffPreviewUrl, - HandoffAdvancedMenu, + HandoffIpPinningCheckbox, HandoffPromptAlerts, HandoffPromptBox, } from './handoffPromptParts'; @@ -24,8 +18,8 @@ import {useHandoffPromptCopy} from './useHandoffPromptCopy'; interface AgentHandoffProductPromptProps { /** - * Short phrases describing what the agent will do, shown as checkmark bullets above - * "View all instructions". Keep to 3–5 items. + * Short phrases describing what the agent will do, shown as bullets under the prompt. + * Keep to 3–5 items. */ agentSteps: string[]; context: AddFeatureContext | null; @@ -41,79 +35,79 @@ export function AgentHandoffProductPrompt({ onCopySuccess, onSelect, }: AgentHandoffProductPromptProps) { - const sentryUrl = useStore(ConfigStore, state => state.links.sentryUrl); - const previewUrl = getHandoffPreviewUrl(sentryUrl); - const {copyPrompt, copyDisabled, handoff, useIpPinning, toggleIpPinning} = useHandoffPromptCopy({flow: AgentHandoffFlow.ADD_FEATURE, context, onCopySuccess}); return ( - - - - {t('Paste this prompt into your coding agent')} - - - - - - - - + {/* The steps sit beside the prompt once the card is wide enough for both. */} + + + - - + + - - - + + + + + + {t('Your agent will')} + + + {agentSteps.map(step => ( + + + + {step} + + + ))} + + + - - - {t('Your agent will:')} - - - {[ - ...agentSteps.map(step => ( - - {step} - - )), - - - - - {t('View all instructions')} - - - - - , - ]} - - + + + {t('Give feedback')} + + ); } + +const StepBullet = styled('span')` + flex-shrink: 0; + width: 4px; + height: 4px; + border-radius: ${p => p.theme.radius.full}; + background: ${p => p.theme.tokens.graphics.neutral.moderate}; +`; diff --git a/static/app/components/agentHandoff/handoffPromptParts.tsx b/static/app/components/agentHandoff/handoffPromptParts.tsx index bc69380b9736..86f399774510 100644 --- a/static/app/components/agentHandoff/handoffPromptParts.tsx +++ b/static/app/components/agentHandoff/handoffPromptParts.tsx @@ -1,12 +1,13 @@ -import {Fragment, useState, type PointerEventHandler, type ReactNode} from 'react'; +import {Fragment, useId, useState, type PointerEventHandler, type ReactNode} from 'react'; import {css, ThemeProvider, type Theme} from '@emotion/react'; import styled from '@emotion/styled'; import {IconSettings} from '@sentry/icons/settings'; import {Alert} from '@sentry/scraps/alert'; +import {Checkbox} from '@sentry/scraps/checkbox'; import {DropdownMenu} from '@sentry/scraps/dropdownMenu'; -import {InfoText} from '@sentry/scraps/info'; -import {Container} from '@sentry/scraps/layout'; +import {InfoText, InfoTip} from '@sentry/scraps/info'; +import {Container, Flex, Stack} from '@sentry/scraps/layout'; import {ExternalLink} from '@sentry/scraps/link'; import {OverlayTrigger} from '@sentry/scraps/overlayTrigger'; import {Text} from '@sentry/scraps/text'; @@ -69,6 +70,52 @@ export function HandoffAdvancedMenu({ ); } +interface HandoffIpPinningCheckboxProps { + disabled: boolean; + onToggle: () => void; + useIpPinning: boolean; +} + +export function HandoffIpPinningCheckbox({ + disabled, + useIpPinning, + onToggle, +}: HandoffIpPinningCheckboxProps) { + const checkboxId = useId(); + const descriptionId = useId(); + + return ( + + + + + + {t('Only allow this network')} + + + + + {t('Uncheck if your agent runs in the cloud, or you use iCloud Private Relay.')} + + + + ); +} + +// Help text reads best a little looser than the largest density token (1.4). +const IpPinningDescription = styled(Text)` + line-height: 1.5; +`; + interface HandoffPromptAlertsProps { error: Error | null; useIpPinning: boolean; diff --git a/static/app/components/onboarding/benefit.tsx b/static/app/components/onboarding/benefit.tsx index af299df5e8dc..03191fe271ad 100644 --- a/static/app/components/onboarding/benefit.tsx +++ b/static/app/components/onboarding/benefit.tsx @@ -2,18 +2,21 @@ import type {ReactNode} from 'react'; import {IconCheckmark} from '@sentry/icons/checkmark'; import {Flex} from '@sentry/scraps/layout'; -import {Text} from '@sentry/scraps/text'; +import {Text, type TextProps} from '@sentry/scraps/text'; interface BenefitProps { children: ReactNode; + density?: TextProps<'span'>['density']; size?: 'sm' | 'md' | 'lg'; } -export function Benefit({children, size = 'md'}: BenefitProps) { +export function Benefit({children, density, size = 'md'}: BenefitProps) { return ( - {children} + + {children} + ); } diff --git a/static/app/components/productEmptyState/productEmptyState.spec.tsx b/static/app/components/productEmptyState/productEmptyState.spec.tsx index 094ab77dd550..b968a3ca87dc 100644 --- a/static/app/components/productEmptyState/productEmptyState.spec.tsx +++ b/static/app/components/productEmptyState/productEmptyState.spec.tsx @@ -100,7 +100,7 @@ describe('ProductEmptyState', () => { render(, {organization}); - await userEvent.click(screen.getByRole('radio', {name: 'Set up manually'})); + await userEvent.click(screen.getByRole('radio', {name: 'Manually'})); expect(trackAnalytics).toHaveBeenCalledWith( 'product_empty_state.agent_setup_mode_selected', @@ -113,10 +113,10 @@ describe('ProductEmptyState', () => { ); }); - it('"Set up manually" shows the manual content', async () => { + it('"Manually" shows the manual content', async () => { render(, {organization}); - await userEvent.click(screen.getByRole('radio', {name: 'Set up manually'})); + await userEvent.click(screen.getByRole('radio', {name: 'Manually'})); expect(screen.getByTestId('manual-content')).toBeInTheDocument(); expect(screen.queryByRole('button', {name: 'Copy prompt'})).not.toBeInTheDocument(); diff --git a/static/app/components/productEmptyState/productEmptyState.stories.mdx b/static/app/components/productEmptyState/productEmptyState.stories.mdx index 42d2f44fe158..2896776f546b 100644 --- a/static/app/components/productEmptyState/productEmptyState.stories.mdx +++ b/static/app/components/productEmptyState/productEmptyState.stories.mdx @@ -20,7 +20,7 @@ export const project = { ## Default (agent tab) -Shows the intro benefits section and the setup card with the "Use my coding agent" tab selected. +Shows the intro benefits section and the setup card with the "Using my coding agent" tab selected. @@ -59,7 +59,7 @@ Shows the intro benefits section and the setup card with the "Use my coding agen ## With manual setup content -Clicking "Set up manually" reveals the `manualSetup` slot instead of the agent prompt. +Clicking "Manually" reveals the `manualSetup` slot instead of the agent prompt. diff --git a/static/app/components/productEmptyState/productEmptyState.tsx b/static/app/components/productEmptyState/productEmptyState.tsx index 8d4771465221..a784f2bc00b1 100644 --- a/static/app/components/productEmptyState/productEmptyState.tsx +++ b/static/app/components/productEmptyState/productEmptyState.tsx @@ -87,14 +87,16 @@ export function ProductEmptyState({ return ( - + {title} {benefits.map(benefit => ( - {benefit} + + {benefit} + ))} @@ -109,14 +111,19 @@ export function ProductEmptyState({ align="center" justify="between" gap="md" - padding="lg 2xl" + padding="lg xl" background="secondary" borderBottom="primary" wrap="wrap" > - {tct('Set up [productName] for', {productName})} - + + {tct('Set up [productName] for', {productName})} + + {/* The badge inherits its name's size and weight. */} + + + value={mode} @@ -124,14 +131,12 @@ export function ProductEmptyState({ aria-label={t('Setup mode')} > - {t('Use my coding agent')} - - - {t('Set up manually')} + {t('Using my coding agent')} + {t('Manually')} - + {mode === 'agent' ? ( { ).toBeInTheDocument(); }); - it('shows the "Set up manually" tab with doc steps', async () => { + it('shows the "Manually" tab with doc steps', async () => { const project = ProjectFixture({platform: 'javascript-react'}); MockApiClient.addMockResponse({ @@ -53,7 +53,7 @@ describe('TracingEmptyState', () => { await screen.findByText('Tracing in Sentry'); - await userEvent.click(screen.getByRole('radio', {name: 'Set up manually'})); + await userEvent.click(screen.getByRole('radio', {name: 'Manually'})); expect(await screen.findByText('Install Sentry')).toBeInTheDocument(); }); @@ -71,9 +71,7 @@ describe('TracingEmptyState', () => { const docsLink = await screen.findByRole('button', {name: 'Go to Documentation'}); expect(docsLink).toHaveAttribute('href', 'https://docs.sentry.io/platforms/'); - expect( - screen.queryByRole('radio', {name: 'Set up manually'}) - ).not.toBeInTheDocument(); + expect(screen.queryByRole('radio', {name: 'Manually'})).not.toBeInTheDocument(); }); it('shows the waiting indicator while no trace has arrived', async () => { diff --git a/static/app/views/performance/tracingEmptyState.tsx b/static/app/views/performance/tracingEmptyState.tsx index 1aaeeddb4a32..61ada370f82d 100644 --- a/static/app/views/performance/tracingEmptyState.tsx +++ b/static/app/views/performance/tracingEmptyState.tsx @@ -42,16 +42,14 @@ import {traceAnalytics} from './traceDetails/traceAnalytics'; const TRACING_BENEFITS = [ t('See related errors, logs, replays, and metrics alongside each trace'), - t( - 'Find slow services and operations in the trace view and spot where a problem originated' - ), + t('Find slow services and operations, and where problems start'), t('Inspect model calls and tool calls in AI agents'), ]; const TRACING_AGENT_STEPS = [ - t('Install or update the Sentry SDK with tracing support'), - t('Configure the tracing sample rate and SDK options'), - t('Send a test request and verify traces appear in Sentry'), + t('Install or update the Sentry SDK with tracing'), + t('Set the sample rate and SDK options'), + t('Send a test request and check traces in Sentry'), ]; const PLATFORM_DOCS_URL = 'https://docs.sentry.io/platforms/';