-
Notifications
You must be signed in to change notification settings - Fork 19
feat(onboarding): one progress model across the setup sequence (chat#1889 item 1, part 3) #1891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,12 @@ | ||
| import { redirect } from "next/navigation"; | ||
| import SetupEntry from "@/components/Onboarding/SetupEntry"; | ||
|
|
||
| /** | ||
| * `/setup` — the welcome email's "Confirm your roster" CTA target. Sends the | ||
| * user straight into the interactive setup flow at the first step (roster). | ||
| * `/setup` — the welcome email's "Confirm your roster" CTA target, and the | ||
| * route the authenticated home forwards an incomplete account to. Opens the | ||
| * sequence at the account's DERIVED step rather than assuming step 1 | ||
| * (chat#1889); the derived-step resolution needs client state, so the page | ||
| * mounts `SetupEntry`. | ||
| */ | ||
| export default function SetupPage() { | ||
| redirect("/setup/artists"); | ||
| return <SetupEntry />; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,16 @@ | ||
| "use client"; | ||
|
|
||
| import { useMiniKit } from "@coinbase/onchainkit/minikit"; | ||
| import { useRouter } from "next/navigation"; | ||
| import NewChatBootstrap from "../VercelChat/NewChatBootstrap"; | ||
| import OnboardingChecklist from "@/components/Onboarding/OnboardingChecklist"; | ||
| import OnboardingSequence from "@/components/Onboarding/OnboardingSequence"; | ||
| import { useOnboardingGate } from "@/hooks/useOnboardingGate"; | ||
| import { useEffect } from "react"; | ||
| import { UIMessage } from "ai"; | ||
|
|
||
| const HomePage = ({ initialMessages }: { initialMessages?: UIMessage[] }) => { | ||
| const { setFrameReady, isFrameReady } = useMiniKit(); | ||
| const router = useRouter(); | ||
| const onboarding = useOnboardingGate(); | ||
|
|
||
| useEffect(() => { | ||
|
|
@@ -18,21 +19,20 @@ const HomePage = ({ initialMessages }: { initialMessages?: UIMessage[] }) => { | |
| } | ||
| }, [setFrameReady, isFrameReady]); | ||
|
|
||
| // Incomplete accounts resume the sequence at their derived step on every | ||
| // landing; skip drops to the app with the checklist pinned as a persistent | ||
| // reminder; activated accounts only ever see the normal home | ||
| // (recoupable/chat#1867). | ||
| if (onboarding.view === "sequence" && onboarding.step !== "complete") { | ||
| return ( | ||
| <div className="flex flex-col size-full items-center"> | ||
| <OnboardingSequence | ||
| step={onboarding.step} | ||
| checkpoints={onboarding.checkpoints} | ||
| onSkip={onboarding.skip} | ||
| /> | ||
| </div> | ||
| ); | ||
| } | ||
| // One canonical onboarding surface (chat#1889): an incomplete account is | ||
| // forwarded into `/setup`, which opens at its derived step. Home used to host | ||
| // a second, card-based sequence that only linked out to the generic app pages, | ||
| // so a direct signup never saw the interactive steps the welcome email's | ||
| // `/setup/*` links reach. Skip still drops to the app with the checklist | ||
| // pinned (the gate stays soft — see SetupSkipLink). | ||
| const shouldEnterSetup = | ||
| onboarding.view === "sequence" && onboarding.step !== "complete"; | ||
|
|
||
| useEffect(() => { | ||
| if (shouldEnterSetup) { | ||
| router.replace("/setup"); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Incomplete accounts now mount the chat during the redirect window, so they can provision a recoup-api chat session/sandbox even though they are immediately sent to setup. Render a loading/empty setup-transition state while Prompt for AI agents |
||
| } | ||
|
Comment on lines
+31
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For every authenticated account whose onboarding is incomplete, this effect redirects only after Useful? React with 👍 / 👎. |
||
| }, [shouldEnterSetup, router]); | ||
|
|
||
| return ( | ||
| <div className="relative flex flex-col size-full items-center"> | ||
|
|
||
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: When an incomplete account lands on
/, the app home now flashes briefly before redirecting to/setup. The old synchronous conditional return rendered the onboarding sequence inline, so there was no flash. The newuseEffect-based redirect means the full home UI (chat bootstrap, empty content area) is painted at least once before the post-render effect fires. Consider restoring a synchronous guard — even a minimal loading shell returned early whileisReadyis false would eliminate the flash while keeping the redirect architecture intact.Prompt for AI agents