From 04702ba09bf62c8fc9c595e18c1eeada004a2561 Mon Sep 17 00:00:00 2001 From: VasN Date: Mon, 16 Nov 2026 16:06:22 +0400 Subject: [PATCH 1/2] feat(agents): copy the agent onboarding prompt from the sign-up screen The experiment entry was a link to /agents/onboarding, which only existed to hold a copy button. The entry now copies the prompt itself, says what to do next, and shows the prompt as text when the clipboard is blocked. --- .../components/AgentOnboardingEntry.spec.tsx | 32 ++++++++- .../components/AgentOnboardingEntry.tsx | 68 +++++++++++++------ packages/shared/src/lib/featureManagement.ts | 2 +- 3 files changed, 79 insertions(+), 23 deletions(-) diff --git a/packages/shared/src/features/agentOnboarding/components/AgentOnboardingEntry.spec.tsx b/packages/shared/src/features/agentOnboarding/components/AgentOnboardingEntry.spec.tsx index a72b2ce255..b64100df4d 100644 --- a/packages/shared/src/features/agentOnboarding/components/AgentOnboardingEntry.spec.tsx +++ b/packages/shared/src/features/agentOnboarding/components/AgentOnboardingEntry.spec.tsx @@ -1,8 +1,10 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; import { AgentOnboardingEntry } from './AgentOnboardingEntry'; import { useConditionalFeature } from '../../../hooks/useConditionalFeature'; import { useViewSize } from '../../../hooks/useViewSize'; +import { agentOnboardingPrompt } from '../prompt'; jest.mock('../../../hooks/useConditionalFeature', () => ({ useConditionalFeature: jest.fn(), @@ -14,20 +16,44 @@ jest.mock('../../../hooks/useViewSize', () => ({ const mockFlag = jest.mocked(useConditionalFeature); const mockViewSize = jest.mocked(useViewSize); +const writeText = jest.fn(); beforeEach(() => { jest.clearAllMocks(); mockViewSize.mockReturnValue(true); mockFlag.mockReturnValue({ value: true, isLoading: false }); + writeText.mockResolvedValue(undefined); + Object.defineProperty(navigator, 'clipboard', { + configurable: true, + value: { writeText }, + }); }); +const copyButton = () => + screen.getByRole('button', { name: 'Set up with your coding agent' }); + describe('AgentOnboardingEntry', () => { - it('links to agent onboarding when the experiment is on', () => { + it('copies the prompt and says what to do next', async () => { render(); + await userEvent.click(copyButton()); + + expect(writeText).toHaveBeenCalledWith(agentOnboardingPrompt); expect( - screen.getByRole('link', { name: 'Let it set up daily.dev for you' }), - ).toHaveAttribute('href', '/agents/onboarding'); + await screen.findByRole('button', { name: 'Prompt copied' }), + ).toBeInTheDocument(); + expect( + screen.getByText(/Paste it into your coding agent/), + ).toBeInTheDocument(); + }); + + it('shows the prompt when the clipboard is blocked', async () => { + writeText.mockRejectedValue(new Error('denied')); + render(); + + await userEvent.click(copyButton()); + + expect(await screen.findByText(agentOnboardingPrompt)).toBeInTheDocument(); }); it('renders nothing for the control group', () => { diff --git a/packages/shared/src/features/agentOnboarding/components/AgentOnboardingEntry.tsx b/packages/shared/src/features/agentOnboarding/components/AgentOnboardingEntry.tsx index cdc637164a..10db253b07 100644 --- a/packages/shared/src/features/agentOnboarding/components/AgentOnboardingEntry.tsx +++ b/packages/shared/src/features/agentOnboarding/components/AgentOnboardingEntry.tsx @@ -1,25 +1,29 @@ import type { ReactElement } from 'react'; -import React from 'react'; +import React, { useState } from 'react'; import classNames from 'classnames'; -import Link from '../../../components/utilities/Link'; +import { Button } from '../../../components/buttons/Button'; +import { ButtonSize, ButtonVariant } from '../../../components/buttons/common'; +import { TerminalIcon } from '../../../components/icons/Terminal'; +import { VIcon } from '../../../components/icons/V'; import { useLogContext } from '../../../contexts/LogContext'; import { useConditionalFeature } from '../../../hooks/useConditionalFeature'; import { useViewSize, ViewSize } from '../../../hooks/useViewSize'; -import { webappUrl } from '../../../lib/constants'; import { featureAgentOnboardingEntry } from '../../../lib/featureManagement'; import { LogEvent } from '../../../lib/log'; - -const agentOnboardingUrl = `${webappUrl}agents/onboarding`; +import { agentOnboardingPrompt } from '../prompt'; type AgentOnboardingEntryProps = { className?: string; }; +type CopyState = 'idle' | 'copied' | 'blocked'; + // Agents run on a computer, so smaller screens are left out of the experiment. export const AgentOnboardingEntry = ({ className, }: AgentOnboardingEntryProps): ReactElement | null => { const { logEvent } = useLogContext(); + const [copyState, setCopyState] = useState('idle'); const isLaptop = useViewSize(ViewSize.Laptop); const { value: isEnabled } = useConditionalFeature({ feature: featureAgentOnboardingEntry, @@ -30,20 +34,46 @@ export const AgentOnboardingEntry = ({ return null; } + const onCopy = async () => { + logEvent({ event_name: LogEvent.ClickAgentOnboardingEntry }); + + try { + await navigator.clipboard.writeText(agentOnboardingPrompt); + setCopyState('copied'); + } catch { + setCopyState('blocked'); + } + }; + + const isCopied = copyState === 'copied'; + return ( - - Use a coding agent?{' '} - - - logEvent({ event_name: LogEvent.ClickAgentOnboardingEntry }) - } - > - Let it set up daily.dev for you - - - +
+ +

+ {copyState === 'idle' && + 'Copies a prompt for Claude Code, Codex, or Cursor.'} + {isCopied && + 'Paste it into your coding agent. It sets up daily.dev for you.'} + {copyState === 'blocked' && ( + <> + Your browser blocked the clipboard. Copy this prompt into your + coding agent:{' '} + + {agentOnboardingPrompt} + + + )} +

+
); }; diff --git a/packages/shared/src/lib/featureManagement.ts b/packages/shared/src/lib/featureManagement.ts index 3c3eba338d..83575923b2 100644 --- a/packages/shared/src/lib/featureManagement.ts +++ b/packages/shared/src/lib/featureManagement.ts @@ -434,7 +434,7 @@ export const featureWeeklyPicksChecks = new Feature( false, ); -// Experiment: a link from the sign-up screen into agent onboarding. +// Experiment: a sign-up screen button that copies the agent onboarding prompt. export const featureAgentOnboardingEntry = new Feature( 'agent_onboarding_entry', false, From 8fce1cbec8b94d01c93de938bcbdcfe9b084dbd1 Mon Sep 17 00:00:00 2001 From: VasN Date: Mon, 16 Nov 2026 16:14:30 +0400 Subject: [PATCH 2/2] temp: default agent_onboarding_entry to true for preview testing Revert before merging. --- packages/shared/src/lib/featureManagement.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/shared/src/lib/featureManagement.ts b/packages/shared/src/lib/featureManagement.ts index 83575923b2..9dbd24ed34 100644 --- a/packages/shared/src/lib/featureManagement.ts +++ b/packages/shared/src/lib/featureManagement.ts @@ -435,7 +435,8 @@ export const featureWeeklyPicksChecks = new Feature( ); // Experiment: a sign-up screen button that copies the agent onboarding prompt. +// TEMP: on for preview testing only. Revert to false before merging. export const featureAgentOnboardingEntry = new Feature( 'agent_onboarding_entry', - false, + true, );