diff --git a/vscode/src/chat/protocol.ts b/vscode/src/chat/protocol.ts index 23877b850d19..88c54d82f157 100644 --- a/vscode/src/chat/protocol.ts +++ b/vscode/src/chat/protocol.ts @@ -285,7 +285,7 @@ export const CODY_OLLAMA_DOCS_URL = new URL( 'https://sourcegraph.com/docs/cody/clients/install-vscode#supported-local-ollama-models-with-cody' ) // Account -export const ENTERPRISE_PRICING_URL = new URL('https://sourcegraph.com/pricing') +export const ENTERPRISE_STARTER_PRICING_URL = new URL('https://sourcegraph.com/pricing') export const CODY_PRO_SUBSCRIPTION_URL = new URL('https://accounts.sourcegraph.com/cody/subscription') export const ACCOUNT_UPGRADE_URL = new URL('https://sourcegraph.com/cody/subscription') export const ACCOUNT_USAGE_URL = new URL('https://sourcegraph.com/cody/manage') @@ -296,7 +296,7 @@ export const ACCOUNT_LIMITS_INFO_URL = new URL( export const CODY_BLOG_URL_o1_WAITLIST = new URL('https://sourcegraph.com/blog/openai-o1-for-cody') // TODO: Update to live link https://linear.app/sourcegraph/issue/CORE-535/cody-clients-migrate-ctas-to-live-links -export const DOTCOM_WORKSPACE_LEARN_MORE_URL = new URL('https://sourcegraph.com/docs') +export const ENTERPRISE_STARTER_LEARN_MORE_URL = new URL('https://sourcegraph.com/enterprise-starter') /** The local environment of the editor. */ export interface LocalEnv { diff --git a/vscode/webviews/Chat.tsx b/vscode/webviews/Chat.tsx index a98f51c31caf..e738a4440023 100644 --- a/vscode/webviews/Chat.tsx +++ b/vscode/webviews/Chat.tsx @@ -37,7 +37,7 @@ interface ChatboxProps { setView: (view: View) => void smartApplyEnabled?: boolean isPromptsV2Enabled?: boolean - isTeamsUpgradeCtaEnabled?: boolean + isWorkspacesUpgradeCtaEnabled?: boolean } export const Chat: React.FunctionComponent> = ({ @@ -53,7 +53,7 @@ export const Chat: React.FunctionComponent setView, smartApplyEnabled, isPromptsV2Enabled, - isTeamsUpgradeCtaEnabled, + isWorkspacesUpgradeCtaEnabled, }) => { const telemetryRecorder = useTelemetryRecorder() @@ -261,7 +261,7 @@ export const Chat: React.FunctionComponent isPromptsV2Enabled={isPromptsV2Enabled} /> - {isTeamsUpgradeCtaEnabled && ( + {isWorkspacesUpgradeCtaEnabled && (
diff --git a/vscode/webviews/CodyPanel.tsx b/vscode/webviews/CodyPanel.tsx index b63fedcb43f6..1f248d5b5890 100644 --- a/vscode/webviews/CodyPanel.tsx +++ b/vscode/webviews/CodyPanel.tsx @@ -57,7 +57,7 @@ interface CodyPanelProps { export const CodyPanel: FunctionComponent = ({ view, setView, - configuration: { config, clientCapabilities }, + configuration: { config, clientCapabilities, isDotComUser }, errorMessages, setErrorMessages, attributionEnabled, @@ -80,7 +80,11 @@ export const CodyPanel: FunctionComponent = ({ const api = useExtensionAPI() const { value: chatModels } = useObservable(useMemo(() => api.chatModels(), [api.chatModels])) const isPromptsV2Enabled = useFeatureFlag(FeatureFlag.CodyPromptsV2) - const isTeamsUpgradeCtaEnabled = useFeatureFlag(FeatureFlag.SourcegraphTeamsUpgradeCTA) + // workspace upgrade eligibility should be that the flag is set, is on dotcom and only has one account. This prevents enterprise customers that are logged into multiple endpoints from seeing the CTA + const isWorkspacesUpgradeCtaEnabled = + useFeatureFlag(FeatureFlag.SourcegraphTeamsUpgradeCTA) && + isDotComUser && + config.endpointHistory?.length === 1 useEffect(() => { onExternalApiReady?.(externalAPI) @@ -122,7 +126,7 @@ export const CodyPanel: FunctionComponent = ({ currentView={view} setView={setView} endpointHistory={config.endpointHistory ?? []} - isTeamsUpgradeCtaEnabled={isTeamsUpgradeCtaEnabled} + isWorkspacesUpgradeCtaEnabled={isWorkspacesUpgradeCtaEnabled} /> )} {errorMessages && } @@ -141,7 +145,7 @@ export const CodyPanel: FunctionComponent = ({ smartApplyEnabled={smartApplyEnabled} isPromptsV2Enabled={isPromptsV2Enabled} setView={setView} - isTeamsUpgradeCtaEnabled={isTeamsUpgradeCtaEnabled} + isWorkspacesUpgradeCtaEnabled={isWorkspacesUpgradeCtaEnabled} /> )} {view === View.History && ( diff --git a/vscode/webviews/chat/components/WelcomeMessage.tsx b/vscode/webviews/chat/components/WelcomeMessage.tsx index f8e3dac0f301..c0df50833afe 100644 --- a/vscode/webviews/chat/components/WelcomeMessage.tsx +++ b/vscode/webviews/chat/components/WelcomeMessage.tsx @@ -17,7 +17,7 @@ interface WelcomeMessageProps { setView: (view: View) => void IDE: CodyIDE isPromptsV2Enabled?: boolean - isTeamsUpgradeCtaEnabled?: boolean + isWorkspacesUpgradeCtaEnabled?: boolean } export const WelcomeMessage: FunctionComponent = ({ diff --git a/vscode/webviews/chat/components/WelcomeNotice.tsx b/vscode/webviews/chat/components/WelcomeNotice.tsx index 886a8982fd89..1b83bf08b2da 100644 --- a/vscode/webviews/chat/components/WelcomeNotice.tsx +++ b/vscode/webviews/chat/components/WelcomeNotice.tsx @@ -1,7 +1,6 @@ -import { SG_WORKSPACES_URL } from '@sourcegraph/cody-shared/src/sourcegraph-api/environments' import { XIcon } from 'lucide-react' -import { type FunctionComponent, useCallback } from 'react' -import { DOTCOM_WORKSPACE_LEARN_MORE_URL } from '../../../src/chat/protocol' +import type { FunctionComponent } from 'react' +import { ENTERPRISE_STARTER_LEARN_MORE_URL } from '../../../src/chat/protocol' import { useLocalStorage } from '../../components/hooks' import { Badge } from '../../components/shadcn/ui/badge' import { Button } from '../../components/shadcn/ui/button' @@ -9,17 +8,17 @@ import graphDarkCTA from '../../graph_dark.svg' import graphLightCTA from '../../graph_light.svg' import { SourcegraphLogo } from '../../icons/SourcegraphLogo' import { useTelemetryRecorder } from '../../utils/telemetry' - export const WelcomeNotice: FunctionComponent = () => { - const [dismissed, setDismissed] = useLocalStorage('sg_welcome_notice_00', 0) - if (dismissed) { + // to test locally, bump the suffix + const [dismissed, setDismissed] = useLocalStorage('sg_welcome_notice_001') + if (dismissed === 1) { return null } const telemetryRecorder = useTelemetryRecorder() - const dismissNotice = useCallback(() => { + const dismissNotice = () => { setDismissed(1) telemetryRecorder.recordEvent('cody.notice.cta', 'clicked') - }, [telemetryRecorder, setDismissed]) + } return (
@@ -27,30 +26,22 @@ export const WelcomeNotice: FunctionComponent = () => { Enterprise Starter
-

Unlock the Sourcegraph platform

+

+ Enable collaboration with your team +

- Get search, AI chat, autocompletes and inline edits for your entire team to find, - understand and fix code across all of your codebases. + Get your own workspace with AI-powered chat, prompt sharing and codebase serach. Automate + tasks and accelerate development.

@@ -59,7 +50,7 @@ export const WelcomeNotice: FunctionComponent = () => { diff --git a/vscode/webviews/components/UserMenu.tsx b/vscode/webviews/components/UserMenu.tsx index df2ed901753b..85225cbdb873 100644 --- a/vscode/webviews/components/UserMenu.tsx +++ b/vscode/webviews/components/UserMenu.tsx @@ -18,7 +18,8 @@ import { URI } from 'vscode-uri' import { ACCOUNT_USAGE_URL, CODY_PRO_SUBSCRIPTION_URL, - ENTERPRISE_PRICING_URL, + ENTERPRISE_STARTER_LEARN_MORE_URL, + ENTERPRISE_STARTER_PRICING_URL, isSourcegraphToken, } from '../../src/chat/protocol' import { SourcegraphLogo } from '../icons/SourcegraphLogo' @@ -42,7 +43,7 @@ interface UserMenuProps { allowEndpointChange: boolean __storybook__open?: boolean // Whether to show the Sourcegraph Teams upgrade CTA or not. - isTeamsUpgradeCtaEnabled?: boolean + isWorkspacesUpgradeCtaEnabled?: boolean } type MenuView = 'main' | 'switch' | 'add' | 'remove' @@ -55,7 +56,7 @@ export const UserMenu: React.FunctionComponent = ({ onCloseByEscape, allowEndpointChange, __storybook__open, - isTeamsUpgradeCtaEnabled, + isWorkspacesUpgradeCtaEnabled, }) => { const telemetryRecorder = useTelemetryRecorder() const { displayName, username, primaryEmail, endpoint } = authStatus @@ -317,10 +318,10 @@ export const UserMenu: React.FunctionComponent = ({ - {isTeamsUpgradeCtaEnabled && ( + {isWorkspacesUpgradeCtaEnabled && ( = ({
- Unlock the Sourcegraph platform + Enable collaboration with your team
- Create a workspace and connect GitHub repositories to - unlock Code Search, AI chat, autocompletes, inline edits - and more for your team. + Get your own workspace with AI-powered chat, prompt + sharing and codebase serach. Automate tasks and + accelerate development.
@@ -475,9 +476,9 @@ export const UserMenu: React.FunctionComponent = ({ Extension Settings - {isDotComUser && ( + {isWorkspacesUpgradeCtaEnabled && ( { diff --git a/vscode/webviews/tabs/TabsBar.tsx b/vscode/webviews/tabs/TabsBar.tsx index 7ae32244cbae..ddf93a8c6f40 100644 --- a/vscode/webviews/tabs/TabsBar.tsx +++ b/vscode/webviews/tabs/TabsBar.tsx @@ -35,7 +35,7 @@ interface TabsBarProps { setView: (view: View) => void endpointHistory: string[] // Whether to show the Sourcegraph Teams upgrade CTA or not. - isTeamsUpgradeCtaEnabled?: boolean + isWorkspacesUpgradeCtaEnabled?: boolean } type IconComponent = React.ForwardRefExoticComponent< @@ -159,7 +159,7 @@ export const TabsBar = memo(props => { endpointHistory={endpointHistory} allowEndpointChange={allowEndpointChange} className="!tw-opacity-100 tw-h-full" - isTeamsUpgradeCtaEnabled={props.isTeamsUpgradeCtaEnabled} + isWorkspacesUpgradeCtaEnabled={props.isWorkspacesUpgradeCtaEnabled} /> )}