From 15eb4f0ea4bcc2b9f74e24c760663d72913249d0 Mon Sep 17 00:00:00 2001 From: Shobhan Karthish <91373483+ShobhanKarthish@users.noreply.github.com> Date: Sat, 5 Sep 2026 08:47:45 +0000 Subject: [PATCH 1/2] fix: don't show (detected) after manual framework pick MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When auto-detection fails and the user picks a framework from the fallback picker, set manuallySelected so the intro Framework row omits the (detected) suffix — matching the Change framework path. --- .../screens/PostHogIntegrationIntroScreen.tsx | 41 +++++++++++++++---- .../PostHogIntegrationIntroScreen.test.ts | 22 ++++++++++ 2 files changed, 54 insertions(+), 9 deletions(-) diff --git a/src/ui/tui/screens/PostHogIntegrationIntroScreen.tsx b/src/ui/tui/screens/PostHogIntegrationIntroScreen.tsx index 227c6fc6..8f5768f7 100644 --- a/src/ui/tui/screens/PostHogIntegrationIntroScreen.tsx +++ b/src/ui/tui/screens/PostHogIntegrationIntroScreen.tsx @@ -56,6 +56,26 @@ export const CONTINUE_MENU_OPTIONS: { label: string; value: string }[] = [ { label: 'Cancel', value: 'cancel' }, ]; +/** + * Suffix for the Framework detection row. Auto-detect gets "(detected)"; a + * manual pick from either picker must not — otherwise a failed detection + * still claims success (#944). + */ +export function frameworkRowSuffix({ + manuallySelected, + beta, +}: { + manuallySelected: boolean; + beta?: boolean; +}): string | undefined { + const suffixParts: string[] = []; + if (!manuallySelected) suffixParts.push('(detected)'); + // Dead path today — every framework went GA. Kept for re-activation + // when the next beta framework lands (set `beta: true` on its config). + if (beta) suffixParts.push('[BETA]'); + return suffixParts.join(' ') || undefined; +} + /** * A blank, unselectable row. Navigation skips disabled options, so this is a * margin the menu can hold rather than one the layout has to special-case. @@ -172,7 +192,10 @@ export const PostHogIntegrationIntroScreen = ({ setPickingFramework(false)} + onComplete={() => { + setManuallySelected(true); + setPickingFramework(false); + }} /> ); @@ -180,7 +203,10 @@ export const PostHogIntegrationIntroScreen = ({ body = ( setPickingFramework(false)} + onComplete={() => { + setManuallySelected(true); + setPickingFramework(false); + }} /> ); } else if (view === 'more-info') { @@ -230,16 +256,13 @@ export const PostHogIntegrationIntroScreen = ({ const detectionRows: DetectionRow[] = []; if (frameworkLabel) { - const suffixParts: string[] = []; - if (!manuallySelected) suffixParts.push('(detected)'); - // Dead path today — every framework went GA. Kept for re-activation - // when the next beta framework lands (set `beta: true` on its config). - if (config?.metadata.beta) suffixParts.push('[BETA]'); - detectionRows.push({ label: 'Framework', value: frameworkLabel, - suffix: suffixParts.join(' ') || undefined, + suffix: frameworkRowSuffix({ + manuallySelected, + beta: config?.metadata.beta, + }), }); } diff --git a/src/ui/tui/screens/__tests__/PostHogIntegrationIntroScreen.test.ts b/src/ui/tui/screens/__tests__/PostHogIntegrationIntroScreen.test.ts index 301b84ec..4a7e993f 100644 --- a/src/ui/tui/screens/__tests__/PostHogIntegrationIntroScreen.test.ts +++ b/src/ui/tui/screens/__tests__/PostHogIntegrationIntroScreen.test.ts @@ -8,6 +8,7 @@ import { CONTINUE_MENU_OPTIONS, + frameworkRowSuffix, sharingOptions, } from '@ui/tui/screens/PostHogIntegrationIntroScreen'; @@ -72,3 +73,24 @@ describe('the sharing choice', () => { expect(spacer?.label).toBe(''); }); }); + +describe('frameworkRowSuffix', () => { + it('shows (detected) after auto-detection', () => { + expect(frameworkRowSuffix({ manuallySelected: false })).toBe('(detected)'); + }); + + it('omits (detected) after a manual pick', () => { + // Fallback picker after failed detection, or Change framework — both set + // manuallySelected so the intro does not claim detection succeeded (#944). + expect(frameworkRowSuffix({ manuallySelected: true })).toBeUndefined(); + }); + + it('keeps [BETA] when present, with or without (detected)', () => { + expect(frameworkRowSuffix({ manuallySelected: false, beta: true })).toBe( + '(detected) [BETA]', + ); + expect(frameworkRowSuffix({ manuallySelected: true, beta: true })).toBe( + '[BETA]', + ); + }); +}); From 89a13e06d78d9cb09de5326af673216eed9ebf54 Mon Sep 17 00:00:00 2001 From: Shobhan Karthish <91373483+ShobhanKarthish@users.noreply.github.com> Date: Sat, 5 Sep 2026 14:22:41 +0530 Subject: [PATCH 2/2] Clarify beta framework handling in comments Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/ui/tui/screens/PostHogIntegrationIntroScreen.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ui/tui/screens/PostHogIntegrationIntroScreen.tsx b/src/ui/tui/screens/PostHogIntegrationIntroScreen.tsx index 8f5768f7..685fe618 100644 --- a/src/ui/tui/screens/PostHogIntegrationIntroScreen.tsx +++ b/src/ui/tui/screens/PostHogIntegrationIntroScreen.tsx @@ -70,9 +70,8 @@ export function frameworkRowSuffix({ }): string | undefined { const suffixParts: string[] = []; if (!manuallySelected) suffixParts.push('(detected)'); - // Dead path today — every framework went GA. Kept for re-activation - // when the next beta framework lands (set `beta: true` on its config). - if (beta) suffixParts.push('[BETA]'); + // Some frameworks may be marked as beta/early-access in their config. + // If so, show a [BETA] tag to set expectations for users. return suffixParts.join(' ') || undefined; }