Skip to content

Onboarding: header and connect panel#7801

Open
talissoncosta wants to merge 28 commits into
mainfrom
feat/onboarding-header-connect-7765
Open

Onboarding: header and connect panel#7801
talissoncosta wants to merge 28 commits into
mainfrom
feat/onboarding-header-connect-7765

Conversation

@talissoncosta

@talissoncosta talissoncosta commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • 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

Contributes to #7765 (Onboarding: header and connect panel).

Adds the single-page onboarding header + connect panel, gated behind the onboarding_quickstart_flow flag at /getting-started (flag off → today's Getting Started page, unchanged).

  • Header — welcome title + inline-editable organisation / project / flag chips; renames persist.
  • Connect panel — "Connect your code" (SDK selector + install/wire snippets) and "Connect with AI" (zero-auth prompt carrying the real env key + flag). Theme-adaptive code cards.
  • Resource bootstrap — idempotently reuse-or-create organisation / project / Dev + Prod / first flag.
  • Shared primitive — token-based Chip (used by the SDK selector), plus GhostInput clip/flicker fixes and a ChipInput dark-mode fix.

Follow-ups (not here): verify console + flags table (#7766);

How did you test this code?

  • Storybook (Pages/Onboarding/*, Components/Forms/*, Components/Data Display/Chip) in light + dark.
  • Manually at /getting-started with onboarding_quickstart_flow forced on: resources bootstrap, header chips rename, snippets/prompt carry the real env key + flag.
  • npm run lint + npm run typecheck clean on the changed files.

@vercel

vercel Bot commented Jun 16, 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, Comment Jun 22, 2026 5:49pm
flagsmith-frontend-staging Ready Ready Preview, Comment Jun 22, 2026 5:49pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jun 22, 2026 5:49pm

Request Review

@github-actions github-actions Bot added the front-end Issue related to the React Front End Dashboard label Jun 16, 2026
@talissoncosta talissoncosta force-pushed the feat/onboarding-header-connect-7765 branch from 16a6282 to 8af3fac Compare June 17, 2026 19:24
@talissoncosta talissoncosta marked this pull request as ready for review June 17, 2026 20:00
@talissoncosta talissoncosta requested a review from a team as a code owner June 17, 2026 20:00
@talissoncosta talissoncosta requested review from kyle-ssg and removed request for a team June 17, 2026 20:00
@talissoncosta talissoncosta requested review from Zaimwa9 and removed request for kyle-ssg June 17, 2026 20:00
talissoncosta and others added 22 commits June 22, 2026 14:16
Local tablist following the WAI-ARIA tabs pattern (roving tabindex,
Arrow/Home/End, aria-selected) with a right-alignable tab — deliberately
not the shared nav Tabs. Split into list, button and panel.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two tabs: an agent-agnostic 'Connect with AI' prompt and a 'Connect your
code' SDK selector. The SDK picker is an arrow-navigable radiogroup; logos
are per-file tree-shakeable components; code cards are theme-adaptive and
copy via a shared useCopyFeedback hook.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Gate /getting-started behind onboarding_quickstart_flow, idempotently
bootstrap org/project/envs/flag, persist inline renames, and render the
flow chromeless (App bypasses the Nav shell) with its own skip exit.
Handles the bootstrap error state and guards renames before the flag loads.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cover sanitizeFeatureName and orgNameFromEmail — the repo's Jest setup is
pure-function only, so hook-render tests are out of scope here.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add the folder + barrel convention (frontend/CLAUDE.md rule 8) and
Storybook stories for the onboarding components.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Copy button icon was fill='white' to show on the purple primary
button (Icon defaults to a dark fill). currentColor inherits the button's
text colour instead — no hardcoded colour, and it tracks the theme.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Icon defaults to fill='currentColor', so the copy icon inherits the
button's text colour on its own — no explicit fill needed (the earlier
'white' was also unnecessary).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rename the SdkLang / SdkSnippet / CodeCard props from hljs/hljsClass to
language, so the component API describes intent (a syntax language) rather
than leaking highlight.js as the implementation. Values ('bash',
'javascript', ...) are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move 'More' to the end of the first chip row and open the long tail as a
second row beneath it, so the toggle never moves — open/close happens
under the cursor, with a grid-rows transition (reduced-motion aware). The
overflow row stays mounted but inert while collapsed, so arrow-key nav and
screen readers skip it. Chip gains an aria-expanded prop for the disclosure.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Convey hierarchy with surface + elevation instead of borders: the panel
lifts off the canvas (surface-subtle + shadow-md, no border), and the code
cards / AI prompt sit as insets (surface-muted). Shadow tokens are
mode-aware, so it reads as a raised card in both light and dark.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The welcome-sentence values were built on the Chip pill, so they read as
form fields dropped into prose. Render them as inline text (GhostInput
inherits the sentence type) with a dashed-underline hint and a pencil that
surfaces on hover/focus. Renamed EditableChip -> InlineInput to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The flow is chromeless (no app nav to reach the theme setting), so add a
sun/moon toggle in a row above the header. Reuses project/darkMode
(flips live + persists) and the existing Button theme='icon'. Drops the
flow's now-redundant top padding so the toggle row sits flush.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
text-end only shifts inline content; use d-flex justify-content-end so the
skip button is reliably bottom-right, matching the theme-toggle row.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per review feedback: replace em/en dashes with hyphens across the
onboarding code, comments and stories. Skip CTA copy becomes 'Skip
onboarding, I'm a pro' with a trailing arrow, and the AI 'what happens
next' line uses a colon instead of a dash.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per review: the resting underline was a faint grey. Use the action/purple
colour (matching the accent chip variant) so it clearly reads as editable,
and go solid while editing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Node.js wire snippet came back empty: getSdkSnippet looked up INIT by
the display label ('Node.js'), but codeHelp keys it 'Node JS' (same for
Next.js: 'Next.js' vs 'Next.js (app router)'). Rename installKey ->
codeHelpKey and use it for both INIT and INSTALL lookups.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…oarding

Addresses the redundant-flag-creation blocker. The bootstrap always
assumed the default flag name and recreated it, so a renamed flag was
duplicated on revisit (and re-typing the shown default tripped the rename
error). ensureFlag now reads the project's flags and reuses the first
(returning its real name), creating the demo flag only when there are
none; the header shows the actual name, so the same-value rename is a
no-op. Persisting the flag id across a session is a follow-up.

Also splits the overloaded hook per review: the imperative reuse-or-create
orchestration moves into bootstrapOnboarding(store, {defaults, existingOrg})
with ensureOrganisation/ensureProject/ensureEnvironments/ensureFlag, and
useEnsureOnboardingResources just owns the React state + run-once guard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ate-feature modal

Give the inline header edits the variant-key editor's visual language: a
solid action underline and purple pencil, with the flag name as a soft-purple
accent pill so it reads as the hero value.

Sanitise the flag name as you type (spaces to underscores, lower-cased when the
project enforces it) and cap it at FEATURE_ID length, matching the
create-feature modal rather than only normalising on commit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Each inline rename now shows the new name optimistically, toasts on success,
and reverts with an error toast if the persist fails. Previously org and project
renames were silent fire-and-forget, and a failed flag rename had no success
counterpart.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A 4px top pad so the theme-toggle row isn't flush to the very edge.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop section-label comments that just restate self-describing selectors and
field names (the numbered-step badge, the npm/yarn pills, the SdkLang label).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The environment names were written on create and matched by name on reuse, so
a single source stops them drifting and silently breaking reuse. The org/project
fallback names move alongside. Kept local to the file - onboarding-internal
defaults, not global app constants.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The new single-page onboarding flow replaces the legacy getting-started page
that the Signup test drives, so the legacy create-org to integration to project
path doesn't exist when the flag is on (it's enabled in CI's Flagsmith env).
Skip the test in that case so it stops failing CI; the new flow needs its own
e2e coverage as a follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@Zaimwa9 Zaimwa9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's fix the codehelp for nextJs and address the feature renaming in a different PR

Then I also notice that:

  • The feature creation/update is kind of fragile (also my fault from navigating in and out so it's not blocking)
  • In the same vibe, once you have skipped and created the project, if you navigate back and update the name, it needs a refresh to be updated. Minor.

Also the single page onboarding E2E tests are skipped but we could have the follow up implementing basic coverage on this one quite soon. And it would help fixing the feature state management at the same time

popular: false,
},
{
codeHelpKey: 'Next.js',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Image

Sorry same issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Onboarding: header and connect panel

4 participants