fix(onboarding): don't create or change flags in a project already in use - #8217
fix(onboarding): don't create or change flags in a project already in use#8217talissoncosta wants to merge 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe onboarding bootstrap now detects shared demo flags and onboarding tags. It seeds flags only in empty projects and resumes only eligible existing demo flags. It reports Estimated code review effort: 3 (Moderate) | ~20 minutes 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
886d205 to
1026eee
Compare
1026eee to
cfc431a
Compare
cfc431a to
f734d12
Compare
The flow adopted any flag it recognised, wherever it lived. The tag lookup matched on label alone, so a customer's own tag labelled Onboarding picked up one of their flags, and a recognised flag was toured even in a project full of their own work. The tour then offers a toggle that writes a feature state, and a rename that is a create plus a delete. The new flag carries only name, description, project, tags and type, so the environment values, segment overrides, identity overrides and variations stay behind on the deleted one, and an SDK reading by name starts getting defaults. Match the tag on its description too, and carry on only while our flag is the only one in the project. One flag is what a mid-tour refresh finds, so a run in progress still resumes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The connection hook runs before the already-set-up early return, so that screen polled onboarding-status every 5s for a first evaluation it never waits on. Pass an empty key, which the hook already skips. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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: 8cf1523c-72e9-4795-9f8e-fede8acff1c4
📒 Files selected for processing (6)
frontend/web/components/pages/onboarding/OnboardingFlow/OnboardingFlow.tsxfrontend/web/components/pages/onboarding/bootstrap/__tests__/demoFlag.test.tsfrontend/web/components/pages/onboarding/bootstrap/bootstrapOnboarding.tsfrontend/web/components/pages/onboarding/bootstrap/createOrganisationViaAccountStore.tsfrontend/web/components/pages/onboarding/bootstrap/demoFlag.tsfrontend/web/components/pages/onboarding/hooks/useEnsureOnboardingResources.ts
f734d12 to
e85a053
Compare
The lookup ends in .unwrap(), and unlike ensureOnboardingTag it wasn't guarded, so a transient tags request rejected ensureFlag and dropped the user on the "we couldn't set up your workspace" screen. Treat it as optional: without the tag we still match our flag by name. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
docs/if required so people know about the feature.Changes
Visiting
/getting-startedwrote into projects it had no business touching.show_demo_buttoninto whichever project the API returned first. Now only into a project with no flags.Onboarding, including a customer's own, then offered a toggle and a rename that deletes and recreates it. Now the tag has to match our description, and the tour continues only while our flag is the only one in the project.onboarding-statusevery 5s on the already-set-up screen, which waits for nothing. Now it doesn't.Still open: creation happens on page load, the project is still the first one returned, and nothing persists that a user has onboarded.
How did you test this code?
test:unit(404) andlintclean, no typecheck errors in the touched filesOnboardingtag, already-set-up state shownOnboardingthemselves: not adopted