fix(onboarding): don't seed a demo flag into a project that has flags - #8217
fix(onboarding): don't seed a demo flag into a project that has flags#8217talissoncosta wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
e165808 to
3f8c70c
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 687db188-e702-4cea-8a87-bdf2abececc2
📒 Files selected for processing (7)
frontend/web/components/pages/onboarding/OnboardingFlow/OnboardingFlow.tsxfrontend/web/components/pages/onboarding/hooks/__tests__/demoFlag.test.tsfrontend/web/components/pages/onboarding/hooks/bootstrapOnboarding.tsfrontend/web/components/pages/onboarding/hooks/demoFlag.tsfrontend/web/components/pages/onboarding/hooks/useEnsureOnboardingResources.tsfrontend/web/components/pages/onboarding/onboarding-already-set-up/OnboardingAlreadySetUp.tsxfrontend/web/components/pages/onboarding/onboarding-already-set-up/index.ts
3f8c70c to
e66002b
Compare
e66002b to
1b1d836
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: f2bc4afd-cc1d-4693-947a-0bd91c472a61
📒 Files selected for processing (5)
frontend/web/components/pages/onboarding/OnboardingFlow/OnboardingFlow.tsxfrontend/web/components/pages/onboarding/hooks/__tests__/demoFlag.test.tsfrontend/web/components/pages/onboarding/hooks/bootstrapOnboarding.tsfrontend/web/components/pages/onboarding/hooks/demoFlag.tsfrontend/web/components/pages/onboarding/hooks/useEnsureOnboardingResources.ts
1b1d836 to
44b9d75
Compare
Visiting /getting-started created show_demo_button in whichever project came back first, whether or not the customer had ever onboarded. Features are project-level, so it appeared in every environment of that project, including production, alongside a new Onboarding tag. The Getting Started nav link is ungated, so any customer could trigger this by clicking it. ensureFlag already computed isFirstFeature for analytics; it now also decides whether to create anything. An empty project still gets the demo flag, an established one gets nothing. That leaves the tour with no flag to teach with, so the page says so and points at the project's own flags instead of walking someone through connecting a project that is already connected. Copy and treatment of that state are provisional. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
bootstrapOnboarding and createOrganisationViaAccountStore are plain functions, so hooks/ described three of its nine files wrongly. Both belong to the provisioning that runs before the tour, which is what the new bootstrap/ folder holds. Paths and one comment only; no logic changes.
44b9d75 to
8c41def
Compare
docs/if required so people know about the feature.Changes
Visiting
/getting-startedcreatedshow_demo_buttonin whichever project came back first, whether or not the customer had onboarded. Features are project-level, so it appeared in every environment of that project including production, next to a newOnboardingtag. The nav link is shown to everyone, so any customer could trigger it.demoFlag.tsas two pure functions with tests. It was inline in an async orchestrator that nothing could test.Copy of that state is provisional.
Still open: creation happens on page load rather than on an explicit action, and there's no persisted "has onboarded" state (
isGettingStartedis set at register, in memory, lost on refresh).How did you test this code?
6 unit tests on the seeding rule, checked by mutation: forcing
shouldSeedDemoFlagto true fails the suitetest:unit(414),typecheckandlintcleanNew account: seeds the flag, tags it, tour works end to end
Project with flags: nothing created, no
Onboardingtag, already-set-up state shownProject that already has the demo flag: reused, not duplicated
Empty project on an established account: still seeded