Skip to content

fix(onboarding): don't seed a demo flag into a project that has flags - #8217

Draft
talissoncosta wants to merge 2 commits into
mainfrom
fix/onboarding-skip-flag-creation-existing-project
Draft

fix(onboarding): don't seed a demo flag into a project that has flags#8217
talissoncosta wants to merge 2 commits into
mainfrom
fix/onboarding-skip-flag-creation-existing-project

Conversation

@talissoncosta

@talissoncosta talissoncosta commented Aug 4, 2026

Copy link
Copy Markdown
Contributor
  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Visiting /getting-started created show_demo_button in 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 new Onboarding tag. The nav link is shown to everyone, so any customer could trigger it.

  • Seed only into a project with no flags. A project that already ran the tour still reuses its flag, matched by tag first, since renaming a flag deletes and recreates it.
  • The rule moved to demoFlag.ts as two pure functions with tests. It was inline in an async orchestrator that nothing could test.
  • With no flag to teach with, the page shows an "already set up" state linking to the project's own flags, and renders no header, since the header offers inline renames of the org and project.

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 (isGettingStarted is 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 shouldSeedDemoFlag to true fails the suite

  • test:unit (414), typecheck and lint clean

  • New account: seeds the flag, tags it, tour works end to end

  • Project with flags: nothing created, no Onboarding tag, already-set-up state shown

  • Project that already has the demo flag: reused, not duplicated

  • Empty project on an established account: still seeded

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview Aug 6, 2026 1:54am
flagsmith-frontend-staging Ready Ready Preview Aug 6, 2026 1:54am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Aug 6, 2026 1:54am

Request Review

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b4e663bb-f74f-4b71-aaeb-ba96453c6f10

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between fb78687 and 3f8c70c.

📒 Files selected for processing (7)
  • frontend/web/components/pages/onboarding/OnboardingFlow/OnboardingFlow.tsx
  • frontend/web/components/pages/onboarding/hooks/__tests__/demoFlag.test.ts
  • frontend/web/components/pages/onboarding/hooks/bootstrapOnboarding.ts
  • frontend/web/components/pages/onboarding/hooks/demoFlag.ts
  • frontend/web/components/pages/onboarding/hooks/useEnsureOnboardingResources.ts
  • frontend/web/components/pages/onboarding/onboarding-already-set-up/OnboardingAlreadySetUp.tsx
  • frontend/web/components/pages/onboarding/onboarding-already-set-up/index.ts

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3a496c3 and 1b1d836.

📒 Files selected for processing (5)
  • frontend/web/components/pages/onboarding/OnboardingFlow/OnboardingFlow.tsx
  • frontend/web/components/pages/onboarding/hooks/__tests__/demoFlag.test.ts
  • frontend/web/components/pages/onboarding/hooks/bootstrapOnboarding.ts
  • frontend/web/components/pages/onboarding/hooks/demoFlag.ts
  • frontend/web/components/pages/onboarding/hooks/useEnsureOnboardingResources.ts

@github-actions github-actions Bot added the fix label Aug 5, 2026
talissoncosta and others added 2 commits August 5, 2026 22:36
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant