fix: save onboarding answers

This commit is contained in:
Harshith Mullapudi 2025-09-08 19:12:48 +05:30
parent 6b165bfa7f
commit 35bb158089
7 changed files with 49 additions and 25 deletions

View File

@ -130,7 +130,7 @@ export default function OnboardingQuestionComponent({
</div>
)}
<div className="flex justify-between pt-4">
<div className="flex justify-end gap-2 pt-4">
{!isFirst && (
<Button
type="button"
@ -143,8 +143,6 @@ export default function OnboardingQuestionComponent({
</Button>
)}
<div className="flex-1" />
<Button
type="button"
variant="secondary"

View File

@ -83,19 +83,24 @@ export const ONBOARDING_QUESTIONS: OnboardingQuestion[] = [
value: "Power an AI assistant / agent with context",
},
{
id: "explore-graphs",
label: "Explore / learn about reified graphs",
value: "Explore / learn about reified graphs",
id: "explore-core",
label: "Explore core",
value: "Explore core",
},
],
required: true,
},
{
id: "tools",
title: "Which tools or data sources do you care about most?",
title: "Which tools do you care about most?",
description: "Context → lets you connect integration nodes live",
type: "multi-select",
options: [
{ id: "claude", label: "Claude", value: "Claude" },
{ id: "claude-code", label: "Claude Code", value: "Claude Code" },
{ id: "cursor", label: "Cursor", value: "Cursor" },
{ id: "windsurf", label: "Windsurf", value: "Windsurf" },
{ id: "zed", label: "Zed", value: "Zed" },
{ id: "github", label: "GitHub", value: "GitHub" },
{ id: "slack", label: "Slack", value: "Slack" },
{ id: "notion", label: "Notion", value: "Notion" },

View File

@ -6,6 +6,7 @@ import { useState } from "react";
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../ui/dialog";
import { Button } from "../ui";
import { useFetcher } from "@remix-run/react";
import { getTailwindColor, getTeamColor } from "../ui/color-utils";
interface SpacePatternCardProps {
pattern: SpacePattern;
@ -46,10 +47,22 @@ export function SpacePatternCard({ pattern }: SpacePatternCardProps) {
<div className={cn("truncate text-left")}>{displayText}</div>
</div>
<div className="text-muted-foreground flex shrink-0 items-center justify-end gap-2 text-xs">
<Badge variant="secondary" className="rounded text-xs">
<Badge
variant="secondary"
className="rounded text-xs"
style={{
color: getTailwindColor(pattern.type),
}}
>
{pattern.type}
</Badge>
<Badge variant="secondary" className="rounded text-xs">
<Badge
variant="secondary"
className="rounded text-xs"
style={{
color: getTailwindColor(pattern.name),
}}
>
{pattern.name}
</Badge>
</div>
@ -66,10 +79,22 @@ export function SpacePatternCard({ pattern }: SpacePatternCardProps) {
<div className="flex flex-col gap-2">
<div className="flex gap-2">
<Badge variant="secondary" className="rounded text-xs">
<Badge
variant="secondary"
className="rounded text-xs"
style={{
color: getTailwindColor(pattern.type),
}}
>
{pattern.type}
</Badge>
<Badge variant="secondary" className="rounded text-xs">
<Badge
variant="secondary"
className="rounded text-xs"
style={{
color: getTailwindColor(pattern.name),
}}
>
{pattern.name}
</Badge>
</div>

View File

@ -203,7 +203,8 @@ export function updateUser({
marketingEmails,
referralSource,
onboardingComplete,
}: Pick<User, "id" | "onboardingComplete"> & {
metadata,
}: Pick<User, "id" | "onboardingComplete" | "metadata"> & {
marketingEmails?: boolean;
referralSource?: string;
}) {
@ -214,6 +215,7 @@ export function updateUser({
referralSource,
confirmedBasicDetails: true,
onboardingComplete,
metadata: metadata ? metadata : {},
},
});
}

View File

@ -61,6 +61,9 @@ export async function action({ request }: ActionFunctionArgs) {
await updateUser({
id: userId,
onboardingComplete: true,
metadata: {
answers,
},
});
await addToQueue(

View File

@ -531,6 +531,8 @@ model User {
referralSource String?
metadata Json @default("{}")
personalAccessTokens PersonalAccessToken[]
InvitationCode InvitationCode? @relation(fields: [invitationCodeId], references: [id])
invitationCodeId String?

View File

@ -210,18 +210,6 @@ model InvitationCode {
createdAt DateTime @default(now())
}
model MCPSession {
id String @id @default(cuid())
source String
integrations String[]
workspace Workspace? @relation(references: [id], fields: [workspaceId])
workspaceId String?
createdAt DateTime @default(now())
deleted DateTime?
}
model OAuthAuthorizationCode {
id String @id @default(cuid())
@ -543,6 +531,8 @@ model User {
referralSource String?
metadata Json @default("{}")
personalAccessTokens PersonalAccessToken[]
InvitationCode InvitationCode? @relation(fields: [invitationCodeId], references: [id])
invitationCodeId String?
@ -638,7 +628,6 @@ model Workspace {
OAuthRefreshToken OAuthRefreshToken[]
RecallLog RecallLog[]
Space Space[]
MCPSession MCPSession[]
}
enum AuthenticationMethod {