fix(onboarding): don't seed a demo flag into a project that has flags - #8217
Draft
talissoncosta wants to merge 1 commit into
Draft
fix(onboarding): don't seed a demo flag into a project that has flags#8217talissoncosta wants to merge 1 commit into
talissoncosta wants to merge 1 commit 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 |
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>
talissoncosta
force-pushed
the
fix/onboarding-skip-flag-creation-existing-project
branch
from
August 4, 2026 14:09
e165808 to
3f8c70c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ever onboarded. Features are project-level, so it showed up in every environment of that project including production, next to a newOnboardingtag. The Getting Started link inTopNavbar.tsxis ungated, so any customer could trigger it by clicking it.The rule now lives in
demoFlag.tsas two pure functions,findDemoFlagandshouldSeedDemoFlag, with unit tests. It was inline in an async orchestrator that nothing could test, and it is now customer-visible enough to be worth pinning. An empty project still gets the demo flag, an established one gets nothing, and a project that already ran the tour reuses its flag, matched by tag first since a rename is a delete and recreate.That leaves the tour with no flag to teach with, so the page says so and links to the project's own flags rather than walking someone through connecting a project that is already connected.
The copy and treatment of that state are provisional and the part worth reviewing. It currently reuses the same centred layout as the existing error state, and deliberately renders no header, since the header offers inline renames of the org and project, which is not something to put in front of a customer who wandered in.
Not in scope, both worth doing next:
isGettingStartedis set once at register (account-store.js:311), lives in memory, and is lost on refresh, which is why the nav link can't honour "keep it until the user completes onboarding".How did you test this code?
typecheckclean for the touched files (the onboarding errors that remain are the pre-existing missingstorybooktypes in story files, present on main)test:unit(394, including 6 new for the seeding rule) andlintcleanshouldSeedDemoFlagalways return true, watched the suite fail, revertedManual pass, both paths:
/getting-startedstill createsshow_demo_button, tags it, and the tour works end to endOnboardingtag appears, and the page shows the already-set-up state