Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(onboarding): share wizard sync components across both variants (#68738)

Fernando Gomes0a44954ecff2
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 92ca2d604d9a..fa297a2422ea 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -7273,9 +7273,9 @@ snapshots:
scenes-other-login--sso-error--light:
hash: v1.k794b7964.31098e33a0d1f225201f1b2113972b99706efeb83cf694557074590e6a067faf.uaLqGyG9UhNSJM7skFtkKX1BJUna5lgEa3WytucYBf0
scenes-other-onboarding--ai-observability-sdk-install--dark:
- hash: v1.k794b7964.c755a451e4b3d75fd7f9f2bb1f061e54745a45d976d5fdd58776810f3af16bd2.051wkrTpURm-ZjxfFwnao0Fpfye-eatcVLs51qtvckE
+ hash: v1.k794b7964.67dc493d2f16bae3551bd006efdc905d5aeadd311bc2b8e704d71c8cbba8af28.NFNRzaeuWWfGgN97lPPG6aM7UtUb0nCwVm9IhASNDNM
scenes-other-onboarding--ai-observability-sdk-install--light:
- hash: v1.k794b7964.1e2039448b261f70ca267ecaecb0d65b0b02a8442ba3122336dc6030063d83bf.opNkK8dGo38JnuL4c5NW7JzMTc9Mm8zXRDutcxQaVqs
+ hash: v1.k794b7964.810a6aba411094283414c4e8214829083fbc2fb8b5f7695d3256ac36e0cf00e4.KzC1SeqeiatayhdhuRnUYfJG6MPTmx8QIbp2pnLPAkM
scenes-other-onboarding--alerts--dark:
hash: v1.k794b7964.c22b202da34ceea01a9dc7162520e35f2366b891dc31dfef3f4cc1c02a732925.Zsv8Bo4o_X08cJdxFTd6O68BqhLEViaM9XxAGNO_T1k
scenes-other-onboarding--alerts--light:
@@ -7301,9 +7301,9 @@ snapshots:
scenes-other-onboarding--product-analytics-configuration--light:
hash: v1.k794b7964.d02bcfb00b3c281c7310a239267f4df3eddd8ac9535c73da67f6f308ecc802db.mDI4QEeK68vppMWjGJHD6ZKuEO7QsQ1xTMZfiN2Wzo4
scenes-other-onboarding--sdk-install--dark:
- hash: v1.k794b7964.280c2dc4148f2813ef061b248e83b784e053e2aefe57a3b6ca05b5723d0ce3b4.ZI6LlzgjURa1CVSYT3omHIhToPCwLsD5lKEBrMxQC5M
+ hash: v1.k794b7964.4c85f58954f3075da69dae89a1ccb032e4ba2c0fddf2247136a2e9edca30bf18.kBQGiG08hiiKZOuOQxDkRS71aoUv6GCTnX5PI8esNIc
scenes-other-onboarding--sdk-install--light:
- hash: v1.k794b7964.5216bbc7dc30631c8e872d8079c6dc89f9701e6220e26d9dcb6c78c49a4faa76.3S0iAv56OjOaTKKB_1WuAqxgLgpSdiYxFqHQEO9R86s
+ hash: v1.k794b7964.d75cd1b29a9a67012cd75a96172332a810c5727e4c92468363b954fc8eb7ba56.acfBD2LnZAIXsqOWQbBXvUN90WVynSjI8c73R2c_mTU
scenes-other-onboarding--session-replay-configuration--dark:
hash: v1.k794b7964.482b435a0c7fb6c0dca145e39284ac5aa006030ab1035b723e003d35848e5e2d.bxNfbPaPp_uaTpzKBdvrkiORbiuHnOotSAQGLHQ1Np4
scenes-other-onboarding--session-replay-configuration--light:
@@ -7317,9 +7317,9 @@ snapshots:
scenes-other-onboarding--source-maps--light:
hash: v1.k794b7964.5b16201cc8c0adaae60f4771c0b1dffdd2b355c6a9a45edbbceda84ea4a89d7b.oJHT8hlXUpR6-O_Cv4Rrtx_UmrN-AkPUWXTeAUXHpBo
scenes-other-onboarding--workflows-custom-installation-instructions--dark:
- hash: v1.k794b7964.680c73650188584210cf88e9e94dea6b3ac98d0e7360cdce093e12b385421c09.V-JqKwXKZjrhFIIU7CH7hEB1mmt-AB77Ne3RLQkMLNQ
+ hash: v1.k794b7964.fcd111a73d7c5de28fbb278426a024bec8b81154550549004c0303ff4d3b0e9e.n7nYyu0mx2MYkSi6X8n5waQCGJyoIy2b_eRrYRHX8Mo
scenes-other-onboarding--workflows-custom-installation-instructions--light:
- hash: v1.k794b7964.f5e839e44fc9b7af87152af7683c8a0b7d27f59cfeb25e59f7fdc4f57a1d242d.3mszucatM9SOwqdvrUaGWy1BH3DcvT58Li11Hl8VfkQ
+ hash: v1.k794b7964.82e3ad385bb537f6fdf26ec2aef29cf56401f5ca01215f10e53d4edad4d526a6.PoI2zRIus8AN7QRaTxKsDmK1QVYtl6-J-0uJwBIHDRM
scenes-other-onboarding-connect-data--connecting--dark:
hash: v1.k794b7964.59f96f7b6102b81524fe52d51ca88ca8dadb1702a307fd7976737864a9088a53.eO9mz6WENzTopgbZIyuZ6fZ6K73TWyK0zpSmsllgamw
scenes-other-onboarding-connect-data--connecting--light:
@@ -7345,13 +7345,13 @@ snapshots:
scenes-other-onboarding-connect-data--with-connected-source--light:
hash: v1.k794b7964.06446de6c861c43300008a041b7b4a1e17722178ed540089489ead06b6224f0b.ByLedO_F2tAefEViHmnFDkditVMrV9Ip_hTJxIeuguE
scenes-other-onboarding-installation-progress--all-states--dark:
- hash: v1.k794b7964.0a20dd9745c5c0cb9218a57a10b2f5775fe47768e42ec2d7fc6050ac9cb5ba3f.f7wIA68ob5CeJD7g2WMObeAouxX48LysMyCFee1Nhtc
+ hash: v1.k794b7964.608b660c61b7b4f39c7763ba3070648aca5633c9bbf3a25f49a91b57ae14a6bb.4s_2CstH1F6vk2XeiaA0utSU-DYNIiNBKzvjCGgXe9Q
scenes-other-onboarding-installation-progress--all-states--light:
- hash: v1.k794b7964.84bc1cdf2393b3c8e60513ec1c974ac89e8b57f633d86e6d06bf421b6db55116.JDxXjltCxeFtrIfJyOtQwpTKpmuCU03hkgQkmuKPU2k
+ hash: v1.k794b7964.760bed983f2886ca75b5a420b5a9217034e8f43c7876a1c633e9c0933102f8a7.yhvPVgpzwKd0XDN5D2fNuGtBYMZJ6ldqoxi737PWPdc
scenes-other-onboarding-installation-progress--completed--dark:
- hash: v1.k794b7964.f873f5cd6ed92c2c996100aeb2dc3561c05eef61a19e62ecf3a0a8ef3362df3f.EN0-xcFn77_w5XgpO1XMtt0QFzzeCI4MXP3_nZbjM_U
+ hash: v1.k794b7964.483efaa879a0ea562a2607b8e597c93ede2ca5675fe8027d276925c6fb770399.m-FRsNmoeODgPULYEvrBvQ5jL8SYCkGCd2uZhxoc_Lc
scenes-other-onboarding-installation-progress--completed--light:
- hash: v1.k794b7964.ae3737a3612265d86f945aa1a35ab38ff4dd2b91ba2587fa75d317d04dd84bd8.6N4y0DnDxgHUXJ9aZI9_qovuZABn2FM_KEDHoKzOsU0
+ hash: v1.k794b7964.4e5ceba8d02ac9697d20fb4e8e4ddcfc94063e28af001f75adb1df147be8daa5.cq6z_V7Lb9mKnhY1uA7yzEMEG-R5YJ2XE7f8Mx9Fwb8
scenes-other-onboarding-installation-progress--connecting--dark:
hash: v1.k794b7964.88ee5c432ee6bc83b1dc1f1d44ad4612b2b18b0b62808ea0c4175c7835810a66.-X7mQanLZf7YmO1K1Lf_1P2fQogx1njST-UkFd-hitA
scenes-other-onboarding-installation-progress--connecting--light:
@@ -7373,25 +7373,25 @@ snapshots:
scenes-other-onboarding-installation-progress--failed-wizard--light:
hash: v1.k794b7964.8d687e80b53eb492b92b67f6906c9603f98e5a4063448954b79081da9c76bd81.BifPAIKybTaFKMRFdM6hA-grT-km140b9kbYwxMEisU
scenes-other-onboarding-installation-progress--floating-dismissible--dark:
- hash: v1.k794b7964.e8e629803313321ffd2690f6f6fa5089ff61b9381b928cd2a2c6c540ea632465.n8_g4KZMIO54o97zTGnIAPUIDE4OnUgLWbnF97lbCh0
+ hash: v1.k794b7964.edf9fd01639ebfd8c5bb4190a85bcab1fc9d0a475edd6425b49e03470d55fc53.TLoOIi12uQOj7pgNfA4skG6g7hxGuXSqi44pYhSW7ho
scenes-other-onboarding-installation-progress--floating-dismissible--light:
- hash: v1.k794b7964.9e32fd1807a9a2465fcba46f56c802dae8f9d856d182e354470c82089e070984.nb5Qkw5_GPgZYAqxxxVVzE1yd4l81p3lZLGwoani7Ao
+ hash: v1.k794b7964.c2842653f9a0c0f288a6dd8433fdd47caaa535a4fdcc374dfe850cde1e2cd482.5mcqjf9QckE5cKg6a3rvepx4hZhsj8TKEO8GQ1lT07E
scenes-other-onboarding-installation-progress--playground--dark:
- hash: v1.k794b7964.4a02bd8e5e38437c539c859610516a6d51366f2b11afd22da5b8b92e392ea645.k3D9_w6AW7OJ_Bhhn8FqaSHVAC3frcuwsJ8FMm23aEk
+ hash: v1.k794b7964.ffd7be72bc0ce9f36ca0a796b6442f5ce0998097ea97b430771d495a484696aa.Wp1cSAv5alGyYw_0VqAsCdPm9BpFFEq3jkKkqP6Voqg
scenes-other-onboarding-installation-progress--playground--light:
- hash: v1.k794b7964.b23f7f8fc3c802d5680a246ae795e32ab07944e6e9fbbc32bb86caffbcaccc4f.dRVlYa44DBOBRMeaZ1loa1yWHRjqHVaYi1RbQJEirtA
+ hash: v1.k794b7964.bed8dbddcefaceb919731b1f6f03f2da690748891ca9793d8098e88fd0bc16f5.TmEtQEGqZau4hqvSnE6d2RYKdLdsxWP5RGMRdJClCj4
scenes-other-onboarding-installation-progress--pull-request-ready--dark:
- hash: v1.k794b7964.c0c9216c1cc6ae0c18e14cd5bb40b711340a84244074259d4cb72d8424d14bd7.YHOGdFDadbSNg1ySgTiUbEyYcybpzfUb_N16SZnBESE
+ hash: v1.k794b7964.69bc043993731b9da0b26e26f1bdb8c00f7171a6e06f13195b7aaa51ad8dc9bc.jD8IejKEE7kxkleD413Q4TNKIgUyV_IsdbRlvUwRmiE
scenes-other-onboarding-installation-progress--pull-request-ready--light:
- hash: v1.k794b7964.c55b4c07211d18fdd68b48977d1d6135ce89010fb95a74be822326bddffe832b.rguLqKN3ooCm8ni2g0xdFkhteqcC0hbKOxUxoetyxGY
+ hash: v1.k794b7964.ce6574e551b1f5d71be71662360bbe1d72584c1a230c733033cddd6713572809.UTZtB-Wx3Hnp4YViWXSpKAsnQeT0UDTdlZ-d8jq1qVw
scenes-other-onboarding-installation-progress--running-provisioning--dark:
- hash: v1.k794b7964.94c10c5ecabf7e2c35d4030c310e2f0b0210515da443fff2887cc4f2eeadf857.4gMrr55hMDbcJWFHiG0GrgzC2rQUfy9CZ2ekuub-bcU
+ hash: v1.k794b7964.b8a2bc0f45a9116e527fa8218d8cb07cf58532d1b72b4e93803cc47b0e5de0d4.VU61B569TgjnZ6fckrzqnYba1cBdzdRkrtUdlerJP0w
scenes-other-onboarding-installation-progress--running-provisioning--light:
- hash: v1.k794b7964.bd06d5d83b40158d3477b90ccb4655ce0a7cb31710626fecba579f4db3aa0db0.NxKvxht8bosMmbVce6kPS-uzEdp5H6Mp1Hd8vR8r9UQ
+ hash: v1.k794b7964.1a588dcfd2d5649d5afaf144666e23daac15ff7b85ec37d6e122aae855659db9.6199ncdnmhET929iyTd6AWxe9kZs_lmnbrMIjXrPXlk
scenes-other-onboarding-installation-progress--running-wizard--dark:
- hash: v1.k794b7964.4a02bd8e5e38437c539c859610516a6d51366f2b11afd22da5b8b92e392ea645.D8RXEVE30rTmmEvMwKqDbxnHF-xVWukJjx17d1pnJTY
+ hash: v1.k794b7964.ffd7be72bc0ce9f36ca0a796b6442f5ce0998097ea97b430771d495a484696aa.RA5dclhzxUp4XuBbYRa8Ktlvad8SDQyOsgz-fvExZqE
scenes-other-onboarding-installation-progress--running-wizard--light:
- hash: v1.k794b7964.b23f7f8fc3c802d5680a246ae795e32ab07944e6e9fbbc32bb86caffbcaccc4f.UhFiTjIRyPy7xqbLxLpx76ylkO88PnFzTezR-Oshfkk
+ hash: v1.k794b7964.bed8dbddcefaceb919731b1f6f03f2da690748891ca9793d8098e88fd0bc16f5.fmMcElO_fj3DC8dQpk-EEt1o_yEwyFESioVLyAD6oTk
scenes-other-onboarding-product-selection--base--dark:
hash: v1.k794b7964.6b35abf90f865d866bfe83ead0b3d2b6d1686a4efbb6f513d2d3470a36a3928b.51PN1rmvasAVWZFwSu5wHcNhcntw6epUCisAuCTGClY
scenes-other-onboarding-product-selection--base--light:
@@ -7465,9 +7465,9 @@ snapshots:
scenes-other-onboarding-wizard-progress-tracker--running--light:
hash: v1.k794b7964.f5369826708b010cb25bfc3a92f8013a168ae6e3b9721e4c2527e1739f2f0a2b.fO171E9T_aXdHuwocYd2_261sekGGr6J5cOmTVdoowE
scenes-other-onboarding-wizard-sync-card--all-states--dark:
- hash: v1.k794b7964.751f43e3bf5ddfba6bd997f3a23f5596195a0383390cea676689f5ded6d794cb.Tjux7X_LWnwTs_hn799nvhP_LabiJpXm1p5483STmjc
+ hash: v1.k794b7964.58dc138d1585677aa2d648bc1c612338d82e4e78b5b770436414d311c192e5b5.1mKUAtBcGxEoCskUdlx4QzdezEwkIaP4k97vsypdkqI
scenes-other-onboarding-wizard-sync-card--all-states--light:
- hash: v1.k794b7964.0ffbac8423073d516edb037d247a21f1affa7a6bcaa31e3ec85c50ae9f2289df.KwtEwCJg9sHP2jJS3HEoQLLU6-DryKxvO35dqWzmi2I
+ hash: v1.k794b7964.0cc65480ceb6ba681dc3ff66ddbe7586ab36168d78e567beabdd4b5045dc517f.eG3RYysuTf9PzPwyeML--_oIPVfqmYJKzvSUvVgQG8g
scenes-other-onboarding-wizard-sync-card--cloud-keeping-ci-green--dark:
hash: v1.k794b7964.698010f52d1f6a068af50f838d560fdd3fd0b0c499697e0e08d8747cb5d0ad53.xB2q7n60ow5WFoZ7-b-cNpXgqog-zIqMkJWdXhzOsf4
scenes-other-onboarding-wizard-sync-card--cloud-keeping-ci-green--light:
@@ -7477,13 +7477,13 @@ snapshots:
scenes-other-onboarding-wizard-sync-card--cloud-wizard-running--light:
hash: v1.k794b7964.0cfae6b396d23d4bf84998b078b2bc21d231cff6ca91c6ad72287015ffbc3612.xqAxC2OFrTOOAjYibZDZmt8pAGWh1rVgpWUrdZieRe4
scenes-other-onboarding-wizard-sync-card--completed--dark:
- hash: v1.k794b7964.7be369e4455f47e7ca44caf0a77f1b7b91e94998059d2ee9079a35b1db4d643a.AhKLZtANlSx9XG_w2XCEM-pV6fXWWp8b7TO9amdDXWs
+ hash: v1.k794b7964.f1d998ba6eab3c39c0cededb58660743576a877fa3de51b848a597db69f19827.bkZSi72ueVwAdzLOqTGdvn_lSVMkFKNO-cvQ6pu3Y9w
scenes-other-onboarding-wizard-sync-card--completed--light:
hash: v1.k794b7964.74517a371e77e79819faf936409917cfebc320d14767b3b43e72ca40c20f75b4.-ktzzMAdNYqQuR-WSmKfBNz02nhrKjQz08TbztIO_RY
scenes-other-onboarding-wizard-sync-card--connecting--dark:
- hash: v1.k794b7964.aad9bbedbc6eff07374afdd9a5d5d98b6dbcaade09c87439e85df0395f257216.d1hBw_OfNoNyrR_DIIN828DlzVagmn1723NMc4PSUtg
+ hash: v1.k794b7964.61398434096848c5eb49dc43a6649548981357049ad0e237bee837e83da9eaf7.w43LwctvdIarLnYq9o-Bo99weEVPs0XjsCuwOmxMuFE
scenes-other-onboarding-wizard-sync-card--connecting--light:
- hash: v1.k794b7964.8ff9d181c4b98b932aa9491cee3b63307c93778fe82926179120324695ec1936.Vr1OqWSeKG5Q01QexQX3H2V2tT1PpVhM8XE-HCeYTzE
+ hash: v1.k794b7964.00de83bd008d8ea2c3020e7c09d2acde3da28546225c780c6df558ce588403bf.aYMyLPzhiIndK2D-JlR2rNBCXOP8V_-fh4MhNx3SQDQ
scenes-other-onboarding-wizard-sync-card--failed--dark:
hash: v1.k794b7964.0699d0268f15fd6d9502d0642c901b5d233088e66dae63e4529bf8dfad525932.bjaXmHatF5FslsTRdwe4gWrjbUlM3Nu8PtCehHTYzqo
scenes-other-onboarding-wizard-sync-card--failed--light:
diff --git a/frontend/src/layout/panel-layout/InstallationStatusNavButton.stories.tsx b/frontend/src/layout/panel-layout/InstallationStatusNavButton.stories.tsx
index 0371770f4907..d8c903fae3bc 100644
--- a/frontend/src/layout/panel-layout/InstallationStatusNavButton.stories.tsx
+++ b/frontend/src/layout/panel-layout/InstallationStatusNavButton.stories.tsx
@@ -4,11 +4,8 @@ import type { Meta, StoryObj } from '@storybook/react'
import { useMountedLogic } from 'kea'
import { useEffect } from 'react'
-import { wizardActiveSessionDetectorLogic } from 'scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardActiveSessionDetectorLogic'
-import {
- activeCloudRunLogic,
- type CloudRunHandle,
-} from 'scenes/onboarding/self-driving/sdks/OnboardingInstallStep/activeCloudRunLogic'
+import { activeCloudRunLogic, type CloudRunHandle } from 'scenes/onboarding/shared/wizard-sync/activeCloudRunLogic'
+import { wizardActiveSessionDetectorLogic } from 'scenes/onboarding/shared/wizard-sync/wizardActiveSessionDetectorLogic'
import { projectLogic } from 'scenes/projectLogic'
import { teamLogic } from 'scenes/teamLogic'
diff --git a/frontend/src/layout/panel-layout/InstallationStatusNavButton.tsx b/frontend/src/layout/panel-layout/InstallationStatusNavButton.tsx
index 6a56297a285a..f45939ee4104 100644
--- a/frontend/src/layout/panel-layout/InstallationStatusNavButton.tsx
+++ b/frontend/src/layout/panel-layout/InstallationStatusNavButton.tsx
@@ -5,12 +5,9 @@ import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { ButtonPrimitive } from 'lib/ui/Button/ButtonPrimitives'
import { cn } from 'lib/utils/css-classes'
import { elapsedSecondsFrom } from 'lib/utils/datetime'
-import { wizardActiveSessionDetectorLogic } from 'scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardActiveSessionDetectorLogic'
-import {
- activeCloudRunLogic,
- type CloudRunHandle,
-} from 'scenes/onboarding/self-driving/sdks/OnboardingInstallStep/activeCloudRunLogic'
-import { installationProgressLogic } from 'scenes/onboarding/self-driving/sdks/OnboardingInstallStep/installationProgressLogic'
+import { activeCloudRunLogic, type CloudRunHandle } from 'scenes/onboarding/shared/wizard-sync/activeCloudRunLogic'
+import { installationProgressLogic } from 'scenes/onboarding/shared/wizard-sync/installationProgressLogic'
+import { wizardActiveSessionDetectorLogic } from 'scenes/onboarding/shared/wizard-sync/wizardActiveSessionDetectorLogic'
import { installationStatusNavLogic, type NavInstallationPhase } from './installationStatusNavLogic'
diff --git a/frontend/src/layout/panel-layout/installationStatusNavLogic.ts b/frontend/src/layout/panel-layout/installationStatusNavLogic.ts
index 481056b9711a..2e4a568c2f97 100644
--- a/frontend/src/layout/panel-layout/installationStatusNavLogic.ts
+++ b/frontend/src/layout/panel-layout/installationStatusNavLogic.ts
@@ -1,8 +1,8 @@
import { connect, kea, path, selectors } from 'kea'
-import { wizardActiveSessionDetectorLogic } from 'scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardActiveSessionDetectorLogic'
-import { activeCloudRunLogic } from 'scenes/onboarding/self-driving/sdks/OnboardingInstallStep/activeCloudRunLogic'
-import { wizardSyncUiLogic } from 'scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/wizardSyncUiLogic'
+import { activeCloudRunLogic } from 'scenes/onboarding/shared/wizard-sync/activeCloudRunLogic'
+import { wizardActiveSessionDetectorLogic } from 'scenes/onboarding/shared/wizard-sync/wizardActiveSessionDetectorLogic'
+import { wizardSyncUiLogic } from 'scenes/onboarding/shared/wizard-sync/wizardSyncUiLogic'
import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
diff --git a/frontend/src/scenes/AuthenticatedShell.tsx b/frontend/src/scenes/AuthenticatedShell.tsx
index b66b4344a155..b722760b6dbe 100644
--- a/frontend/src/scenes/AuthenticatedShell.tsx
+++ b/frontend/src/scenes/AuthenticatedShell.tsx
@@ -8,8 +8,8 @@ import { ToastCloseButton } from 'lib/lemon-ui/LemonToast/LemonToast'
import { apiStatusLogic } from 'lib/logic/apiStatusLogic'
import { eventIngestionRestrictionLogic } from 'lib/logic/eventIngestionRestrictionLogic'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import { WizardSyncDebugPanel } from 'scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/WizardSyncDebugPanel'
-import { WizardSyncFab } from 'scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/WizardSyncFab'
+import { WizardSyncDebugPanel } from 'scenes/onboarding/shared/wizard-sync/WizardSyncDebugPanel'
+import { WizardSyncFab } from 'scenes/onboarding/shared/wizard-sync/WizardSyncFab'
import { GlobalModals } from '~/layout/GlobalModals'
import { GlobalShortcuts } from '~/layout/GlobalShortcuts'
diff --git a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardInstallStep/WizardInstallIntro.tsx b/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardInstallStep/WizardInstallIntro.tsx
index 5a60ffd32d81..b357abae5c9d 100644
--- a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardInstallStep/WizardInstallIntro.tsx
+++ b/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardInstallStep/WizardInstallIntro.tsx
@@ -3,8 +3,8 @@ export function WizardInstallIntro(): JSX.Element {
<div className="text-center max-w-xl mx-auto space-y-3">
<h2 className="text-2xl font-bold">Skip the install. Get 10–20 minutes back.</h2>
<p className="text-muted">
- Run this command from your project&apos;s root directory. The wizard detects your framework, installs
- the right SDK, configures your environment variables, and wires up event capture automatically.
+ The wizard detects your framework, installs the right SDK, configures your environment variables, and
+ wires up event capture automatically.
</p>
<p className="text-muted text-xs">LLM inference is on us, no API key needed.</p>
</div>
diff --git a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardInstallStep/index.tsx b/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardInstallStep/index.tsx
index c37822f94c22..380094b6b09e 100644
--- a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardInstallStep/index.tsx
+++ b/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardInstallStep/index.tsx
@@ -6,6 +6,9 @@ import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { OnboardingStepKey, type SDK } from '~/types'
+import { onboardingEventUsageLogic } from '../../../../onboardingEventUsageLogic'
+import { activeCloudRunLogic } from '../../../../shared/wizard-sync/activeCloudRunLogic'
+import { WizardInstallOptions } from '../../../../shared/wizard-sync/WizardInstallOptions'
import { OnboardingStep } from '../../../OnboardingStep'
import { AdblockWarning, RealtimeCheckIndicator } from '../../RealtimeCheckIndicator'
import { SDKGrid } from '../SDKGrid'
@@ -16,6 +19,19 @@ import { wizardInstallStepLogic } from '../wizardInstallStepLogic'
import { WizardProgressTracker, useWizardTakeoverActive } from '../WizardProgressTracker'
import { WizardInstallIntro } from './WizardInstallIntro'
+// The shared cloud/local switcher wrapped with legacy's own command block and instrumentation. An
+// active cloud run renders inside it (WizardCloudRunBlock pins to the run's progress), so the
+// failed-run "Run it yourself" fallback keeps working — the mode state must not unmount mid-recovery.
+function LegacyInstallOptions(): JSX.Element {
+ const { reportContextOnboardingInstallModeSelected } = useActions(onboardingEventUsageLogic)
+ return (
+ <WizardInstallOptions
+ onModeSelected={reportContextOnboardingInstallModeSelected}
+ localBlock={<WizardCommandBlock />}
+ />
+ )
+}
+
/**
* Default install step for non-Logs onboarding flows. Wizard-centered: the SDK
* grid lives behind a "Need to set up manually?" link.
@@ -35,16 +51,23 @@ export function WizardInstallStep(props: VariantProps): JSX.Element {
}
function WizardInstallStepStatic(props: VariantProps): JSX.Element {
- const continueDisabledReason = props.installationComplete ? undefined : 'Installation is not complete'
+ // Deliberately not gated on the cloud-run flag: a persisted handle is proof the user started a
+ // run while on the test arm, and a mid-experiment flag change must not strand an in-flight run.
+ const { activeCloudRun } = useValues(activeCloudRunLogic)
+ // A queued/running cloud run unblocks Continue just like a local takeover: the run keeps going
+ // in the background (surfaced by the FAB) and installation events aren't required.
+ const continueDisabledReason =
+ props.installationComplete || activeCloudRun ? undefined : 'Installation is not complete'
return (
<WizardInstallShell
continueDisabledReason={continueDisabledReason}
- showSkip={!props.installationComplete}
+ showSkip={!props.installationComplete && !activeCloudRun}
props={props}
>
- <WizardInstallIntro />
+ {/* The intro's terminal framing makes no sense while a run's progress is on screen. */}
+ {!activeCloudRun && <WizardInstallIntro />}
<div className="max-w-xl mx-auto">
- <WizardCommandBlock />
+ <LegacyInstallOptions />
</div>
</WizardInstallShell>
)
@@ -52,23 +75,32 @@ function WizardInstallStepStatic(props: VariantProps): JSX.Element {
function WizardInstallStepWithSync(props: VariantProps): JSX.Element {
const isTakeoverActive = useWizardTakeoverActive()
- // Once the wizard is in flight, trust it — installation events aren't required
+ // See WizardInstallStepStatic: an existing handle renders regardless of the experiment arm.
+ const { activeCloudRun } = useValues(activeCloudRunLogic)
+ // Once the wizard is in flight (cloud or local), trust it — installation events aren't required
// to unblock Continue.
const continueDisabledReason =
- isTakeoverActive || props.installationComplete ? undefined : 'Installation is not complete'
+ isTakeoverActive || activeCloudRun || props.installationComplete ? undefined : 'Installation is not complete'
return (
<WizardInstallShell
continueDisabledReason={continueDisabledReason}
- showSkip={!props.installationComplete && !isTakeoverActive}
+ showSkip={!props.installationComplete && !isTakeoverActive && !activeCloudRun}
props={props}
>
- {isTakeoverActive ? (
+ {/* A cloud run wins over the local tracker: the cloud wizard posts to the same session
+ stream, so rendering both would show the same run twice. The run's progress renders
+ inside LegacyInstallOptions (WizardCloudRunBlock pins to it). */}
+ {activeCloudRun ? (
+ <div className="max-w-xl mx-auto">
+ <LegacyInstallOptions />
+ </div>
+ ) : isTakeoverActive ? (
<WizardProgressTracker />
) : (
<>
<WizardInstallIntro />
<div className="max-w-xl mx-auto">
- <WizardCommandBlock />
+ <LegacyInstallOptions />
</div>
</>
)}
diff --git a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardProgressFab/WizardProgressFab.stories.tsx b/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardProgressFab/WizardProgressFab.stories.tsx
index b56769f16602..aeb27bb67994 100644
--- a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardProgressFab/WizardProgressFab.stories.tsx
+++ b/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardProgressFab/WizardProgressFab.stories.tsx
@@ -9,8 +9,8 @@ import { mswDecorator } from '~/mocks/browser'
import { wizardSessionStreamLogic } from 'products/wizard/frontend/wizardSessionStreamLogic'
import { WizardProgressFab } from '.'
+import { wizardActiveSessionDetectorLogic } from '../../../../shared/wizard-sync/wizardActiveSessionDetectorLogic'
import { WIZARD_SKILL_IDS } from '../../skillBadge'
-import { wizardActiveSessionDetectorLogic } from '../wizardActiveSessionDetectorLogic'
import { wizardProgressTrackerLogic } from '../wizardProgressTrackerLogic'
const WORKFLOW_ID = 'posthog-integration'
diff --git a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardProgressFab/index.tsx b/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardProgressFab/index.tsx
index e74580429565..2edae79a9f2f 100644
--- a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardProgressFab/index.tsx
+++ b/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardProgressFab/index.tsx
@@ -8,7 +8,7 @@ import { IconChevronDown, IconX } from '@posthog/icons'
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
-import { wizardActiveSessionDetectorLogic } from '../wizardActiveSessionDetectorLogic'
+import { wizardActiveSessionDetectorLogic } from '../../../../shared/wizard-sync/wizardActiveSessionDetectorLogic'
import { wizardProgressTrackerLogic } from '../wizardProgressTrackerLogic'
import { ExpandedDetails } from './ExpandedDetails'
import { headlineFor, simulatedTaskFraction, subLineFor } from './helpers'
diff --git a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardProgressTracker/index.tsx b/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardProgressTracker/index.tsx
index 13388d2eb4c4..95e8cbfce127 100644
--- a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardProgressTracker/index.tsx
+++ b/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/WizardProgressTracker/index.tsx
@@ -3,6 +3,7 @@ import { useEffect } from 'react'
import { LemonBanner } from '@posthog/lemon-ui'
+import { activeCloudRunLogic } from '../../../../shared/wizard-sync/activeCloudRunLogic'
import { wizardProgressTrackerLogic } from '../wizardProgressTrackerLogic'
import { bannerTypeFor, headlineFor, subLineFor } from './helpers'
@@ -14,11 +15,23 @@ import { bannerTypeFor, headlineFor, subLineFor } from './helpers'
export function WizardProgressTracker(): JSX.Element | null {
const { displayState, latestSession } = useValues(wizardProgressTrackerLogic)
const { setPanelMounted } = useActions(wizardProgressTrackerLogic)
+ const { setPanelMounted: setSharedPanelMounted } = useActions(activeCloudRunLogic)
+ // Claim BOTH inline-panel flags: the legacy one (WizardProgressFab) and the shared one the
+ // app-wide WizardSyncFab reads — otherwise the FAB shows the same local run next to this card.
+ // Only while actually rendering something, or a null render would hide the FAB for nothing.
+ const showing = displayState !== 'preTakeover' && !!latestSession
useEffect(() => {
+ if (!showing) {
+ return
+ }
setPanelMounted(true)
- return () => setPanelMounted(false)
- }, [setPanelMounted])
+ setSharedPanelMounted(true)
+ return () => {
+ setPanelMounted(false)
+ setSharedPanelMounted(false)
+ }
+ }, [showing, setPanelMounted, setSharedPanelMounted])
if (displayState === 'preTakeover' || !latestSession) {
return null
diff --git a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardProgressTrackerLogic.test.ts b/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardProgressTrackerLogic.test.ts
index 1dd23ea44aff..c6cdd712d7d5 100644
--- a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardProgressTrackerLogic.test.ts
+++ b/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardProgressTrackerLogic.test.ts
@@ -6,7 +6,7 @@ import { initKeaTests } from '~/test/init'
import type { WizardSessionDTOApi } from 'products/wizard/frontend/generated/api.schemas'
import { wizardSessionStreamLogic } from 'products/wizard/frontend/wizardSessionStreamLogic'
-import { wizardActiveSessionDetectorLogic } from './wizardActiveSessionDetectorLogic'
+import { wizardActiveSessionDetectorLogic } from '../../../shared/wizard-sync/wizardActiveSessionDetectorLogic'
import { resetWizardSyncTelemetryForTests, wizardProgressTrackerLogic } from './wizardProgressTrackerLogic'
// The detector polls a REST endpoint from afterMount and the stream logic builds an SSE
diff --git a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardProgressTrackerLogic.ts b/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardProgressTrackerLogic.ts
index 71513928d958..7ef116e1fa52 100644
--- a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardProgressTrackerLogic.ts
+++ b/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardProgressTrackerLogic.ts
@@ -7,7 +7,10 @@ import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import type { WizardSessionDTOApi } from 'products/wizard/frontend/generated/api.schemas'
import { wizardSessionStreamLogic } from 'products/wizard/frontend/wizardSessionStreamLogic'
-import { isSessionActive, wizardActiveSessionDetectorLogic } from './wizardActiveSessionDetectorLogic'
+import {
+ isSessionActive,
+ wizardActiveSessionDetectorLogic,
+} from '../../../shared/wizard-sync/wizardActiveSessionDetectorLogic'
import type { wizardProgressTrackerLogicType } from './wizardProgressTrackerLogicType'
export type DisplayState =
diff --git a/frontend/src/scenes/onboarding/onboardingEventUsageLogic.ts b/frontend/src/scenes/onboarding/onboardingEventUsageLogic.ts
index e995c521d1f4..308e95cfc2be 100644
--- a/frontend/src/scenes/onboarding/onboardingEventUsageLogic.ts
+++ b/frontend/src/scenes/onboarding/onboardingEventUsageLogic.ts
@@ -1,7 +1,10 @@
-import { actions, kea, listeners, path } from 'kea'
+import { actions, connect, kea, listeners, path } from 'kea'
import posthog from 'posthog-js'
+import { featureFlagLogic, type FeatureFlagsSet } from 'lib/logic/featureFlagLogic'
+
import type { onboardingEventUsageLogicType } from './onboardingEventUsageLogicType'
+import { resolveOnboardingFlowVariant } from './onboardingVariants'
/** Steps of the context-first onboarding flow (`ContextOnboarding.tsx`), in order. */
export type ContextOnboardingStepId = 'welcome' | 'install' | 'sources' | 'warehouse' | 'billing' | 'invite'
@@ -12,6 +15,15 @@ export type ContextOnboardingStepId = 'welcome' | 'install' | 'sources' | 'wareh
// `eventUsageLogic`, stamped `{version: 1, flow_variant: 'legacy'}`.
const CONTEXT_ONBOARDING_EVENT_PROPS = { version: 2, flow_variant: 'context_first' } as const
+// Wizard-sync events fire from BOTH onboarding variants (GROW-121): same v2 event shape, but
+// flow_variant reflects whichever flow the user is actually in so the AB test can split on it.
+function wizardSyncEventProps(featureFlags: FeatureFlagsSet): { version: 2; flow_variant: string } {
+ return {
+ version: 2,
+ flow_variant: resolveOnboardingFlowVariant(featureFlags) === 'self-driving' ? 'context_first' : 'legacy',
+ }
+}
+
/**
* Funnel events for the context-first onboarding flow (v2) — a dedicated logic rather than more
* surface on the giant `eventUsageLogic`, following `sessionRecordingEventUsageLogic`'s split.
@@ -21,6 +33,9 @@ const CONTEXT_ONBOARDING_EVENT_PROPS = { version: 2, flow_variant: 'context_firs
*/
export const onboardingEventUsageLogic = kea<onboardingEventUsageLogicType>([
path(['scenes', 'onboarding', 'onboardingEventUsageLogic']),
+ connect(() => ({
+ values: [featureFlagLogic, ['featureFlags']],
+ })),
actions({
reportContextOnboardingStarted: true,
reportContextOnboardingStepViewed: (stepId: ContextOnboardingStepId) => ({ stepId }),
@@ -45,8 +60,19 @@ export const onboardingEventUsageLogic = kea<onboardingEventUsageLogicType>([
prOpened: boolean
prUrl: string | null
}) => props,
+ // Engagement with the shared wizard sync surface (FAB card / launcher / dialog), fired for
+ // both variants and both run modes (GROW-121).
+ reportWizardSyncExpanded: (props: { runKey: string; mode: 'cloud' | 'local'; phase: string }) => props,
+ reportWizardSyncMinimized: (props: { runKey: string; mode: 'cloud' | 'local'; phase: string }) => props,
+ reportWizardSyncRestored: (props: { runKey: string; mode: 'cloud' | 'local'; phase: string }) => props,
+ reportWizardSyncRunDismissed: (props: {
+ runKey: string
+ mode: 'cloud' | 'local'
+ phase: string
+ elapsedSeconds: number
+ }) => props,
}),
- listeners({
+ listeners(({ values }) => ({
// The flow always enters at the welcome step, so `started` carries a fixed entry point
// (legacy uses e.g. 'product_selection').
reportContextOnboardingStarted: () => {
@@ -82,7 +108,7 @@ export const onboardingEventUsageLogic = kea<onboardingEventUsageLogicType>([
reportContextOnboardingInstallModeSelected: ({ mode }) => {
posthog.capture('onboarding install mode selected', {
mode,
- ...CONTEXT_ONBOARDING_EVENT_PROPS,
+ ...wizardSyncEventProps(values.featureFlags),
})
},
reportContextOnboardingSourceToggled: ({ productKey, toggle, enabled }) => {
@@ -104,7 +130,7 @@ export const onboardingEventUsageLogic = kea<onboardingEventUsageLogicType>([
task_id: taskId,
run_id: runId,
repository,
- ...CONTEXT_ONBOARDING_EVENT_PROPS,
+ ...wizardSyncEventProps(values.featureFlags),
})
},
reportContextOnboardingCloudRunCompleted: ({ taskId, runId, status, durationSeconds, prOpened, prUrl }) => {
@@ -115,8 +141,41 @@ export const onboardingEventUsageLogic = kea<onboardingEventUsageLogicType>([
duration_seconds: durationSeconds,
pr_opened: prOpened,
pr_url: prUrl,
- ...CONTEXT_ONBOARDING_EVENT_PROPS,
+ ...wizardSyncEventProps(values.featureFlags),
})
},
- }),
+ reportWizardSyncExpanded: ({ runKey, mode, phase }) => {
+ posthog.capture('wizard sync expanded', {
+ run_key: runKey,
+ mode,
+ phase,
+ ...wizardSyncEventProps(values.featureFlags),
+ })
+ },
+ reportWizardSyncMinimized: ({ runKey, mode, phase }) => {
+ posthog.capture('wizard sync minimized', {
+ run_key: runKey,
+ mode,
+ phase,
+ ...wizardSyncEventProps(values.featureFlags),
+ })
+ },
+ reportWizardSyncRestored: ({ runKey, mode, phase }) => {
+ posthog.capture('wizard sync restored', {
+ run_key: runKey,
+ mode,
+ phase,
+ ...wizardSyncEventProps(values.featureFlags),
+ })
+ },
+ reportWizardSyncRunDismissed: ({ runKey, mode, phase, elapsedSeconds }) => {
+ posthog.capture('wizard sync run dismissed', {
+ run_key: runKey,
+ mode,
+ phase,
+ elapsed_seconds: elapsedSeconds,
+ ...wizardSyncEventProps(values.featureFlags),
+ })
+ },
+ })),
])
diff --git a/frontend/src/scenes/onboarding/self-driving/ContextOnboarding.tsx b/frontend/src/scenes/onboarding/self-driving/ContextOnboarding.tsx
index 3aefda7e24f1..8f1f20d47d34 100644
--- a/frontend/src/scenes/onboarding/self-driving/ContextOnboarding.tsx
+++ b/frontend/src/scenes/onboarding/self-driving/ContextOnboarding.tsx
@@ -2,8 +2,8 @@ import { useActions, useAsyncActions, useValues } from 'kea'
import { router } from 'kea-router'
import { type ReactNode, useEffect, useState } from 'react'
-import { IconArrowLeft, IconArrowRight, IconCheckCircle, IconCloud, IconGithub, IconTerminal } from '@posthog/icons'
-import { LemonButton, LemonSegmentedButton, LemonSwitch, LemonTag, Link } from '@posthog/lemon-ui'
+import { IconArrowLeft, IconArrowRight, IconCheckCircle, IconGithub } from '@posthog/icons'
+import { LemonButton, LemonSwitch, LemonTag, Link } from '@posthog/lemon-ui'
import { AuthorizedUrlList } from 'lib/components/AuthorizedUrlList/AuthorizedUrlList'
import { AuthorizedUrlListType } from 'lib/components/AuthorizedUrlList/authorizedUrlListLogic'
@@ -27,15 +27,15 @@ import {
import { type ContextOnboardingStepId, onboardingEventUsageLogic } from '../onboardingEventUsageLogic'
import { useWizardCommand } from '../shared/SetupWizardBanner'
import { availableOnboardingProducts, getProductIcon, toSentenceCase } from '../shared/utils'
+import { activeCloudRunLogic, type CloudRunHandle } from '../shared/wizard-sync/activeCloudRunLogic'
+import { installationProgressLogic } from '../shared/wizard-sync/installationProgressLogic'
+import { wizardCloudRunLogic } from '../shared/wizard-sync/wizardCloudRunLogic'
+import { WizardCommandBlock } from '../shared/wizard-sync/WizardCommandBlock'
+import { WizardInstallOptions } from '../shared/wizard-sync/WizardInstallOptions'
+import { WizardFrameworkBadges } from '../shared/wizard-sync/WizardModeShell'
import { ContextBillingStep } from './ContextBillingStep'
import { ContextInviteStep } from './ContextInviteStep'
import { ContextWarehouseStep } from './ContextWarehouseStep'
-import { activeCloudRunLogic, type CloudRunHandle } from './sdks/OnboardingInstallStep/activeCloudRunLogic'
-import { installationProgressLogic } from './sdks/OnboardingInstallStep/installationProgressLogic'
-import { WizardCloudRunBlock } from './sdks/OnboardingInstallStep/WizardCloudRunBlock'
-import { wizardCloudRunLogic } from './sdks/OnboardingInstallStep/wizardCloudRunLogic'
-import { WizardCommandBlock } from './sdks/OnboardingInstallStep/WizardCommandBlock'
-import { WizardFrameworkBadges } from './sdks/OnboardingInstallStep/WizardModeShell'
/**
* Context-first onboarding (prototype, legacy variant). A fixed linear flow, one thing per step,
@@ -61,30 +61,13 @@ function WelcomeStep(): JSX.Element {
)
}
-type InstallMode = 'cloud' | 'local'
-
-// One wizard, two ways to run it: have us run it and open a PR (the self-driving path), or run the
-// CLI yourself. A segmented control switches between them. The cloud path only exists behind
-// ONBOARDING_WIZARD_CLOUD_RUN on cloud/dev; elsewhere this collapses to just the local command.
-// hideHog keeps the compact onboarding card free of the wizard hedgehog.
+// One wizard, two ways to run it — the shared WizardInstallOptions owns the cloud/local switching;
+// this wraps it in the self-driving copy, framework badges, and manual-docs fallback.
function InstallOptions({ onContinue }: { onContinue: () => void }): JSX.Element {
const cloudRunEnabled = useFeatureFlag('ONBOARDING_WIZARD_CLOUD_RUN', 'test')
const { isCloudOrDev } = useWizardCommand()
- const { activeCloudRun } = useValues(activeCloudRunLogic)
- const { clearActiveCloudRun } = useActions(activeCloudRunLogic)
const { reportContextOnboardingInstallModeSelected } = useActions(onboardingEventUsageLogic)
- const [mode, setMode] = useState<InstallMode>('cloud')
const offerCloud = cloudRunEnabled && isCloudOrDev
- // GROW-95: once a cloud run is spawned you cannot also run it locally, so the local tab is blocked and
- // the view pins to the cloud run's progress until it is cleared (e.g. via the failure fallback below).
- const localBlocked = !!activeCloudRun
- const effectiveMode: InstallMode = localBlocked ? 'cloud' : mode
-
- // A failed cloud run's fallback: drop the dead run (unblocks local, clears its FAB) and switch to the command.
- const runItYourself = (): void => {
- clearActiveCloudRun()
- setMode('local')
- }
// Self-hosted: the wizard CLI / cloud run only target cloud + dev, so both wizard blocks render
// nothing. Show a real, actionable fallback instead of an empty step.
@@ -117,44 +100,16 @@ function InstallOptions({ onContinue }: { onContinue: () => void }): JSX.Element
</p>
)}
{/* Frameworks are the same whichever way the wizard runs, so the badges sit above the selector. */}
- {isCloudOrDev && (
- <div className="pb-2">
- <WizardFrameworkBadges />
- </div>
- )}
- {offerCloud && (
- <LemonSegmentedButton
- fullWidth
- value={effectiveMode}
- onChange={(value) => {
- reportContextOnboardingInstallModeSelected(value)
- setMode(value)
- }}
- options={[
- {
- value: 'cloud',
- label: 'Open a pull request',
- icon: <IconCloud />,
- 'data-attr': 'context-wizard-mode-cloud',
- },
- {
- value: 'local',
- label: 'Run it yourself',
- icon: <IconTerminal />,
- disabledReason: localBlocked ? 'A cloud run is in progress.' : undefined,
- 'data-attr': 'context-wizard-mode-local',
- },
- ]}
- />
- )}
- {/* No onQueued: unlike the legacy install step, this flow's footer Continue is always
- enabled (install is non-blocking), so a queued cloud run needs no extra unblock signal. */}
- {offerCloud && effectiveMode === 'cloud' ? (
- // GROW-96: kicking off the cloud run is the step's "next" action, so onQueued advances the flow.
- <WizardCloudRunBlock hideHog onRetryLocally={runItYourself} onQueued={onContinue} />
- ) : (
- <WizardCommandBlock hideHog />
- )}
+ <div className="pb-2">
+ <WizardFrameworkBadges />
+ </div>
+ {/* GROW-96: kicking off the cloud run is the step's "next" action, so onQueued advances the flow. */}
+ <WizardInstallOptions
+ hideHog
+ onQueued={onContinue}
+ onModeSelected={reportContextOnboardingInstallModeSelected}
+ localBlock={<WizardCommandBlock hideHog />}
+ />
<p className="text-xs text-muted m-0 text-center">
Rather wire it up by hand?{' '}
<Link to="https://posthog.com/docs/getting-started/install" target="_blank">
@@ -172,16 +127,8 @@ function InstallOptions({ onContinue }: { onContinue: () => void }): JSX.Element
function InstallStepWithSync({ onContinue }: { onContinue: () => void }): JSX.Element {
const isTakeoverActive = useWizardTakeoverActive()
const { activeCloudRun } = useValues(activeCloudRunLogic)
- const { setPanelMounted } = useActions(activeCloudRunLogic)
+ // The tracker claims the shared inline-panel flag itself, so no coordination is needed here.
const showLegacyTracker = isTakeoverActive && !activeCloudRun
- // While the inline legacy tracker shows a local run on this step, claim the shared inline-panel flag
- // so the detached WizardSyncFab hides and the run is not shown in two places.
- useEffect(() => {
- if (showLegacyTracker) {
- setPanelMounted(true)
- return () => setPanelMounted(false)
- }
- }, [showLegacyTracker, setPanelMounted])
return showLegacyTracker ? <WizardProgressTracker /> : <InstallOptions onContinue={onContinue} />
}
diff --git a/frontend/src/scenes/onboarding/shared/setupWizardStatusLogic.ts b/frontend/src/scenes/onboarding/shared/setupWizardStatusLogic.ts
index a9b0f2cd30e5..1de14c3d6026 100644
--- a/frontend/src/scenes/onboarding/shared/setupWizardStatusLogic.ts
+++ b/frontend/src/scenes/onboarding/shared/setupWizardStatusLogic.ts
@@ -2,13 +2,6 @@ import { actions, afterMount, connect, getContext, kea, path, reducers, selector
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
-import { wizardActiveSessionDetectorLogic } from 'scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardActiveSessionDetectorLogic'
-import { activeCloudRunLogic } from 'scenes/onboarding/self-driving/sdks/OnboardingInstallStep/activeCloudRunLogic'
-import {
- InstallationMode,
- InstallationProgress,
- installationProgressLogic,
-} from 'scenes/onboarding/self-driving/sdks/OnboardingInstallStep/installationProgressLogic'
import { teamLogic } from 'scenes/teamLogic'
import { isSharedView } from '~/exporter/exporterViewLogic'
@@ -17,6 +10,13 @@ import { tasksList, tasksRunsList } from 'products/tasks/frontend/generated/api'
import type { TaskRunDetailDTOApi } from 'products/tasks/frontend/generated/api.schemas'
import type { setupWizardStatusLogicType } from './setupWizardStatusLogicType'
+import { activeCloudRunLogic } from './wizard-sync/activeCloudRunLogic'
+import {
+ InstallationMode,
+ InstallationProgress,
+ installationProgressLogic,
+} from './wizard-sync/installationProgressLogic'
+import { wizardActiveSessionDetectorLogic } from './wizard-sync/wizardActiveSessionDetectorLogic'
export interface SetupPullRequest {
url: string
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/InstallationProgressView.stories.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/InstallationProgressView.stories.tsx
similarity index 100%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/InstallationProgressView.stories.tsx
rename to frontend/src/scenes/onboarding/shared/wizard-sync/InstallationProgressView.stories.tsx
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/InstallationProgressView.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/InstallationProgressView.tsx
similarity index 95%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/InstallationProgressView.tsx
rename to frontend/src/scenes/onboarding/shared/wizard-sync/InstallationProgressView.tsx
index 6c857384a7a6..e68607c11a5d 100644
--- a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/InstallationProgressView.tsx
+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/InstallationProgressView.tsx
@@ -65,7 +65,7 @@ export function InstallationProgressContent({
? "Review it whenever you like; we'll keep CI green in the meantime."
: phase === 'connecting'
? 'Getting things ready…'
- : 'Working on it — feel free to keep going.'
+ : 'Working on it. Feel free to keep going.'
return (
<div
@@ -77,7 +77,9 @@ export function InstallationProgressContent({
<h4 className={cn('font-semibold m-0', phase === 'error' && 'text-danger')}>{headline}</h4>
<p className="text-sm text-muted m-0">{subtitle}</p>
</div>
- {onDismiss && (
+ {/* Dismiss only once the run is settled — mid-run, hiding the only progress surface
+ (the FAB is suppressed while this panel is mounted) would orphan a live run. */}
+ {onDismiss && (phase === 'completed' || phase === 'error') && (
<LemonButton
size="small"
icon={<IconX />}
@@ -139,7 +141,7 @@ export function InstallationProgressContent({
{prUrl && (
<LemonButton type="primary" to={prUrl} targetBlank icon={<IconPullRequest />} center>
- Review pull request
+ Review PR
</LemonButton>
)}
</div>
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardCloudRunBlock.stories.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardCloudRunBlock.stories.tsx
similarity index 95%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardCloudRunBlock.stories.tsx
rename to frontend/src/scenes/onboarding/shared/wizard-sync/WizardCloudRunBlock.stories.tsx
index 4bb32bcb58df..e092f933f47c 100644
--- a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardCloudRunBlock.stories.tsx
+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardCloudRunBlock.stories.tsx
@@ -14,7 +14,7 @@ import { billingJson } from '~/mocks/fixtures/_billing'
import preflightJson from '~/mocks/fixtures/_preflight.json'
import { IntegrationType } from '~/types'
-import { onboardingLogic } from '../../../legacy/onboardingLogic'
+import { onboardingLogic } from '../../legacy/onboardingLogic'
import { activeCloudRunLogic } from './activeCloudRunLogic'
import { WizardCloudRunBlock } from './WizardCloudRunBlock'
import { wizardCloudRunLogic } from './wizardCloudRunLogic'
@@ -117,6 +117,10 @@ export default meta
type Story = StoryObj
+// The scene mounts asynchronously after navigation, so waits inside play functions need far more
+// than @testing-library's 1s default before CI can be trusted to have rendered the install step.
+const WAIT_OPTIONS = { timeout: 8000, interval: 200 }
+
// Click a footer/body button by its exact label, waiting for it to mount first.
async function clickButton(text: string): Promise<void> {
await waitFor(() => {
@@ -124,7 +128,7 @@ async function clickButton(text: string): Promise<void> {
if (!btn) {
throw new Error(`button "${text}" not ready`)
}
- })
+ }, WAIT_OPTIONS)
const btn = Array.from(document.querySelectorAll('button')).find((b) => b.textContent?.trim() === text)
await userEvent.click(btn as Element)
}
@@ -205,14 +209,14 @@ export const RepoPickerOpen: Story = cloudRunStory({
if (!document.querySelector('[data-attr="select-github-repository"] input')) {
throw new Error('repo picker not ready')
}
- })
+ }, WAIT_OPTIONS)
await userEvent.click(document.querySelector('[data-attr="select-github-repository"] input') as Element)
// full_name only appears in the open dropdown (nothing is selected), so this confirms it's open.
await waitFor(() => {
if (!Array.from(document.querySelectorAll('span')).some((el) => el.textContent === 'acme-co/mobile-app')) {
throw new Error('repo options not open')
}
- })
+ }, WAIT_OPTIONS)
},
})
@@ -255,11 +259,11 @@ export const RunItYourself: Story = cloudRunStory({
waitForSelector: '[data-attr="wizard-command-block"]',
extraPlay: async () => {
await waitFor(() => {
- if (!document.querySelector('[data-attr="context-wizard-mode-local"]')) {
+ if (!document.querySelector('[data-attr="wizard-mode-local"]')) {
throw new Error('install-mode toggle not ready')
}
- })
- await userEvent.click(document.querySelector('[data-attr="context-wizard-mode-local"]') as Element)
+ }, WAIT_OPTIONS)
+ await userEvent.click(document.querySelector('[data-attr="wizard-mode-local"]') as Element)
},
})
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardCloudRunBlock.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardCloudRunBlock.tsx
similarity index 97%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardCloudRunBlock.tsx
rename to frontend/src/scenes/onboarding/shared/wizard-sync/WizardCloudRunBlock.tsx
index 242126a6fc2c..f93059874d01 100644
--- a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardCloudRunBlock.tsx
+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardCloudRunBlock.tsx
@@ -38,6 +38,7 @@ export function WizardCloudRunBlock({
const { githubIntegration, selectedRepository, cloudRunStatus, connectGitHubUrl } = useValues(wizardCloudRunLogic)
const { activeCloudRun } = useValues(activeCloudRunLogic)
const { setSelectedRepository, startCloudRun } = useActions(wizardCloudRunLogic)
+ const { clearActiveCloudRun } = useActions(activeCloudRunLogic)
// Fire onQueued once per kickoff, the moment the run is handed off. It advances the install step
// (GROW-96), so it must not repeat while the status stays 'queued' (the callback identity changes
@@ -69,6 +70,7 @@ export function WizardCloudRunBlock({
runId={activeCloudRun.runId}
taskId={activeCloudRun.taskId}
onRetryLocally={onRetryLocally}
+ onDismiss={clearActiveCloudRun}
/>
)
}
@@ -105,7 +107,7 @@ export function WizardCloudRunBlock({
return (
<WizardModeShell hideHog={hideHog} data-attr="wizard-cloud-run-block">
<p className="text-sm text-muted mb-0">
- We'll run the wizard against your repo and open a pull request with the SDK installed and your context
+ We'll run the wizard against your repo and open a pull request with the SDK installed and events
flowing. Review it and merge whenever you're ready.
</p>
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardCommandBlock.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardCommandBlock.tsx
similarity index 100%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardCommandBlock.tsx
rename to frontend/src/scenes/onboarding/shared/wizard-sync/WizardCommandBlock.tsx
diff --git a/frontend/src/scenes/onboarding/shared/wizard-sync/WizardInstallOptions.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardInstallOptions.tsx
new file mode 100644
index 000000000000..618cc2c8d0fc
--- /dev/null
+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardInstallOptions.tsx
@@ -0,0 +1,103 @@
+import { useActions, useValues } from 'kea'
+import { useState } from 'react'
+
+import { IconCloud, IconTerminal } from '@posthog/icons'
+import { LemonSegmentedButton } from '@posthog/lemon-ui'
+
+import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
+
+import { useWizardCommand } from '../SetupWizardBanner'
+import { activeCloudRunLogic } from './activeCloudRunLogic'
+import { WizardCloudRunBlock } from './WizardCloudRunBlock'
+
+export type WizardInstallMode = 'cloud' | 'local'
+
+export interface WizardInstallOptionsProps {
+ /** The local "run it yourself" arm. Variants supply their own command block. */
+ localBlock: React.ReactNode
+ /** Keeps the compact onboarding card free of the wizard hedgehog. */
+ hideHog?: boolean
+ /** Called when a cloud run is queued (e.g. advance or unblock the step). */
+ onQueued?: () => void
+ /** Instrumentation hook, fired when the user switches between cloud and local. */
+ onModeSelected?: (mode: WizardInstallMode) => void
+}
+
+/**
+ * One wizard, two ways to run it: have us run it and open a PR (the cloud run), or run the CLI
+ * yourself. A segmented control switches between them. Shared by both onboarding variants; the
+ * cloud path only exists behind ONBOARDING_WIZARD_CLOUD_RUN (the AB test arm) on cloud/dev —
+ * elsewhere this collapses to just the caller's local block, so the control arm is unchanged.
+ */
+export function WizardInstallOptions({
+ localBlock,
+ hideHog = false,
+ onQueued,
+ onModeSelected,
+}: WizardInstallOptionsProps): JSX.Element {
+ const cloudRunEnabled = useFeatureFlag('ONBOARDING_WIZARD_CLOUD_RUN', 'test')
+ const { isCloudOrDev } = useWizardCommand()
+ const { activeCloudRun } = useValues(activeCloudRunLogic)
+ const { clearActiveCloudRun } = useActions(activeCloudRunLogic)
+ const [mode, setMode] = useState<WizardInstallMode>('cloud')
+
+ const offerCloud = cloudRunEnabled && isCloudOrDev
+ // GROW-95: once a cloud run is spawned you cannot also run it locally, so the local tab is blocked
+ // and the view pins to the cloud run's progress until it is cleared (e.g. via the failure fallback).
+ const localBlocked = !!activeCloudRun
+ const effectiveMode: WizardInstallMode = localBlocked ? 'cloud' : mode
+
+ // A failed cloud run's fallback: drop the dead run (unblocks local, clears its FAB) and switch to
+ // the command.
+ const runItYourself = (): void => {
+ clearActiveCloudRun()
+ setMode('local')
+ }
+
+ if (!offerCloud) {
+ // A persisted run outlives the experiment arm: keep rendering its progress (with the local
+ // fallback) even when the flag no longer offers new cloud runs, so nothing is stranded.
+ return activeCloudRun ? (
+ <WizardCloudRunBlock hideHog={hideHog} onRetryLocally={runItYourself} onQueued={onQueued} />
+ ) : (
+ <>{localBlock}</>
+ )
+ }
+
+ return (
+ <div className="flex flex-col gap-4">
+ <LemonSegmentedButton
+ fullWidth
+ value={effectiveMode}
+ onChange={(value) => {
+ // LemonSegmentedButton fires onChange on any option click, including the one
+ // already selected — only report actual switches.
+ if (value !== effectiveMode) {
+ onModeSelected?.(value)
+ }
+ setMode(value)
+ }}
+ options={[
+ {
+ value: 'cloud',
+ label: 'Open a pull request',
+ icon: <IconCloud />,
+ 'data-attr': 'wizard-mode-cloud',
+ },
+ {
+ value: 'local',
+ label: 'Run it yourself',
+ icon: <IconTerminal />,
+ disabledReason: localBlocked ? 'A cloud run is in progress.' : undefined,
+ 'data-attr': 'wizard-mode-local',
+ },
+ ]}
+ />
+ {effectiveMode === 'cloud' ? (
+ <WizardCloudRunBlock hideHog={hideHog} onRetryLocally={runItYourself} onQueued={onQueued} />
+ ) : (
+ localBlock
+ )}
+ </div>
+ )
+}
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardModeShell.scss b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardModeShell.scss
similarity index 100%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardModeShell.scss
rename to frontend/src/scenes/onboarding/shared/wizard-sync/WizardModeShell.scss
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardModeShell.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardModeShell.tsx
similarity index 79%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardModeShell.tsx
rename to frontend/src/scenes/onboarding/shared/wizard-sync/WizardModeShell.tsx
index 7290cc0b7313..140e0eb55cfe 100644
--- a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardModeShell.tsx
+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardModeShell.tsx
@@ -5,21 +5,21 @@ import type { ComponentType, ReactNode } from 'react'
import { cn } from 'lib/utils/css-classes'
import { WIZARD_HOG_URL } from 'scenes/onboarding/shared/wizardHog'
-import androidImage from '../../../legacy/sdks/logos/android.svg'
-import angularImage from '../../../legacy/sdks/logos/angular.svg'
-import { AstroLogo } from '../../../legacy/sdks/logos/AstroLogo'
-import djangoImage from '../../../legacy/sdks/logos/django.svg'
-import flaskImage from '../../../legacy/sdks/logos/flask.svg'
-import { IOSLogo } from '../../../legacy/sdks/logos/IOSLogo'
-import laravelImage from '../../../legacy/sdks/logos/laravel.svg'
-import nextjsImage from '../../../legacy/sdks/logos/nextjs.svg'
-import nuxtImage from '../../../legacy/sdks/logos/nuxt.svg'
-import pythonImage from '../../../legacy/sdks/logos/python.svg'
-import railsImage from '../../../legacy/sdks/logos/rails.svg'
-import reactImage from '../../../legacy/sdks/logos/react.svg'
-import { ReactRouterLogo } from '../../../legacy/sdks/logos/ReactRouterLogo'
-import svelteImage from '../../../legacy/sdks/logos/svelte.svg'
-import vueImage from '../../../legacy/sdks/logos/vue.svg'
+import androidImage from '../../legacy/sdks/logos/android.svg'
+import angularImage from '../../legacy/sdks/logos/angular.svg'
+import { AstroLogo } from '../../legacy/sdks/logos/AstroLogo'
+import djangoImage from '../../legacy/sdks/logos/django.svg'
+import flaskImage from '../../legacy/sdks/logos/flask.svg'
+import { IOSLogo } from '../../legacy/sdks/logos/IOSLogo'
+import laravelImage from '../../legacy/sdks/logos/laravel.svg'
+import nextjsImage from '../../legacy/sdks/logos/nextjs.svg'
+import nuxtImage from '../../legacy/sdks/logos/nuxt.svg'
+import pythonImage from '../../legacy/sdks/logos/python.svg'
+import railsImage from '../../legacy/sdks/logos/rails.svg'
+import reactImage from '../../legacy/sdks/logos/react.svg'
+import { ReactRouterLogo } from '../../legacy/sdks/logos/ReactRouterLogo'
+import svelteImage from '../../legacy/sdks/logos/svelte.svg'
+import vueImage from '../../legacy/sdks/logos/vue.svg'
// Frameworks the wizard can set up — the same whichever way it runs, so both modes show them.
const WIZARD_FRAMEWORKS: { name: string; icon: string | ComponentType }[] = [
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/WizardSyncCard.stories.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardSyncCard.stories.tsx
similarity index 98%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/WizardSyncCard.stories.tsx
rename to frontend/src/scenes/onboarding/shared/wizard-sync/WizardSyncCard.stories.tsx
index 8c31fd6d306c..417bb1b29b03 100644
--- a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/WizardSyncCard.stories.tsx
+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardSyncCard.stories.tsx
@@ -1,6 +1,6 @@
import { Meta, StoryObj } from '@storybook/react'
-import { InstallationProgress, InstallationStepStatus } from '../installationProgressLogic'
+import { InstallationProgress, InstallationStepStatus } from './installationProgressLogic'
import { WizardSyncCard, WizardSyncMode } from './WizardSyncCard'
/**
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/WizardSyncCard.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardSyncCard.tsx
similarity index 79%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/WizardSyncCard.tsx
rename to frontend/src/scenes/onboarding/shared/wizard-sync/WizardSyncCard.tsx
index d9cf4bb95c12..e393ea319c33 100644
--- a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/WizardSyncCard.tsx
+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardSyncCard.tsx
@@ -11,8 +11,8 @@ import { LemonButton, Spinner } from '@posthog/lemon-ui'
import { cn } from 'lib/utils/css-classes'
-import { InstallationProgress } from '../installationProgressLogic'
import { currentTaskLabel, formatElapsed, pipClass, stepCounts, syncHeadline, toneTextClass } from './helpers'
+import { InstallationProgress } from './installationProgressLogic'
export type WizardSyncMode = 'cloud' | 'local'
@@ -59,6 +59,7 @@ export function WizardSyncCard({
}): JSX.Element {
const { completed, total } = stepCounts(progress.steps)
const task = currentTaskLabel(progress)
+ const isRunning = progress.phase !== 'completed' && progress.phase !== 'error'
return (
<div
@@ -76,13 +77,18 @@ export function WizardSyncCard({
<div className="flex items-center gap-2.5">
<StatusGlyph progress={progress} />
<div className="flex-1 min-w-0">
- <p className={cn('m-0 text-sm font-semibold truncate', toneTextClass(progress))}>{task}</p>
+ <p
+ className={cn('m-0 text-sm font-semibold truncate', toneTextClass(progress))}
+ title={task ?? undefined}
+ >
+ {task}
+ </p>
<p className="m-0 text-xs text-muted truncate">{syncHeadline(progress)}</p>
</div>
<span className="text-xs text-muted tabular-nums shrink-0">{formatElapsed(elapsedSeconds)}</span>
</div>
- {total > 0 && (
+ {total > 0 ? (
<div className="flex items-center gap-2">
<div className="flex flex-1 items-center gap-1">
{progress.steps.map((step) => (
@@ -93,6 +99,18 @@ export function WizardSyncCard({
{completed}/{total}
</span>
</div>
+ ) : (
+ isRunning && (
+ // No step detail yet (connecting, or a polling-mode run where step
+ // notifications are stream-borne): an indeterminate strip keeps the card
+ // visibly alive instead of looking stalled.
+ <div
+ className="h-1 rounded-full bg-fill-highlight-100 overflow-hidden"
+ aria-label="Setup in progress"
+ >
+ <div className="h-full w-1/3 rounded-full bg-accent animate-pulse" />
+ </div>
+ )
)}
</button>
@@ -102,7 +120,8 @@ export function WizardSyncCard({
{progress.prUrl && (
<LemonButton
size="xsmall"
- type="secondary"
+ // The PR is the run's payoff: promote it once the run has finished.
+ type={progress.phase === 'completed' ? 'primary' : 'secondary'}
to={progress.prUrl}
targetBlank
icon={<IconPullRequest />}
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/WizardSyncDebugPanel.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardSyncDebugPanel.tsx
similarity index 100%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/WizardSyncDebugPanel.tsx
rename to frontend/src/scenes/onboarding/shared/wizard-sync/WizardSyncDebugPanel.tsx
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/WizardSyncFab.tsx b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardSyncFab.tsx
similarity index 76%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/WizardSyncFab.tsx
rename to frontend/src/scenes/onboarding/shared/wizard-sync/WizardSyncFab.tsx
index 35b4ebb23f9a..8fa5ea932452 100644
--- a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/WizardSyncFab.tsx
+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/WizardSyncFab.tsx
@@ -7,11 +7,12 @@ import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { cn } from 'lib/utils/css-classes'
import { elapsedSecondsFrom } from 'lib/utils/datetime'
-import { wizardActiveSessionDetectorLogic } from '../../../../legacy/sdks/OnboardingInstallStep/wizardActiveSessionDetectorLogic'
-import { activeCloudRunLogic, CloudRunHandle } from '../activeCloudRunLogic'
-import { InstallationProgress, installationProgressLogic } from '../installationProgressLogic'
-import { InstallationProgressContent } from '../InstallationProgressView'
+import { onboardingEventUsageLogic } from '../../onboardingEventUsageLogic'
+import { activeCloudRunLogic, CloudRunHandle } from './activeCloudRunLogic'
import { formatElapsed, syncHeadline, toneTextClass } from './helpers'
+import { InstallationProgress, installationProgressLogic } from './installationProgressLogic'
+import { InstallationProgressContent } from './InstallationProgressView'
+import { wizardActiveSessionDetectorLogic } from './wizardActiveSessionDetectorLogic'
import { StatusGlyph, WizardSyncCard, WizardSyncMode } from './WizardSyncCard'
import { wizardSyncUiLogic } from './wizardSyncUiLogic'
@@ -45,7 +46,16 @@ function WizardSyncLauncher({
onClick={onRestore}
aria-label="Show PostHog setup progress"
data-attr="wizard-sync-launcher"
- className="flex items-center gap-2 rounded-full bg-surface-primary border border-primary shadow-lg shadow-black/10 pl-2 pr-3 py-1.5 hover:bg-fill-highlight-50 transition-colors cursor-pointer"
+ className={cn(
+ 'flex items-center gap-2 rounded-full bg-surface-primary border shadow-lg shadow-black/10 pl-2 pr-3 py-1.5 hover:bg-fill-highlight-50 transition-colors cursor-pointer',
+ // A minimized run that finished (or failed) should read at a glance, not hide as a
+ // neutral pill.
+ progress.phase === 'completed'
+ ? 'border-success'
+ : progress.phase === 'error'
+ ? 'border-danger'
+ : 'border-primary'
+ )}
>
<StatusGlyph progress={progress} />
<span className="text-sm font-medium">PostHog setup</span>
@@ -108,12 +118,20 @@ function WizardSyncSurface({
}): JSX.Element {
const { dismissedKey, dialogOpen } = useValues(wizardSyncUiLogic)
const { dismiss, restore, openDialog, closeDialog } = useActions(wizardSyncUiLogic)
+ const {
+ reportWizardSyncExpanded,
+ reportWizardSyncMinimized,
+ reportWizardSyncRestored,
+ reportWizardSyncRunDismissed,
+ } = useActions(onboardingEventUsageLogic)
const now = useNow()
const elapsedSeconds = startedAt ? elapsedSecondsFrom(startedAt, now) : 0
const minimized = dismissedKey === runKey
+ const eventProps = { runKey, mode, phase: progress.phase }
// Clearing a finished run also closes the dialog before the surface unmounts.
const handleClear = onClear
? () => {
+ reportWizardSyncRunDismissed({ ...eventProps, elapsedSeconds })
closeDialog()
onClear()
}
@@ -123,14 +141,27 @@ function WizardSyncSurface({
<>
<div className={CORNER}>
{minimized ? (
- <WizardSyncLauncher progress={progress} elapsedSeconds={elapsedSeconds} onRestore={restore} />
+ <WizardSyncLauncher
+ progress={progress}
+ elapsedSeconds={elapsedSeconds}
+ onRestore={() => {
+ reportWizardSyncRestored(eventProps)
+ restore()
+ }}
+ />
) : (
<WizardSyncCard
progress={progress}
elapsedSeconds={elapsedSeconds}
mode={mode}
- onExpand={openDialog}
- onDismiss={() => dismiss(runKey)}
+ onExpand={() => {
+ reportWizardSyncExpanded(eventProps)
+ openDialog()
+ }}
+ onDismiss={() => {
+ reportWizardSyncMinimized(eventProps)
+ dismiss(runKey)
+ }}
/>
)}
</div>
@@ -197,7 +228,6 @@ function WizardSyncLocalGate(): JSX.Element | null {
* WizardProgressFab so there is one corner widget, never two.
*/
export function WizardSyncFab(): JSX.Element | null {
- const cloudEnabled = useFeatureFlag('ONBOARDING_WIZARD_CLOUD_RUN', 'test')
const syncEnabled = useFeatureFlag('ONBOARDING_WIZARD_SYNC', 'test')
const { activeCloudRun, panelMounted } = useValues(activeCloudRunLogic)
@@ -207,7 +237,10 @@ export function WizardSyncFab(): JSX.Element | null {
if (panelMounted) {
return null
}
- if (cloudEnabled && activeCloudRun) {
+ // Deliberately not gated on the cloud-run flag: a persisted handle is proof the run started
+ // while the user was on the test arm, and a mid-experiment flag change must not strand an
+ // in-flight run with no surface (and no way to dismiss it). Only STARTING runs is flag-gated.
+ if (activeCloudRun) {
return <WizardSyncCloudFab handle={activeCloudRun} />
}
if (syncEnabled) {
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/activeCloudRunLogic.test.ts b/frontend/src/scenes/onboarding/shared/wizard-sync/activeCloudRunLogic.test.ts
similarity index 100%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/activeCloudRunLogic.test.ts
rename to frontend/src/scenes/onboarding/shared/wizard-sync/activeCloudRunLogic.test.ts
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/activeCloudRunLogic.ts b/frontend/src/scenes/onboarding/shared/wizard-sync/activeCloudRunLogic.ts
similarity index 94%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/activeCloudRunLogic.ts
rename to frontend/src/scenes/onboarding/shared/wizard-sync/activeCloudRunLogic.ts
index 5e85b8b64741..3702e36137e4 100644
--- a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/activeCloudRunLogic.ts
+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/activeCloudRunLogic.ts
@@ -46,6 +46,8 @@ export const activeCloudRunLogic = kea<activeCloudRunLogicType>([
clearActiveCloudRun: true,
// Set by the inline install-step progress view while it's mounted, so the floating FAB hides
// and the two never render the same run at once (mirrors wizardProgressTrackerLogic.panelMounted).
+ // Last-writer-wins boolean, not a refcount: at most ONE inline view may be mounted at a time,
+ // or the first unmount un-hides the FAB while the second view is still on screen.
setPanelMounted: (mounted: boolean) => ({ mounted }),
}),
reducers({
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/helpers.ts b/frontend/src/scenes/onboarding/shared/wizard-sync/helpers.ts
similarity index 98%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/helpers.ts
rename to frontend/src/scenes/onboarding/shared/wizard-sync/helpers.ts
index 76de6566a165..6b334f12e8a2 100644
--- a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/helpers.ts
+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/helpers.ts
@@ -1,4 +1,4 @@
-import { InstallationProgress, InstallationStep, InstallationStepStatus } from '../installationProgressLogic'
+import { InstallationProgress, InstallationStep, InstallationStepStatus } from './installationProgressLogic'
// "m:ss", or "h:mm:ss" once a run passes the hour mark (cloud runs can be long).
export function formatElapsed(totalSeconds: number): string {
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/installationProgressLogic.test.ts b/frontend/src/scenes/onboarding/shared/wizard-sync/installationProgressLogic.test.ts
similarity index 100%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/installationProgressLogic.test.ts
rename to frontend/src/scenes/onboarding/shared/wizard-sync/installationProgressLogic.test.ts
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/installationProgressLogic.ts b/frontend/src/scenes/onboarding/shared/wizard-sync/installationProgressLogic.ts
similarity index 96%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/installationProgressLogic.ts
rename to frontend/src/scenes/onboarding/shared/wizard-sync/installationProgressLogic.ts
index 4cb8b1b5e076..ff8560e2836d 100644
--- a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/installationProgressLogic.ts
+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/installationProgressLogic.ts
@@ -231,6 +231,10 @@ export const installationProgressLogic = kea<installationProgressLogicType>([
// Once the cloud run is terminal there is nothing left for the session source to enrich, and
// it has no terminal state of its own to stop on — without this, an undismissed finished run
// keeps a session stream/poll alive app-wide until the user clicks "Dismiss this run".
+ // CAVEAT: wizardSessionStreamLogic connect/disconnect is NOT refcounted, and the keyed
+ // instance is shared — this disconnect also cuts the transport for any co-mounted consumer
+ // (e.g. the legacy wizardProgressTrackerLogic). Fine today because the run is terminal;
+ // refcount before adding consumers that must outlive a finishing cloud run.
taskRunStreamCompleted: () => {
if (props.mode === 'cloud') {
actions.disconnectSession()
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/taskRunStreamLogic.test.ts b/frontend/src/scenes/onboarding/shared/wizard-sync/taskRunStreamLogic.test.ts
similarity index 100%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/taskRunStreamLogic.test.ts
rename to frontend/src/scenes/onboarding/shared/wizard-sync/taskRunStreamLogic.test.ts
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/taskRunStreamLogic.ts b/frontend/src/scenes/onboarding/shared/wizard-sync/taskRunStreamLogic.ts
similarity index 99%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/taskRunStreamLogic.ts
rename to frontend/src/scenes/onboarding/shared/wizard-sync/taskRunStreamLogic.ts
index fc95d07c4f48..84e5ebfb07b1 100644
--- a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/taskRunStreamLogic.ts
+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/taskRunStreamLogic.ts
@@ -15,7 +15,7 @@ import { projectLogic } from 'scenes/projectLogic'
import { getTasksRunsStreamRetrieveUrl, tasksRunsRetrieve } from 'products/tasks/frontend/generated/api'
import type { TaskRunDetailDTOApi } from 'products/tasks/frontend/generated/api.schemas'
-import { onboardingEventUsageLogic } from '../../../onboardingEventUsageLogic'
+import { onboardingEventUsageLogic } from '../../onboardingEventUsageLogic'
import { activeCloudRunLogic } from './activeCloudRunLogic'
import type { taskRunStreamLogicType } from './taskRunStreamLogicType'
diff --git a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardActiveSessionDetectorLogic.test.ts b/frontend/src/scenes/onboarding/shared/wizard-sync/wizardActiveSessionDetectorLogic.test.ts
similarity index 100%
rename from frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardActiveSessionDetectorLogic.test.ts
rename to frontend/src/scenes/onboarding/shared/wizard-sync/wizardActiveSessionDetectorLogic.test.ts
diff --git a/frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardActiveSessionDetectorLogic.ts b/frontend/src/scenes/onboarding/shared/wizard-sync/wizardActiveSessionDetectorLogic.ts
similarity index 100%
rename from frontend/src/scenes/onboarding/legacy/sdks/OnboardingInstallStep/wizardActiveSessionDetectorLogic.ts
rename to frontend/src/scenes/onboarding/shared/wizard-sync/wizardActiveSessionDetectorLogic.ts
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/wizardCloudRunLogic.ts b/frontend/src/scenes/onboarding/shared/wizard-sync/wizardCloudRunLogic.ts
similarity index 93%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/wizardCloudRunLogic.ts
rename to frontend/src/scenes/onboarding/shared/wizard-sync/wizardCloudRunLogic.ts
index 3993cf94377f..8bb6644dfaf4 100644
--- a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/wizardCloudRunLogic.ts
+++ b/frontend/src/scenes/onboarding/shared/wizard-sync/wizardCloudRunLogic.ts
@@ -9,9 +9,9 @@ import { urls } from 'scenes/urls'
import { IntegrationType, OnboardingStepKey } from '~/types'
-import { onboardingLogic } from '../../../legacy/onboardingLogic'
-import { sdksLogic } from '../../../legacy/sdks/sdksLogic'
-import { onboardingEventUsageLogic } from '../../../onboardingEventUsageLogic'
+import { onboardingLogic } from '../../legacy/onboardingLogic'
+import { sdksLogic } from '../../legacy/sdks/sdksLogic'
+import { onboardingEventUsageLogic } from '../../onboardingEventUsageLogic'
import { activeCloudRunLogic } from './activeCloudRunLogic'
import type { wizardCloudRunLogicType } from './wizardCloudRunLogicType'
@@ -56,7 +56,7 @@ export const wizardCloudRunLogic = kea<wizardCloudRunLogicType>([
integrationsLogic,
['loadIntegrations'],
activeCloudRunLogic,
- ['setActiveCloudRun'],
+ ['setActiveCloudRun', 'clearActiveCloudRun'],
onboardingEventUsageLogic,
['reportContextOnboardingCloudRunQueued'],
],
@@ -81,6 +81,9 @@ export const wizardCloudRunLogic = kea<wizardCloudRunLogicType>([
startCloudRun: () => 'submitting',
startCloudRunSuccess: () => 'queued',
startCloudRunFailure: () => 'error',
+ // Dismissing the run (the FAB's dismiss or "Run it yourself") drops the handle, so a
+ // lingering 'queued' here would re-show the kickoff banner for a run that's gone.
+ clearActiveCloudRun: () => 'idle',
// Picking a different repo after a failure clears the error so the
// primary button is actionable again.
setSelectedRepository: (state) => (state === 'error' ? 'idle' : state),
diff --git a/frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/wizardSyncUiLogic.ts b/frontend/src/scenes/onboarding/shared/wizard-sync/wizardSyncUiLogic.ts
similarity index 100%
rename from frontend/src/scenes/onboarding/self-driving/sdks/OnboardingInstallStep/WizardSync/wizardSyncUiLogic.ts
rename to frontend/src/scenes/onboarding/shared/wizard-sync/wizardSyncUiLogic.ts