Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat(onboarding): remove invite team members from org creation flow (#13640)

annabellscha4cfc91b82c0e
diff --git a/web/src/__e2e__/create-project.spec.ts b/web/src/__e2e__/create-project.spec.ts
index 931dd0f0fa..2a941c19a8 100644
--- a/web/src/__e2e__/create-project.spec.ts
+++ b/web/src/__e2e__/create-project.spec.ts
@@ -71,24 +71,12 @@ test.describe("Create project", () => {
await page.fill('[data-testid="new-org-name-input"]', "e2e test org");
await page.click('button[type="submit"]');
await expect(page).toHaveURL(
- /\/organization\/.*\/setup\?orgstep=invite-members/,
+ /\/organization\/.*\/setup\?orgstep=create-project/,
{
timeout: 15000,
},
);
- // Parse the organization ID from the URL using a simpler method
- const url = new URL(page.url());
- const organizationId = url.pathname.split("/")[2];
- console.log("organization", organizationId);
-
- // Skip add new members step
- await page.isVisible('[data-testid="btn-skip-add-members"]');
- await page.click('[data-testid="btn-skip-add-members"]');
- expect(page.url()).toContain(
- "/organization/" + organizationId + "/setup?orgstep=create-project",
- );
-
// Create project
await expect(page.locator("data-testid=new-project-form")).toBeVisible();
await page.fill(
diff --git a/web/src/components/layouts/container-page.tsx b/web/src/components/layouts/container-page.tsx
index 0c8084392f..c6d9a22162 100644
--- a/web/src/components/layouts/container-page.tsx
+++ b/web/src/components/layouts/container-page.tsx
@@ -21,7 +21,7 @@ const ContainerPage = ({ children, headerProps }: SettingsContainerProps) => {
</header>
<main
className={cn(
- "min-h-screen-with-banner relative flex flex-1 flex-col p-3",
+ "relative flex min-h-0 flex-1 flex-col p-3",
containerLayoutClassName,
)}
>
diff --git a/web/src/features/organizations/components/NewOrganizationForm.tsx b/web/src/features/organizations/components/NewOrganizationForm.tsx
index e639498b71..25b429f69f 100644
--- a/web/src/features/organizations/components/NewOrganizationForm.tsx
+++ b/web/src/features/organizations/components/NewOrganizationForm.tsx
@@ -1,5 +1,4 @@
import { Button } from "@/src/components/ui/button";
-import { useEffect } from "react";
import type * as z from "zod";
import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form";
@@ -10,22 +9,12 @@ import {
FormItem,
FormLabel,
FormMessage,
- FormDescription,
} from "@/src/components/ui/form";
import { Input } from "@/src/components/ui/input";
-import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from "@/src/components/ui/select";
import { api } from "@/src/utils/api";
import { useSession } from "next-auth/react";
import { organizationFormSchema } from "@/src/features/organizations/utils/organizationNameSchema";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
-import { SurveyName } from "@prisma/client";
-import { useLangfuseCloudRegion } from "@/src/features/organizations/hooks";
export const NewOrganizationForm = ({
onSuccess,
@@ -38,17 +27,12 @@ export const NewOrganizationForm = ({
resolver: zodResolver(organizationFormSchema),
defaultValues: {
name: "",
- type: "Personal",
- size: undefined,
},
});
const capture = usePostHogClientCapture();
const createOrgMutation = api.organizations.create.useMutation({
onError: (error) => form.setError("name", { message: error.message }),
});
- const createSurveyMutation = api.surveys.create.useMutation();
- const watchedType = form.watch("type");
- const { isLangfuseCloud } = useLangfuseCloudRegion();
function onSubmit(values: z.infer<typeof organizationFormSchema>) {
capture("organizations:new_form_submit");
@@ -57,27 +41,6 @@ export const NewOrganizationForm = ({
name: values.name,
})
.then(async (org) => {
- // Submit survey with organization data only on Cloud and if type is provided
- if (isLangfuseCloud && values.type) {
- const surveyResponse: Record<string, string> = {
- type: values.type,
- };
- if (values.size) {
- surveyResponse.size = values.size;
- }
-
- try {
- await createSurveyMutation.mutateAsync({
- surveyName: SurveyName.ORG_ONBOARDING,
- response: surveyResponse,
- orgId: org.id,
- });
- } catch (error) {
- console.error("Failed to submit survey:", error);
- // Continue with organization creation even if survey fails
- }
- }
-
// the setup (next step) resolves the current org from session state,
// so we refresh it, so that the UI doesn't render stale state.
// for example, it could otherwise show the v4 enable toggle.
@@ -90,13 +53,6 @@ export const NewOrganizationForm = ({
});
}
- // Clear size whenever type is not Company or Agency to avoid submitting hidden values
- useEffect(() => {
- if (watchedType !== "Company" && watchedType !== "Agency") {
- form.setValue("size", undefined);
- }
- }, [watchedType, form]);
-
return (
<Form {...form}>
<form
@@ -127,69 +83,6 @@ export const NewOrganizationForm = ({
</FormItem>
)}
/>
- {isLangfuseCloud && (
- <>
- <FormField
- control={form.control}
- name="type"
- render={({ field }) => (
- <FormItem>
- <FormLabel>Type</FormLabel>
- <FormDescription>
- What would best describe your organization?
- </FormDescription>
- <Select onValueChange={field.onChange} value={field.value}>
- <FormControl>
- <SelectTrigger ref={field.ref}>
- <SelectValue placeholder="Please choose" />
- </SelectTrigger>
- </FormControl>
- <SelectContent>
- <SelectItem value="Personal">Personal</SelectItem>
- <SelectItem value="Educational">Educational</SelectItem>
- <SelectItem value="Company">Company</SelectItem>
- <SelectItem value="Startup">Startup</SelectItem>
- <SelectItem value="Agency">Agency</SelectItem>
- <SelectItem value="N/A">N/A</SelectItem>
- </SelectContent>
- </Select>
- <FormMessage />
- </FormItem>
- )}
- />
- {(watchedType === "Company" || watchedType === "Agency") && (
- <FormField
- control={form.control}
- name="size"
- render={({ field }) => (
- <FormItem>
- <FormLabel>{watchedType} size</FormLabel>
- <FormDescription>
- How many people are in your {watchedType}?
- </FormDescription>
- <Select onValueChange={field.onChange} value={field.value}>
- <FormControl>
- <SelectTrigger ref={field.ref}>
- <SelectValue placeholder="Please choose" />
- </SelectTrigger>
- </FormControl>
- <SelectContent>
- <SelectItem value="1-10">1-10</SelectItem>
- <SelectItem value="10-49">10-49</SelectItem>
- <SelectItem value="50-99">50-99</SelectItem>
- <SelectItem value="100-299">100-299</SelectItem>
- <SelectItem value="More than 300">
- More than 300
- </SelectItem>
- </SelectContent>
- </Select>
- <FormMessage />
- </FormItem>
- )}
- />
- )}
- </>
- )}
<Button type="submit" loading={createOrgMutation.isPending}>
Create
</Button>
diff --git a/web/src/features/organizations/utils/organizationNameSchema.ts b/web/src/features/organizations/utils/organizationNameSchema.ts
index 289b62c36a..433677f495 100644
--- a/web/src/features/organizations/utils/organizationNameSchema.ts
+++ b/web/src/features/organizations/utils/organizationNameSchema.ts
@@ -1,52 +1,18 @@
import { StringNoHTML } from "@langfuse/shared";
import * as z from "zod";
-const organizationTypeOptions = [
- "Personal",
- "Educational",
- "Company",
- "Startup",
- "Agency",
- "N/A",
-] as const;
-
-const organizationSizeOptions = [
- "1-10",
- "10-49",
- "50-99",
- "100-299",
- "More than 300",
-] as const;
-
const organizationName = StringNoHTML.min(
3,
"Must have at least 3 characters",
).max(60, "Must have at most 60 characters");
-// Base schema for org creation, used for server-side validation too
-export const organizationNameSchema = z.object({
+export const organizationFormSchema = z.object({
name: organizationName,
});
+// Base schema for org creation, used for server-side validation too
+export const organizationNameSchema = organizationFormSchema;
+
export const organizationOptionalNameSchema = z.object({
name: organizationName.optional(),
});
-
-// Extended schema for client-side form validation including type and size,
-// which are posted separately as a survey response.
-export const organizationFormSchema = organizationNameSchema
- .extend({
- type: z.enum(organizationTypeOptions),
- size: z.enum(organizationSizeOptions).optional(),
- })
- .check((ctx) => {
- const { type, size } = ctx.value;
- if ((type === "Company" || type === "Agency") && !size) {
- ctx.issues.push({
- code: "custom",
- path: ["size"],
- input: ctx.value.size,
- message: "Please specify the size of your organization",
- });
- }
- });
diff --git a/web/src/features/projects/components/NewProjectForm.tsx b/web/src/features/projects/components/NewProjectForm.tsx
index eda8c8ec10..ec4993256a 100644
--- a/web/src/features/projects/components/NewProjectForm.tsx
+++ b/web/src/features/projects/components/NewProjectForm.tsx
@@ -12,7 +12,6 @@ import {
} from "@/src/components/ui/form";
import { Input } from "@/src/components/ui/input";
import { api } from "@/src/utils/api";
-import { useRouter } from "next/router";
import { useSession } from "next-auth/react";
import { projectNameSchema } from "@/src/features/auth/lib/projectNameSchema";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";
@@ -33,11 +32,9 @@ export const NewProjectForm = ({
name: "",
},
});
- const router = useRouter();
const createProjectMutation = api.projects.create.useMutation({
- onSuccess: (newProject) => {
+ onSuccess: () => {
void updateSession();
- void router.push(`/project/${newProject.id}/settings`);
},
onError: (error) => form.setError("name", { message: error.message }),
});
diff --git a/web/src/features/setup/components/SetupPage.tsx b/web/src/features/setup/components/SetupPage.tsx
index c55fb9abcf..56c08b8bab 100644
--- a/web/src/features/setup/components/SetupPage.tsx
+++ b/web/src/features/setup/components/SetupPage.tsx
@@ -7,39 +7,24 @@ import {
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/src/components/ui/breadcrumb";
-import { Button } from "@/src/components/ui/button";
import { Card } from "@/src/components/ui/card";
import { NewOrganizationForm } from "@/src/features/organizations/components/NewOrganizationForm";
import { NewProjectForm } from "@/src/features/projects/components/NewProjectForm";
import { useQueryProjectOrOrganization } from "@/src/features/projects/hooks";
-import { MembershipInvitesPage } from "@/src/features/rbac/components/MembershipInvitesPage";
-import { MembersTable } from "@/src/features/rbac/components/MembersTable";
-import {
- createProjectRoute,
- inviteMembersRoute,
-} from "@/src/features/setup/setupRoutes";
+import { createProjectRoute } from "@/src/features/setup/setupRoutes";
import { cn } from "@/src/utils/tailwind";
import { Check } from "lucide-react";
import { useRouter } from "next/router";
-import { StringParam, useQueryParam } from "use-query-params";
-// Multi-step setup process
+// Manual setup process
// 1. Create Organization: /setup
-// 2. Invite Members: /organization/:orgId/setup
-// 3. Create Project: /organization/:orgId/setup?step=create-project
+// 2. Create Project: /organization/:orgId/setup?orgstep=create-project
export function SetupPage() {
- const { project, organization } = useQueryProjectOrOrganization();
+ const { organization } = useQueryProjectOrOrganization();
const router = useRouter();
- const [orgStep] = useQueryParam("orgstep", StringParam); // "invite-members" | "create-project"
// starts at 1 to align with breadcrumb
- const stepInt = !organization
- ? 1
- : project
- ? 3
- : orgStep === "create-project"
- ? 3
- : 2;
+ const stepInt = organization ? 2 : 1;
return (
<ContainerPage
@@ -82,20 +67,7 @@ export function SetupPage() {
: "text-foreground font-semibold",
)}
>
- 2. Invite Members
- {stepInt > 2 && <Check className="ml-1 inline-block h-3 w-3" />}
- </BreadcrumbPage>
- </BreadcrumbItem>
- <BreadcrumbSeparator />
- <BreadcrumbItem>
- <BreadcrumbPage
- className={cn(
- stepInt !== 3
- ? "text-muted-foreground"
- : "text-foreground font-semibold",
- )}
- >
- 3. Create Project
+ 2. Create Project
</BreadcrumbPage>
</BreadcrumbItem>
</BreadcrumbList>
@@ -111,39 +83,21 @@ export function SetupPage() {
</p>
<NewOrganizationForm
onSuccess={(orgId) => {
- router.push(inviteMembersRoute(orgId));
+ router.push(createProjectRoute(orgId));
}}
/>
</div>
)
}
{
- // 2. Invite Members
+ // 2. Create Project
stepInt === 2 && organization && (
- <div className="flex flex-col gap-10">
- <div>
- <Header title="Organization Members" />
- <p className="text-muted-foreground mb-4 text-sm">
- Invite members to your organization to collaborate on
- projects. You can always add more members later.
- </p>
- <MembersTable orgId={organization.id} />
- </div>
- <div>
- <MembershipInvitesPage orgId={organization.id} />
- </div>
- </div>
- )
- }
- {
- // 3. Create Project
- stepInt === 3 && organization && (
<div>
<Header title="New Project" />
<p className="text-muted-foreground mb-4 text-sm">
Projects are used to group traces, datasets, evals and prompts.
- Multiple environments are best separated via tags within a
- project.
+ Environments can be separated using the built-in environment
+ feature.
</p>
<NewProjectForm
orgId={organization.id}
@@ -155,16 +109,6 @@ export function SetupPage() {
)
}
</Card>
-
- {stepInt === 2 && organization && (
- <Button
- className="mt-4 self-start"
- data-testid="btn-skip-add-members"
- onClick={() => router.push(createProjectRoute(organization.id))}
- >
- Next
- </Button>
- )}
</ContainerPage>
);
}
diff --git a/web/src/features/setup/setupRoutes.ts b/web/src/features/setup/setupRoutes.ts
index fa13e89480..1b55fc5f1e 100644
--- a/web/src/features/setup/setupRoutes.ts
+++ b/web/src/features/setup/setupRoutes.ts
@@ -3,8 +3,5 @@ export const createOrganizationRoute = "/setup";
export const createProjectRoute = (orgId: string) =>
`/organization/${orgId}/setup?orgstep=create-project`;
-export const inviteMembersRoute = (orgId: string) =>
- `/organization/${orgId}/setup?orgstep=invite-members`;
-
export const setupTracingRoute = (projectId: string) =>
`/project/${projectId}/traces/setup`;