Brand onboarding flow + redirect gating (Vibe Kanban)#120
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 83af07f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
WalkthroughAdds a brand onboarding flow: a JSONB Sequence Diagram(s)sequenceDiagram
actor User
participant Page
participant UI
participant API
participant DB
User->>Page: Visit site
Page->>API: GET /api/brand/onboarding-status
API->>DB: Read user_metadata + brand_profile
DB-->>API: Return onboarding_progress & profile
API-->>Page: Return { tier, onboardingComplete }
alt onboardingComplete = false and tier = brand
Page->>UI: Open OnboardingModal
UI->>API: GET /api/brand/profile
API->>DB: Fetch brand profile
DB-->>API: Return profile
API-->>UI: Return profile data
User->>UI: Upload logo
UI->>API: POST /api/brand/upload-logo
API->>DB: Persist logo reference
DB-->>API: Confirm
User->>UI: Submit accent/mode/personality
UI->>API: PATCH /api/brand/update-profile (onboarding_completed=true)
API->>DB: Update profile & upsert onboarding_progress
DB-->>API: Confirm
API-->>UI: Return success
UI->>Page: Close modal / refresh state
else
Page->>UI: Render editor/playground normally
end
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Free ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (24)
✅ Files skipped from review due to trivial changes (5)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
…o an in-editor modal that opens the first time a **brand** user logs in (until they finish setup), with a subtle celebratory header. - Removed the `/onboarding` page and the redirect gating from `apps/app/src/app/page.tsx:32` and `apps/app/src/app/m/[itemId]/page.tsx:38`. - Added a gated modal `apps/app/src/components/onboarding/onboarding-modal.tsx:1` that loads existing brand profile (if any) and embeds the onboarding UI. - Wired the modal into the editor at `apps/app/src/app/(playground)/_components/playground-page.tsx:128` using `useOnboardingStatus` (still fires `brand_onboarding_completed` on submit). - Updated `apps/app/src/components/onboarding/onboarding-form.tsx:47` to support embedded/modal usage and call `onCompleted`. - Updated the changeset wording in `.changeset/bright-apes-cheer.md:1` to reflect “modal”, not a route. - Verified `pnpm -C apps/app typecheck` passes. Uncommitted changes are in your working tree (plus a new untracked file). If you want, I can commit + push these updates so PR #120 reflects the modal approach.
- Added brand-only onboarding screen at `apps/app/src/app/onboarding/page.tsx:26` + form UI at `apps/app/src/components/onboarding/onboarding-form.tsx:47` (logo upload, accent color, light/dark, personality).
- Saving now updates `BrandProfile` and marks onboarding complete in `UserMetadata.onboardingProgress` via `apps/app/src/app/api/brand/update-profile/route.ts:46` and fires `track("brand_onboarding_completed")` in `apps/app/src/components/onboarding/onboarding-form.tsx:127`.
- Brand users are redirected to `/onboarding` until complete from editor routes `apps/app/src/app/page.tsx:33` and `apps/app/src/app/m/[itemId]/page.tsx:1`; free users get blocked from `/onboarding` (`notFound()` in `apps/app/src/app/onboarding/page.tsx:26`).
- Added `BrandColorPalette.mode` to types in `apps/app/src/lib/types/brand.ts:23` and created `useOnboardingStatus` at `apps/app/src/hooks/use-onboarding-status.ts:12` backed by `apps/app/src/app/api/brand/onboarding-status/route.ts:24`.
- Added DB field + migration for onboarding progress: `apps/app/prisma/schema.prisma:112` and `apps/app/prisma/migrations/20260112123000_add_onboarding_progress/migration.sql:1` (run `pnpm -C apps/app db:dev` or `pnpm -C apps/app db:deploy` to apply).
- Verified `pnpm -C apps/app typecheck` passes; `pnpm -C apps/app lint` fails due to existing repo lint errors unrelated to this change.
…opeshot-app`) describing the new brand onboarding flow + onboarding gating/completion tracking.
…o an in-editor modal that opens the first time a **brand** user logs in (until they finish setup), with a subtle celebratory header. - Removed the `/onboarding` page and the redirect gating from `apps/app/src/app/page.tsx:32` and `apps/app/src/app/m/[itemId]/page.tsx:38`. - Added a gated modal `apps/app/src/components/onboarding/onboarding-modal.tsx:1` that loads existing brand profile (if any) and embeds the onboarding UI. - Wired the modal into the editor at `apps/app/src/app/(playground)/_components/playground-page.tsx:128` using `useOnboardingStatus` (still fires `brand_onboarding_completed` on submit). - Updated `apps/app/src/components/onboarding/onboarding-form.tsx:47` to support embedded/modal usage and call `onCompleted`. - Updated the changeset wording in `.changeset/bright-apes-cheer.md:1` to reflect “modal”, not a route. - Verified `pnpm -C apps/app typecheck` passes. Uncommitted changes are in your working tree (plus a new untracked file). If you want, I can commit + push these updates so PR #120 reflects the modal approach.
3023b58 to
935ae93
Compare
- Delete /brand and /m/[itemId]/brand route pages - Update SidebarTabs to use local state instead of URL routing - Remove showBrandExperience prop from PlaygroundPage - Move Save button to sticky footer in brand panel - Change Save button to secondary variant and right-align
- Add dropdown menu when brand logo exists but not applied - Show 'Apply brand logo' and 'Upload new' options - Fix logo upload to automatically apply to canvas - Show remove button on hover for all logo types - Update label from 'Choose file' to 'Add logo' - Track brand_logo_reapplied analytics event
What
/onboardingto capture 4 essentials: logo upload, accent color, light/dark mode, and product personality.BrandProfileand marked onboarding completion inUserMetadata.onboardingProgress./onboarding.modefield.Why
Brand-tier users need a fast (~30s) “post-upgrade” setup to ensure exports immediately reflect their brand (logo + accent + preferred light/dark styling + personality-driven defaults). Redirect gating ensures brand users complete setup before spending time in the editor and prevents “missing brand settings” surprises.
Implementation Details
apps/app/src/app/onboarding/page.tsxchecks auth and brand tier; non-brand requests getnotFound().apps/app/src/components/onboarding/onboarding-form.tsxreuses the existing logo upload endpoint (/api/brand/upload-logo), collects the remaining inputs, and submits to/api/brand/update-profile.track("brand_onboarding_completed")and redirects back to the editor.apps/app/src/app/api/brand/update-profile/route.tsis now brand-only and supportsaccent,mode, andonboarding_completed.BrandProfile.colorPalette(derived palette withmode,accent, and defaultbackground/text).UserMetadata.onboardingProgress.completedSteps = ["brand_profile"].apps/app/src/app/page.tsxandapps/app/src/app/m/[itemId]/page.tsxredirect brand users to/onboardinguntil complete.apps/app/src/app/api/brand/onboarding-status/route.tsreturns{ tier, onboardingComplete }.apps/app/src/hooks/use-onboarding-status.tswraps this for client usage.user_metadata.onboarding_progress(JSONB) viaapps/app/prisma/schema.prisma+ migrationapps/app/prisma/migrations/20260112123000_add_onboarding_progress/migration.sql.This PR was written using Vibe Kanban
Summary by CodeRabbit
New Features
Chores
Tests
✏️ Tip: You can customize this high-level summary in your review settings.