diff --git a/src/programs/shared/abort-no-framework.ts b/src/programs/shared/abort-no-framework.ts index b6313d097..ff94886c7 100644 --- a/src/programs/shared/abort-no-framework.ts +++ b/src/programs/shared/abort-no-framework.ts @@ -1,4 +1,5 @@ import { ErrorCodes } from '@shared/errors'; +import { POSTHOG_INSTALL_DOCS_URL } from '@shared/constants'; import { OutroKind, type OutroData } from '@shared/outro'; import { ProgramAbort } from '@programs/program-contract'; @@ -17,7 +18,7 @@ export function abortNoFrameworkDetected( instruction: 'Run the wizard from an app root directory.', body: "That's the folder containing package.json or an equivalent project file.", docsLabel: 'Supported frameworks and manual setup:', - docsUrl: 'https://posthog.com/docs/libraries', + docsUrl: POSTHOG_INSTALL_DOCS_URL, ...overrides, }; // Hosts without an outro screen (CI) only see the message, so it carries the diff --git a/src/shared/constants.ts b/src/shared/constants.ts index d50d410ef..085f34f4b 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -202,6 +202,7 @@ export const CONTEXT_MILL_URL = 'https://github.com/PostHog/context-mill'; export const CONTEXT_MILL_RELEASES_URL = 'https://github.com/PostHog/context-mill/releases/latest'; export const POSTHOG_DOCS_URL = 'https://posthog.com/docs'; +export const POSTHOG_INSTALL_DOCS_URL = `${POSTHOG_DOCS_URL}/getting-started/install`; export const POSTHOG_WIZARD_REPO_URL = 'https://github.com/PostHog/wizard'; export const POSTHOG_TERMS_URL = 'https://posthog.com/terms'; export const POSTHOG_PRIVACY_URL = 'https://posthog.com/privacy'; diff --git a/src/tui/programs/posthog-integration/screens/PostHogIntegrationIntroScreen.tsx b/src/tui/programs/posthog-integration/screens/PostHogIntegrationIntroScreen.tsx index 29ccd0ba9..e75200969 100644 --- a/src/tui/programs/posthog-integration/screens/PostHogIntegrationIntroScreen.tsx +++ b/src/tui/programs/posthog-integration/screens/PostHogIntegrationIntroScreen.tsx @@ -18,8 +18,12 @@ import { findProgramConfig, pickLeavesRunProject, } from '@programs'; -import { Integration } from '@shared/constants'; -import { PickerMenu, LoadingBox } from '@tui/primitives/index'; +import { Integration, POSTHOG_INSTALL_DOCS_URL } from '@shared/constants'; +import { + PickerMenu, + LoadingBox, + type PickerOption, +} from '@tui/primitives/index'; import { IntroScreenLayout, type DetectionRow, @@ -67,19 +71,23 @@ const FrameworkPicker = ({ store: WizardStore; onComplete?: () => void; }) => { - const options = Object.values(Integration).map((value) => ({ - label: value, - value, - })); + const options: PickerOption[] = [ + ...Object.values(Integration).map((value) => ({ label: value, value })), + { label: 'Cancel', value: 'cancel' }, + ]; return ( - + centered columns={2} message="Select your framework" options={options} onSelect={(value) => { const integration = Array.isArray(value) ? value[0] : value; + if (integration === 'cancel') { + store.requestExit(0); + return; + } void import('@programs').then(({ FRAMEWORK_REGISTRY }) => { const config = FRAMEWORK_REGISTRY[integration]; store.setFrameworkConfig(integration, config); @@ -166,8 +174,12 @@ export const PostHogIntegrationIntroScreen = ({ } else if (needsFrameworkPick && !pickingFramework) { body = ( <> - + Could not auto-detect your framework. + + Pick your framework below, or set PostHog up by hand: + + {POSTHOG_INSTALL_DOCS_URL}