From 3def13e6c0b6eb79d6d575dd4505db43a005b31a Mon Sep 17 00:00:00 2001 From: John W Date: Wed, 25 Nov 2026 09:10:05 -0700 Subject: [PATCH] fix(tui): give the no-framework screen a way out and a manual setup link When detection finds no framework, the picker lists raw integration ids with no exit row and no pointer to another install path, and the headless abort links /docs/libraries. The screen now shows a line with the install guide (posthog.com/docs/getting-started/install) under "Could not auto-detect your framework.", the picker ends with a Cancel row that exits with code 0, and the shared no-framework abort links the same install guide. Programs that pass their own docsUrl (replay-vision, support) keep it. Refs #869 Not-tested: UI change not rendered with the layout-shift tool (Ink terminal UI); the real TUI was rendered through the wizard-ci MCP render_screen for a no-framework fixture Confidence: medium Scope-risk: narrow --- src/programs/shared/abort-no-framework.ts | 3 +- src/shared/constants.ts | 1 + .../screens/PostHogIntegrationIntroScreen.tsx | 28 +++++++++++++------ 3 files changed, 23 insertions(+), 9 deletions(-) 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 e04789d95..28aaf34ac 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 64f24a3ca..a886ec2f6 100644 --- a/src/tui/programs/posthog-integration/screens/PostHogIntegrationIntroScreen.tsx +++ b/src/tui/programs/posthog-integration/screens/PostHogIntegrationIntroScreen.tsx @@ -14,8 +14,12 @@ import type { ReactNode } from 'react'; import { useState, useSyncExternalStore } from 'react'; import type { WizardStore } from '@tui/store'; import { buildPlan, 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, @@ -63,19 +67,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); @@ -161,8 +169,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}