Skip to content
Closed
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 @@ -53,7 +53,7 @@ describe('AgentHandoffProductPrompt', () => {

expect(screen.getByRole('link', {name: 'View all instructions'})).toHaveAttribute(
'href',
'https://sentry.io/agent-handoff.md'
'https://sentry-jest-tests.example.com/agent-handoff.md'
);
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_****.'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
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';
Expand All @@ -11,10 +10,9 @@ 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 {getHandoffGuideUrl} from './handoffPrompt';
import {
getHandoffPreviewUrl,
HandoffAdvancedMenu,
HandoffPromptAlerts,
HandoffPromptBox,
Expand All @@ -41,8 +39,7 @@ export function AgentHandoffProductPrompt({
onCopySuccess,
onSelect,
}: AgentHandoffProductPromptProps) {
const sentryUrl = useStore(ConfigStore, state => state.links.sentryUrl);
const previewUrl = getHandoffPreviewUrl(sentryUrl);
const guideUrl = getHandoffGuideUrl();

const {copyPrompt, copyDisabled, handoff, useIpPinning, toggleIpPinning} =
useHandoffPromptCopy({
Expand Down Expand Up @@ -109,7 +106,7 @@ export function AgentHandoffProductPrompt({
)),
<ListItem key="view-all-instructions">
<Text size="sm">
<ExternalLink href={previewUrl}>
<ExternalLink href={guideUrl}>
<Flex as="span" align="center" gap="xs">
{t('View all instructions')}
<IconOpen size="xs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('AgentHandoffPrompt', () => {

expect(screen.getByRole('link', {name: 'See the full instructions'})).toHaveAttribute(
'href',
'https://sentry.io/agent-handoff.md'
'https://sentry-jest-tests.example.com/agent-handoff.md'
);
expect(screen.getByText(/Read and follow/)).toHaveTextContent(
'Read and follow https://sentry-jest-tests.example.com/agent-handoff.md verbatim. Your handoff code is sntryh_****.'
Expand Down
9 changes: 3 additions & 6 deletions static/app/components/agentHandoff/agentHandoffPrompt.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
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';
Expand All @@ -9,10 +8,9 @@ import {Text} from '@sentry/scraps/text';

import {FeedbackButton} from 'sentry/components/feedbackButton/feedbackButton';
import {t} from 'sentry/locale';
import {ConfigStore} from 'sentry/stores/configStore';

import {getHandoffGuideUrl} from './handoffPrompt';
import {
getHandoffPreviewUrl,
HandoffAdvancedMenu,
HandoffPromptAlerts,
HandoffPromptBox,
Expand All @@ -36,8 +34,7 @@ export function AgentHandoffPrompt<Flow extends AgentHandoffFlow>({
onCopySuccess,
onSelect,
}: AgentHandoffPromptProps<Flow>) {
const sentryUrl = useStore(ConfigStore, state => state.links.sentryUrl);
const previewUrl = getHandoffPreviewUrl(sentryUrl);
const guideUrl = getHandoffGuideUrl();

const {copyPrompt, copyDisabled, handoff, useIpPinning, toggleIpPinning} =
useHandoffPromptCopy({flow, context, onCopySuccess});
Expand All @@ -64,7 +61,7 @@ export function AgentHandoffPrompt<Flow extends AgentHandoffFlow>({

<Flex align="center" justify="between" gap="lg">
<Text size="sm">
<ExternalLink href={previewUrl}>
<ExternalLink href={guideUrl}>
<Flex as="span" align="center" gap="xs">
{t('See the full instructions')}
<IconOpen size="xs" />
Expand Down
4 changes: 0 additions & 4 deletions static/app/components/agentHandoff/handoffPromptParts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ import {getHandoffGuideUrl, getHandoffPrompt} from './handoffPrompt';
import {AgentHandoffFlow, type AgentHandoffContext} from './types';
import {useHandoffPromptInteractions} from './useHandoffPromptInteractions';

export function getHandoffPreviewUrl(sentryUrl: string): string {
return new URL('/agent-handoff.md', sentryUrl).href;
}

interface HandoffAdvancedMenuProps {
disabled: boolean;
onToggle: () => void;
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/onboarding/onboarding.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ describe('Onboarding', () => {
expect(screen.getByRole('button', {name: 'Advanced options'})).toBeInTheDocument();
expect(
screen.getByRole('link', {name: 'See the full instructions'})
).toHaveAttribute('href', 'https://sentry.io/agent-handoff.md');
).toHaveAttribute('href', 'https://sentry-jest-tests.example.com/agent-handoff.md');
expect(screen.getByRole('button', {name: /Set up manually/})).toBeInTheDocument();
expect(screen.queryByTestId('onboarding-welcome-start')).not.toBeInTheDocument();
expect(screen.queryByText('Error monitoring')).not.toBeInTheDocument();
Expand Down
Loading