Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chore(onboarding): Remove onboarding and welcome route (#3650)

dev-rb2c0393b60bc6
diff --git a/js/app/packages/app/component/Root.tsx b/js/app/packages/app/component/Root.tsx
index 944a77bf1b..d355fbeebc 100644
--- a/js/app/packages/app/component/Root.tsx
+++ b/js/app/packages/app/component/Root.tsx
@@ -1,11 +1,19 @@
+import {
+ AnalyticsContextProvider,
+ useAnalytics,
+} from '@app/component/analytics-context';
import { DEFAULT_ROUTE } from '@app/constants/defaultRoute';
import { ROUTER_BASE } from '@app/constants/routerBase';
+import { PosthogProvider, usePosthog } from '@app/lib/analytics/posthog';
import { setHotkeyRoot } from '@app/signal/hotkeyRoot';
import { globalSplitManager } from '@app/signal/splitLayout';
+import { CallProvider } from '@channel/Call/CallContext';
+import { CallStartedNotifier } from '@channel/Call/CallStartedNotifier';
import { ChatAttachmentsInit } from '@core/component/AI/signal/globalAttachments';
import { toast } from '@core/component/Toast/Toast';
import { ToastRegion } from '@core/component/Toast/ToastRegion';
import { ChannelsContextProvider } from '@core/context/channels';
+import { QuickAccessProvider } from '@core/context/quickAccess';
import {
UserContextProvider,
useUserId,
@@ -54,13 +62,13 @@ import {
type RouterProps,
useSearchParams,
} from '@solidjs/router';
+import { Button } from '@ui';
import { useHotKeyRoot } from 'core/hotkey/hotkeys';
import { detect } from 'detect-browser';
import {
createEffect,
createSignal,
type JSX,
- lazy,
Match,
on,
onCleanup,
@@ -88,26 +96,6 @@ import { ReactiveFavicon } from './ReactiveFavicon';
import { LAYOUT_ROUTE } from './split-layout/SplitLayoutRoute';
import { TeamInviteAcceptance } from './TeamInviteAcceptance';
-const NewOnboarding = lazy(() => import('./onboarding/onboarding'));
-const OldOnboarding = lazy(
- () => import('./interactive-onboarding/InteractiveOnboarding')
-);
-
-import {
- AnalyticsContextProvider,
- useAnalytics,
-} from '@app/component/analytics-context';
-import {
- PosthogProvider,
- ShowFeatureFlag,
- usePosthog,
-} from '@app/lib/analytics/posthog';
-import { CallProvider } from '@channel/Call/CallContext';
-import { CallStartedNotifier } from '@channel/Call/CallStartedNotifier';
-import { ENABLE_NEW_ONBOARDING_OVERRIDE } from '@core/constant/featureFlags';
-import { QuickAccessProvider } from '@core/context/quickAccess';
-import { Button } from '@ui';
-
/** Syncs login cookie with auth state. Only updates on successful query (not errors/loading). */
function useSyncLoginCookie() {
const userInfoQuery = useUserInfoQuery();
@@ -355,17 +343,7 @@ const ROUTES: RouteDefinition[] = [
},
{
path: '/welcome',
- component: () => (
- <div class="flex *:flex-1 size-full overflow-y-hidden">
- <ShowFeatureFlag
- key="enable-new-onboarding"
- enabledOverride={ENABLE_NEW_ONBOARDING_OVERRIDE}
- fallback={<OldOnboarding />}
- >
- <NewOnboarding />
- </ShowFeatureFlag>
- </div>
- ),
+ component: () => <Navigate href="/login" />,
},
{
path: '/team-invite',
diff --git a/js/app/packages/app/component/onboarding/onboarding-context.tsx b/js/app/packages/app/component/onboarding/onboarding-context.tsx
deleted file mode 100644
index c03d57ac76..0000000000
--- a/js/app/packages/app/component/onboarding/onboarding-context.tsx
+++ /dev/null
@@ -1,156 +0,0 @@
-import type { PaidPlanTier, PlanTier } from '@app/component/paywall/plans';
-import { PLANS } from '@app/component/paywall/plans';
-import {
- createContext,
- createMemo,
- createSignal,
- type ParentProps,
- useContext,
-} from 'solid-js';
-import { createStore, type SetStoreFunction } from 'solid-js/store';
-
-export interface InvitedMember {
- email: string;
- tier: PaidPlanTier;
-}
-
-export type StepStatus = 'pending' | 'completed' | 'skipped';
-
-export interface StepState {
- id: string;
- label: string;
- status: StepStatus;
-}
-
-export interface OnboardingContextValue {
- firstName: () => string;
- setFirstName: (v: string) => void;
- lastName: () => string;
- setLastName: (v: string) => void;
- email: () => string;
- setEmail: (v: string) => void;
- teamName: () => string;
- setTeamName: (v: string) => void;
- selectedPlan: () => PlanTier | null;
- setSelectedPlan: (tier: PlanTier | null) => void;
- invitedMembers: () => InvitedMember[];
- setInvitedMembers: (members: InvitedMember[]) => void;
- userSeatCost: () => number;
- teamSeatsCost: () => number;
- totalCost: () => number;
- seatCount: () => number;
- step: () => number;
- setStep: (step: number) => void;
- next: () => void;
- back: () => void;
- steps: StepState[];
- setSteps: SetStoreFunction<StepState[]>;
- skipStep: (id: string) => void;
- completeStep: (id: string) => void;
- isStepSkipped: (id: string) => boolean;
-}
-
-const OnboardingContext = createContext<OnboardingContextValue>();
-
-export function OnboardingProvider(
- props: ParentProps & {
- steps: Array<{ id: string; label: string }>;
- }
-) {
- const [firstName, setFirstName] = createSignal('');
- const [lastName, setLastName] = createSignal('');
- const [email, setEmail] = createSignal('');
- const [teamName, setTeamName] = createSignal('');
- const [selectedPlan, setSelectedPlan] = createSignal<PlanTier | null>(null);
- const [invitedMembers, setInvitedMembers] = createSignal<InvitedMember[]>([]);
- const [step, setStep] = createSignal(0);
-
- const [steps, setSteps] = createStore<StepState[]>(
- props.steps.map((s) => ({ id: s.id, label: s.label, status: 'pending' }))
- );
-
- const userSeatCost = createMemo(() => {
- const tier = selectedPlan();
- if (!tier) return 0;
- const plan = PLANS.find((p) => p.tier === tier);
- return plan?.price ?? 0;
- });
-
- const teamSeatsCost = createMemo(() =>
- invitedMembers().reduce((total, member) => {
- const plan = PLANS.find((p) => p.tier === member.tier);
- return total + (plan?.price ?? 0);
- }, 0)
- );
-
- const totalCost = () => userSeatCost() + teamSeatsCost();
- const seatCount = () => 1 + invitedMembers().length;
-
- const isStepSkipped = (id: string) =>
- steps.find((s) => s.id === id)?.status === 'skipped';
-
- const next = () =>
- setStep((s) => {
- let n = s + 1;
- while (n < steps.length && steps[n]?.status === 'skipped') n++;
- return Math.min(n, steps.length - 1);
- });
-
- const back = () =>
- setStep((s) => {
- let n = s - 1;
- while (n > 0 && steps[n]?.status === 'skipped') n--;
- return Math.max(n, 0);
- });
-
- const skipStep = (id: string) => {
- const idx = steps.findIndex((s) => s.id === id);
- if (idx !== -1) setSteps(idx, 'status', 'skipped');
- };
-
- const completeStep = (id: string) => {
- const idx = steps.findIndex((s) => s.id === id);
- if (idx !== -1) setSteps(idx, 'status', 'completed');
- };
-
- const value: OnboardingContextValue = {
- firstName,
- setFirstName,
- lastName,
- setLastName,
- email,
- setEmail,
- teamName,
- setTeamName,
- selectedPlan,
- setSelectedPlan,
- invitedMembers,
- setInvitedMembers,
- userSeatCost,
- teamSeatsCost,
- totalCost,
- seatCount,
- step,
- setStep,
- next,
- back,
- steps,
- setSteps,
- skipStep,
- completeStep,
- isStepSkipped,
- };
-
- return (
- <OnboardingContext.Provider value={value}>
- {props.children}
- </OnboardingContext.Provider>
- );
-}
-
-export function useOnboarding() {
- const ctx = useContext(OnboardingContext);
- if (!ctx)
- throw new Error('useOnboarding must be used within OnboardingProvider');
- return ctx;
-}
diff --git a/js/app/packages/app/component/onboarding/onboarding.tsx b/js/app/packages/app/component/onboarding/onboarding.tsx
deleted file mode 100644
index dbcf673815..0000000000
--- a/js/app/packages/app/component/onboarding/onboarding.tsx
+++ /dev/null
@@ -1,369 +0,0 @@
-import { useAnalytics } from '@app/component/analytics-context';
-import { useSplitPanel } from '@app/component/split-layout/layoutUtils';
-import { analytics } from '@app/lib/analytics/analytics';
-import { useIsAuthenticated } from '@core/auth';
-import { PcNoiseGrid } from '@core/component/PcNoiseGrid';
-import { toast } from '@core/component/Toast/Toast';
-import { useUserInfo } from '@core/context/user';
-import { initAndStartEmailSync } from '@core/email-link';
-import { fetchToken } from '@core/util/fetchWithToken';
-import { throwOnErr } from '@core/util/result';
-import ArrowLeftIcon from '@phosphor/arrow-left.svg';
-import { useCompleteTutorialMutation } from '@queries/auth/tutorial';
-import { invalidateUserTeams, useUserTeamsQuery } from '@queries/team';
-import { authServiceClient } from '@service-auth/client';
-import { useLocation, useNavigate } from '@solidjs/router';
-import { useQuery } from '@tanstack/solid-query';
-import { Button, cn, Layer, LogoProgress } from '@ui';
-import { Stepper } from '@ui/components/Stepper';
-import { createEffect, createMemo, For, on, onMount, Show } from 'solid-js';
-import { Dynamic } from 'solid-js/web';
-import {
- clearPendingTeam,
- getPendingTeam,
-} from '../interactive-onboarding/use-onboarding-checkout';
-import { OnboardingProvider, useOnboarding } from './onboarding-context';
-import { STEPS } from './steps';
-
-export default function Onboarding() {
- return (
- <OnboardingProvider steps={STEPS}>
- <OnboardingInner />
- </OnboardingProvider>
- );
-}
-
-function OnboardingInner() {
- const ctx = useOnboarding();
- const analyticsCtx = useAnalytics();
- const location = useLocation();
- const navigate = useNavigate();
- const splitPanel = useSplitPanel();
- const completeTutorial = useCompleteTutorialMutation();
- const isAuthenticated = useIsAuthenticated();
- const userInfo = useUserInfo();
- const userTeamsQuery = useUserTeamsQuery();
-
- const params = new URLSearchParams(location.search);
-
- // Restore locally saved profile data (survives Google/Stripe redirects)
- const saved = sessionStorage.getItem('onboarding_profile');
- if (saved) {
- try {
- const profile = JSON.parse(saved);
- if (profile.firstName) ctx.setFirstName(profile.firstName);
- if (profile.lastName) ctx.setLastName(profile.lastName);
- if (profile.email) ctx.setEmail(profile.email);
- if (profile.teamName) ctx.setTeamName(profile.teamName);
- } catch {
- // ignore malformed data
- }
- sessionStorage.removeItem('onboarding_profile');
- }
-
- // Fill remaining gaps from authenticated user data
- createEffect(() => {
- if (!isAuthenticated()) return;
-
- ctx.skipStep('verify');
-
- const info = userInfo();
- if (!info) return;
-
- if (info.email && !ctx.email()) ctx.setEmail(info.email);
- });
-
- // Fetch first/last name separately (userInfo only has a combined display name)
- const userNameQuery = useQuery(() => ({
- queryKey: ['userName'],
- queryFn: async () => {
- const result = await authServiceClient.getUserName();
- if (result.isErr()) return null;
- return result.value;
- },
- enabled: isAuthenticated() === true && !ctx.firstName() && !ctx.lastName(),
- }));
-
- createEffect(() => {
- const name = userNameQuery.data;
- if (!name) return;
- if (name.first_name && !ctx.firstName()) ctx.setFirstName(name.first_name);
- if (name.last_name && !ctx.lastName()) ctx.setLastName(name.last_name);
- });
-
- // Prefill team name and skip team step if user already has a team
- createEffect(() => {
- const teams = userTeamsQuery.data;
- if (!teams) return;
-
- if (teams.length > 0) {
- const team = teams[0];
- if (team.name && !ctx.teamName()) ctx.setTeamName(team.name);
- ctx.skipStep('team');
- }
- });
-
- const cleanParam = (key: string) => {
- const cleanParams = new URLSearchParams(window.location.search);
- cleanParams.delete(key);
- const qs = cleanParams.toString();
- window.history.replaceState(
- null,
- '',
- qs ? `${window.location.pathname}?${qs}` : window.location.pathname
- );
- };
-
- const navigateAway = () => {
- if (splitPanel) {
- splitPanel.handle.replace({
- next: { type: 'component', id: 'unified-list' },
- });
- } else {
- navigate('/', { replace: true });
- }
- };
-
- onMount(() => {
- if (params.has('google')) {
- cleanParam('google');
- ctx.skipStep('verify');
-
- fetchToken().then(async () => {
- initAndStartEmailSync().match(
- () => analytics.track('email_authorized'),
- (e) => {
- if (e.tag === 'AlreadyInitialized') {
- analytics.track('email_authorized');
- } else {
- console.error('Failed to init email link after Google auth', e);
- }
- }
- );
-
- if (ctx.firstName() || ctx.lastName()) {
- authServiceClient
- .putUserName({
- first_name: ctx.firstName() || undefined,
- last_name: ctx.lastName() || undefined,
- })
- .catch(() => {});
- }
- });
-
- const teamStepIndex = STEPS.findIndex((s) => s.id === 'team');
- if (teamStepIndex !== -1) ctx.setStep(teamStepIndex);
-
- return;
- }
-
- if (params.has('subscriptionSuccess')) {
- const rawTier = params.get('type');
-
- cleanParam('subscriptionSuccess');
- cleanParam('type');
-
- analytics.track('subscription_success', { type: rawTier ?? 'unknown' });
-
- fetchToken().then(() => createPendingTeamOnReturn());
- completeTutorial.mutate(undefined);
-
- navigateAway();
-
- return;
- }
-
- analyticsCtx.track('onboarding_start');
- });
-
- createEffect(
- on(
- () => ctx.step(),
- (step) => {
- analyticsCtx.track('onboarding_step', {
- step,
- id: STEPS[step]?.id,
- label: STEPS[step]?.label,
- });
- }
- )
- );
-
- const showBack = () => ctx.step() > 1;
-
- // Exclude intro (index 0) and skipped steps from progress count
- const activeStepCount = createMemo(
- () => ctx.steps.filter((s, i) => i > 0 && s.status !== 'skipped').length
- );
-
- const activeStepPosition = createMemo(() => {
- const current = ctx.step();
- let pos = 0;
- for (let i = 1; i < ctx.steps.length; i++) {
- if (ctx.steps[i]?.status === 'skipped') continue;
- pos++;
- if (i === current) return pos;
- }
- return pos;
- });
-
- return (
- <div class="flex items-center mobile:items-stretch justify-center size-full relative overflow-y-auto py-8">
- <style>
- {`
- input:-webkit-autofill,
- input:-webkit-autofill:hover,
- input:-webkit-autofill:focus {
- -webkit-box-shadow: 0 0 0 1000px var(--color-surface) inset;
- -webkit-text-fill-color: var(--color-ink);
- caret-color: var(--color-ink);
- transition: background-color 5000s ease-in-out 0s;
- }
- `}
- </style>
-
- <div class="inset-0 absolute text-edge bg-surface opacity-10 -z-1">
- <PcNoiseGrid
- cellSize={30}
- warp={0}
- crunch={0.2}
- freq={0.001}
- size={[0, 0.3]}
- rounding={0}
- fill={0}
- stroke={1}
- speed={[0.017, 0.209]}
- />
- </div>
-
- <Layer depth={3}>
- <div
- class={cn(
- 'w-full flex flex-col px-8',
- ctx.step() === 0 ? 'max-w-3xl' : 'max-w-md'
- )}
- >
- <Show when={ctx.step() > 0}>
- <div class="w-full flex items-center gap-3 mobile:justify-between mb-10">
- <div
- class={cn(
- 'hidden mobile:block',
- showBack() ? 'visible' : 'invisible'
- )}
- >
- <button
- type="button"
- tabIndex={0}
- onClick={() => ctx.back()}
- class="flex items-center gap-1 text-xs text-ink-disabled hover:text-ink transition-colors outline-none rounded-sm focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
- >
- <ArrowLeftIcon class="size-3" />
- Back
- </button>
- </div>
- <div class="flex items-center gap-3">
- <LogoProgress
- level={activeStepPosition()}
- total={activeStepCount()}
- class="w-7"
- />
- <Show when={activeStepCount() > 1}>
- <span class="text-sm font-mono font-semibold text-ink mobile:text-xs mobile:font-normal mobile:text-ink-disabled">
- {activeStepPosition()}/{activeStepCount()}
- </span>
- </Show>
- </div>
- </div>
- </Show>
-
- <div class="w-full flex flex-col gap-2 mobile:flex-1 mobile:min-h-0">
- <Show when={ctx.step() > 0}>
- <div
- class={cn(
- 'mobile:hidden',
- showBack() ? 'visible' : 'invisible'
- )}
- >
- <button
- type="button"
- tabIndex={0}
- onClick={() => ctx.back()}
- class="flex items-center gap-1 text-xs text-ink-disabled hover:text-ink transition-colors outline-none rounded-sm focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
- >
- <ArrowLeftIcon class="size-3" />
- Back
- </button>
- </div>
- </Show>
- <Stepper
- step={ctx.step()}
- transition={Stepper.transitions.slideFull}
- appear
- class={cn(
- 'overflow-clip p-1 -m-1 mobile:flex-1 mobile:min-h-0',
- ctx.step() > 0 && 'min-h-125'
- )}
- >
- <For each={STEPS}>
- {(stepDef, i) => (
- <Stepper.Step noTransition={i() === 0}>
- <Dynamic component={stepDef.component} />
- </Stepper.Step>
- )}
- </For>
- </Stepper>
- </div>
- </div>
- </Layer>
-
- <Show when={import.meta.env.MODE === 'development'}>
- <div class="fixed bottom-4 right-4 z-50">
- <Button variant="ghost" size="sm" onClick={() => ctx.next()}>
- Skip step
- </Button>
- </div>
- </Show>
- </div>
- );
-}
-
-async function createPendingTeamOnReturn(): Promise<boolean> {
- const pendingTeam = getPendingTeam();
- if (!pendingTeam) return true;
-
- try {
- const team = await throwOnErr(() =>
- authServiceClient.createTeam({ name: pendingTeam.name })
- );
-
- const invites = pendingTeam.members
- .filter((m) => m.email.trim())
- .map((m) => ({ email: m.email }));
-
- if (invites.length > 0) {
- try {
- await throwOnErr(() => authServiceClient.inviteToTeam({ invites }));
- } catch (inviteError) {
- console.error('Failed to send team invites:', inviteError);
- toast.failure('Team created, but some invites failed to send.');
- }
- }
-
- await invalidateUserTeams();
- clearPendingTeam();
-
- analytics.track('onboarding_team_created', {
- inviteCount: invites.length,
- teamId: team.id,
- });
-
- return true;
- } catch (error) {
- console.error('Failed to create team:', error);
- toast.failure(
- 'Failed to create team. You can set it up later in Settings.'
- );
- clearPendingTeam();
- return false;
- }
-}
diff --git a/js/app/packages/app/component/onboarding/steps/index.ts b/js/app/packages/app/component/onboarding/steps/index.ts
deleted file mode 100644
index 1be2d0e297..0000000000
--- a/js/app/packages/app/component/onboarding/steps/index.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import type { Component } from 'solid-js';
-import { IntroStep } from './intro-step';
-import { PaymentStep } from './payment-step';
-import { ProfileStep } from './profile-step';
-import { TeamStep } from './team-step';
-import { VerifyStep } from './verify-step';
-
-export { IntroStep, PaymentStep, ProfileStep, TeamStep, VerifyStep };
-
-export interface OnboardingStep {
- id: string;
- label: string;
- component: Component;
-}
-
-export const STEPS: OnboardingStep[] = [
- { id: 'intro', label: 'Intro', component: IntroStep },
- { id: 'profile', label: 'Profile', component: ProfileStep },
- { id: 'verify', label: 'Verify', component: VerifyStep },
- { id: 'team', label: 'Team', component: TeamStep },
- { id: 'payment', label: 'Payment', component: PaymentStep },
-];
diff --git a/js/app/packages/app/component/onboarding/steps/intro-step.tsx b/js/app/packages/app/component/onboarding/steps/intro-step.tsx
deleted file mode 100644
index df741a78ca..0000000000
--- a/js/app/packages/app/component/onboarding/steps/intro-step.tsx
+++ /dev/null
@@ -1,140 +0,0 @@
-import LogoIcon from '@icon/macro-logo.svg';
-import { AnimatedCallIcon } from '@icon/wide-call';
-import { AnimatedChannelIcon } from '@icon/wide-channel';
-import { AnimatedEmailIcon } from '@icon/wide-email';
-import { AnimatedFileMdIcon } from '@icon/wide-fileMd';
-import { AnimatedStarIcon } from '@icon/wide-star';
-import { AnimatedTaskIcon } from '@icon/wide-task';
-import ArrowRightIcon from '@phosphor/arrow-right.svg';
-import { A } from '@solidjs/router';
-import { Button, cn } from '@ui';
-import { For } from 'solid-js';
-import { useOnboarding } from '../onboarding-context';
-
-const BLOCKS = [
- {
- icon: AnimatedEmailIcon,
- color: 'text-email',
- hoverBg: 'hover:bg-email/10',
- hoverBorder: 'hover:border-email/40',
- hoverIconBg: 'group-hover:bg-email/10',
- title: 'Email',
- description: 'Full email client — no tab switching.',
- },
- {
- icon: AnimatedFileMdIcon,
- color: 'text-note',
- hoverBg: 'hover:bg-note/10',
- hoverBorder: 'hover:border-note/40',
- hoverIconBg: 'group-hover:bg-note/10',
- title: 'Docs',
- description: 'Markdown editor with mentions and live collaboration.',
- },
- {
- icon: AnimatedTaskIcon,
- color: 'text-task',
- hoverBg: 'hover:bg-task/10',
- hoverBorder: 'hover:border-task/40',
- hoverIconBg: 'group-hover:bg-task/10',
- title: 'Tasks',
- description: 'Assignments, due dates, and statuses — all linked.',
- },
- {
- icon: AnimatedChannelIcon,
- color: 'text-folder',
- hoverBg: 'hover:bg-folder/10',
- hoverBorder: 'hover:border-folder/40',
- hoverIconBg: 'group-hover:bg-folder/10',
- title: 'Channels',
- description: 'Team messaging with threads and file sharing.',
- },
- {
- icon: AnimatedCallIcon,
- color: 'text-calendar',
- hoverBg: 'hover:bg-calendar/10',
- hoverBorder: 'hover:border-calendar/40',
- hoverIconBg: 'group-hover:bg-calendar/10',
- title: 'Calls',
- description: 'Voice and video — no separate app needed.',
- },
- {
- icon: AnimatedStarIcon,
- color: 'text-chat',
- hoverBg: 'hover:bg-chat/10',
- hoverBorder: 'hover:border-chat/40',
- hoverIconBg: 'group-hover:bg-chat/10',
- title: 'AI Agents',
- description: 'Search, summarize, and act across everything.',
- },
-];
-
-export function IntroStep() {
- const ctx = useOnboarding();
-
- return (
- <div class="flex flex-col items-center text-center gap-10 w-full mobile:h-full">
- <div class="flex flex-col items-center gap-5">
- <LogoIcon class="size-12 text-accent" />
- <div class="flex flex-col gap-2">
- <h1 class="text-4xl mobile:text-2xl font-semibold text-ink tracking-tight">
- Welcome to Macro
- </h1>
- <p class="text-sm text-ink-disabled">
- SOC 2 certified · built for teams that move fast
- </p>
- </div>
- </div>
-
- <div class="grid grid-cols-3 gap-3 w-full mobile:grid-cols-1 mobile:gap-4 mobile:flex-1 mobile:min-h-0 mobile:overflow-y-auto mobile:scrollbar-hidden">
- <For each={BLOCKS}>
- {(item) => (
- <div
- class={cn(
- 'group flex-1 flex flex-col gap-2.5 p-4 rounded-sm border border-edge-muted text-left transition-colors',
- 'mobile:flex-row mobile:items-center mobile:gap-3 mobile:p-0 mobile:border-0 mobile:rounded-none',
- item.hoverBg,
- item.hoverBorder
- )}
- >
- <div
- class={cn(
- 'size-8 rounded-sm bg-ink/5 flex items-center justify-center transition-colors shrink-0',
- item.hoverIconBg
- )}
- >
- <item.icon class={cn('size-5', item.color)} />
- </div>
- <div class="flex flex-col gap-0.5">
- <span class="text-sm font-medium text-ink">{item.title}</span>
- <span class="text-xs text-ink-disabled leading-relaxed">
- {item.description}
- </span>
- </div>
- </div>
- )}
- </For>
- </div>
-
- <div class="flex flex-col items-center gap-3 mobile:mt-auto mobile:w-full">
- <Button
- variant="base"
- size="lg"
- onClick={() => ctx.next()}
- class="px-8 mobile:w-full bg-accent text-surface border-accent not-disabled:hover:bg-accent/90 not-disabled:hover:text-surface focus-visible:bg-accent focus-visible:text-surface focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
- >
- Get started
- <ArrowRightIcon class="size-4" />
- </Button>
- <p class="text-sm text-ink-disabled">
- Already have an account?{' '}
- <A
- href="/login"
- class="text-accent hover:text-accent/80 font-medium outline-none rounded-sm focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
- >
- Sign in
- </A>
- </p>
- </div>
- </div>
- );
-}
diff --git a/js/app/packages/app/component/onboarding/steps/payment-step.tsx b/js/app/packages/app/component/onboarding/steps/payment-step.tsx
deleted file mode 100644
index c9568fa252..0000000000
--- a/js/app/packages/app/component/onboarding/steps/payment-step.tsx
+++ /dev/null
@@ -1,236 +0,0 @@
-import { useAnalytics } from '@app/component/analytics-context';
-import type { PaidPlanTier } from '@app/component/paywall/plans';
-import { DEFAULT_ROUTE } from '@app/constants/defaultRoute';
-import { useIsAuthenticated } from '@core/auth';
-import { useHasPaidAccess } from '@core/auth/license';
-import { toast } from '@core/component/Toast/Toast';
-import ArrowRightIcon from '@phosphor/arrow-right.svg';
-import LockIcon from '@phosphor/lock.svg';
-import SpinnerIcon from '@phosphor/spinner.svg';
-import { useNavigate } from '@solidjs/router';
-import { Button } from '@ui';
-import { createSignal, For, Show } from 'solid-js';
-import {
- clearPendingTeam,
- savePendingTeam,
- useOnboardingCheckoutMutation,
-} from '../../interactive-onboarding/use-onboarding-checkout';
-import { useOnboarding } from '../onboarding-context';
-
-interface TeamPlan {
- price: number;
- seats: number;
- tier: PaidPlanTier;
-}
-
-const TEAM_PLANS: TeamPlan[] = [
- { price: 100, seats: 3, tier: 'haiku' },
- { price: 500, seats: 6, tier: 'sonnet' },
- { price: 2500, seats: 10, tier: 'opus' },
- { price: 6000, seats: 25, tier: 'opus' },
-];
-
-function planForSeatCount(seats: number): TeamPlan {
- return (
- TEAM_PLANS.find((p) => p.seats >= seats) ??
- TEAM_PLANS[TEAM_PLANS.length - 1]
- );
-}
-
-export function PaymentStep() {
- const hasPaidAccess = useHasPaidAccess();
-
- return (
- <Show when={!hasPaidAccess()} fallback={<AlreadyPaidView />}>
- <CheckoutView />
- </Show>
- );
-}
-
-function CheckoutView() {
- const ctx = useOnboarding();
- const analytics = useAnalytics();
- const isAuthenticated = useIsAuthenticated();
- const [isRedirecting, setIsRedirecting] = createSignal(false);
-
- const teamSize = () => 1 + ctx.invitedMembers().length;
- const plan = () => planForSeatCount(teamSize());
-
- const checkoutMutation = useOnboardingCheckoutMutation({
- onSuccess: (result) => {
- analytics.track('subscription_start', {
- type: plan().tier,
- seats: teamSize(),
- });
- setIsRedirecting(true);
- window.location.href = result.checkoutUrl;
- },
- onError: (error) => {
- console.error('Checkout error:', error);
- toast.failure(
- error.message || 'Failed to start checkout. Please try again.'
- );
- },
- });
-
- const isPending = () => checkoutMutation.isPending || isRedirecting();
-
- const handleCheckout = () => {
- if (isPending()) return;
-
- if (!isAuthenticated()) {
- toast.failure('Please sign in to continue');
- ctx.setStep(0);
- return;
- }
-
- const teamName = ctx.teamName();
- const members = ctx
- .invitedMembers()
- .map((m) => ({ email: m.email, tier: plan().tier }));
-
- if (teamName) {
- savePendingTeam({ name: teamName, members });
- } else {
- clearPendingTeam();
- }
-
- ctx.setSelectedPlan(plan().tier);
- checkoutMutation.mutate({ tier: plan().tier });
- };
-
- return (
- <div class="flex flex-col gap-8 w-full mobile:h-full">
- <div class="flex flex-col gap-1">
- <h1 class="text-2xl font-semibold text-ink tracking-tight">
- Review your plan
- </h1>
- <p class="text-sm text-ink-disabled">
- Here's a summary of your workspace.
- </p>
- </div>
-
- <div class="flex flex-col gap-5">
- <Show when={ctx.teamName()}>
- <div>
- <span class="text-xs font-medium text-ink-muted uppercase tracking-wide">
- Team
- </span>
- <p class="text-lg font-semibold text-ink -mt-0.5">
- {ctx.teamName()}
- </p>
- </div>
- </Show>
-
- <div class="flex items-baseline justify-between pb-4 border-b border-edge-muted">
- <div class="flex items-end gap-1">
- <span class="text-4xl font-bold text-ink leading-none tracking-tight">
- ${plan().price}
- </span>
- <span class="text-ink-muted text-sm pb-0.5">/mo</span>
- </div>
- <span class="text-sm text-ink-muted">Up to {plan().seats} seats</span>
- </div>
-
- <div class="flex flex-col text-sm">
- <div class="flex justify-between py-2.5 border-b border-edge-muted">
- <span class="text-ink-muted">You</span>
- <span class="text-xs text-ink-disabled">{ctx.email()}</span>
- </div>
- <For each={ctx.invitedMembers()}>
- {(member) => (
- <div class="flex justify-between py-2.5 border-b border-edge-muted">
- <span class="text-ink-muted font-mono text-xs truncate mr-2">
- {member.email}
- </span>
- <span class="text-xs text-ink-disabled shrink-0">Invited</span>
- </div>
- )}
- </For>
- <div class="flex justify-between items-center py-2.5">
- <span class="text-ink-muted">
- {teamSize()} {teamSize() === 1 ? 'seat' : 'seats'} used
- </span>
- <span class="text-xs text-ink-disabled">
- {plan().seats - teamSize()} remaining
- </span>
- </div>
- </div>
- </div>
-
- <div class="flex flex-col gap-3 mobile:mt-auto">
- <Button
- variant="base"
- size="lg"
- onClick={handleCheckout}
- disabled={isPending()}
- class="w-full bg-accent text-surface border-accent not-disabled:hover:bg-accent/90 not-disabled:hover:text-surface focus-visible:bg-accent focus-visible:text-surface focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
- >
- <Show
- when={!isPending()}
- fallback={
- <>
- <SpinnerIcon class="size-4 animate-spin" />
- Redirecting to checkout...
- </>
- }
- >
- Continue to payment
- <ArrowRightIcon class="size-4" />
- </Show>
- </Button>
-
- <span class="text-xs text-ink-disabled flex items-center justify-center gap-1.5">
- <LockIcon class="size-3" />
- Secure checkout via Stripe
- </span>
- </div>
- </div>
- );
-}
-
-function AlreadyPaidView() {
- const navigate = useNavigate();
-
- const handleTakeMeThere = () => {
- navigate('/component/settings', { replace: true });
- };
-
- const handleTakeMeHome = () => {
- navigate(DEFAULT_ROUTE, { replace: true });
- };
-
- return (
- <div class="flex flex-col gap-8 w-full mobile:h-full">
- <div class="flex flex-col gap-1">
- <h1 class="text-2xl font-semibold text-ink tracking-tight">
- You're all set
- </h1>
- <p class="text-sm text-ink-disabled">
- You already have an active plan. Invite teammates from Settings
- anytime.
- </p>
- </div>
-
- <div class="flex flex-col gap-2 mobile:mt-auto">
- <Button
- variant="base"
- size="lg"
- onClick={handleTakeMeThere}
- class="w-full bg-accent text-surface border-accent not-disabled:hover:bg-accent/90 not-disabled:hover:text-surface focus-visible:bg-accent focus-visible:text-surface focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
- >
- Take me there
- <ArrowRightIcon class="size-4" />
- </Button>
- <Button
- variant="ghost"
- size="md"
- onClick={handleTakeMeHome}
- class="w-full"
- >
- Take me home
- </Button>
- </div>
- </div>
- );
-}
diff --git a/js/app/packages/app/component/onboarding/steps/profile-step.tsx b/js/app/packages/app/component/onboarding/steps/profile-step.tsx
deleted file mode 100644
index 2e09dcfa7c..0000000000
--- a/js/app/packages/app/component/onboarding/steps/profile-step.tsx
+++ /dev/null
@@ -1,276 +0,0 @@
-import { ROUTER_BASE_CONCAT } from '@app/constants/routerBase';
-import { useIsAuthenticated } from '@core/auth';
-import { startSsoLogin } from '@core/auth/sso';
-import { toast } from '@core/component/Toast/Toast';
-import { isTauri } from '@core/util/platform';
-import IconGoogle from '@icon/macro-google.svg';
-import ArrowRightIcon from '@phosphor/arrow-right.svg';
-import { Button, cn } from '@ui';
-import { createSignal, onMount, Show } from 'solid-js';
-import { z } from 'zod';
-import { useOnboarding } from '../onboarding-context';
-
-const NAME_MAX_LENGTH = 50;
-const TEAM_NAME_MAX_LENGTH = 50;
-const EMAIL_MAX_LENGTH = 254;
-
-const profileSchema = z.object({
- firstName: z
- .string()
- .min(1, 'First name is required')
- .max(NAME_MAX_LENGTH, 'First name is too long'),
- lastName: z.string().max(NAME_MAX_LENGTH, 'Last name is too long'),
- email: z
- .string()
- .min(1, 'Email is required')
- .email('Invalid email address')
- .max(EMAIL_MAX_LENGTH, 'Email is too long'),
- teamName: z
- .string()
- .min(1, 'Team name is required')
- .max(TEAM_NAME_MAX_LENGTH, 'Team name is too long'),
-});
-
-export function ProfileStep() {
- const ctx = useOnboarding();
- const isAuthenticated = useIsAuthenticated();
- const [errors, setErrors] = createSignal<Record<string, string>>({});
- const [authPending, setAuthPending] = createSignal(false);
-
- let firstNameRef: HTMLInputElement | undefined;
- onMount(() => firstNameRef?.focus());
-
- const validate = () => {
- const result = profileSchema.safeParse({
- firstName: ctx.firstName().trim(),
- lastName: ctx.lastName().trim(),
- email: ctx.email().trim(),
- teamName: ctx.teamName().trim(),
- });
-
- if (result.success) {
- setErrors({});
- return true;
- }
-
- const errs: Record<string, string> = {};
- for (const issue of result.error.issues) {
- const field = issue.path[0];
- if (typeof field === 'string' && !errs[field]) {
- errs[field] = issue.message;
- }
- }
- setErrors(errs);
- return false;
- };
-
- const clearError = (field: string) => {
- setErrors((prev) => {
- const next = { ...prev };
- delete next[field];
- return next;
- });
- };
-
- const handleGoogleAuth = async () => {
- if (!validate()) return;
- setAuthPending(true);
-
- sessionStorage.setItem(
- 'onboarding_profile',
- JSON.stringify({
- firstName: ctx.firstName(),
- lastName: ctx.lastName(),
- email: ctx.email(),
- teamName: ctx.teamName(),
- })
- );
-
- try {
- const success = await startSsoLogin({
- returnPath: `${ROUTER_BASE_CONCAT}welcome?google=1`,
- loginHint: ctx.email().trim() || undefined,
- });
-
- if (success) {
- if (isTauri()) {
- window.location.hash = '#/welcome?google=1';
- window.location.reload();
- } else {
- window.location.href = `${window.location.origin}${ROUTER_BASE_CONCAT}welcome?google=1`;
- }
- } else {
- setAuthPending(false);
- }
- } catch (e) {
- console.error('Google sign-in failed:', e);
- toast.failure('Sign-in failed. Please try again.');
- setAuthPending(false);
- }
- };
-
- const handleContinueWithEmail = () => {
- if (!validate()) return;
- ctx.next();
- };
-
- const handleContinueAuthed = () => {
- if (!validate()) return;
- ctx.skipStep('verify');
- ctx.next();
- };
-
- const inputClass = (hasError: boolean) =>
- cn(
- 'w-full px-2.5 h-9 text-sm rounded-sm border bg-transparent text-ink placeholder:text-ink-placeholder transition-colors',
- 'outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-surface',
- hasError ? 'border-failure' : 'border-edge-muted'
- );
-
- return (
- <div class="flex flex-col gap-8 w-full mobile:h-full">
- <div class="flex flex-col gap-1">
- <h1 class="text-2xl font-semibold text-ink tracking-tight">
- {isAuthenticated() ? 'Your workspace' : 'Create your workspace'}
- </h1>
- <p class="text-sm text-ink-disabled">
- {isAuthenticated()
- ? 'Confirm your details before continuing.'
- : 'Tell us about yourself and your team.'}
- </p>
- </div>
-
- <div class="flex flex-col gap-5">
- <div class="flex gap-3">
- <div class="flex-1 flex flex-col gap-2">
- <label for="onb-first-name" class="text-sm font-medium text-ink">
- First name
- </label>
- <input
- ref={firstNameRef}
- id="onb-first-name"
- type="text"
- maxLength={NAME_MAX_LENGTH}
- value={ctx.firstName()}
- onInput={(e) => {
- ctx.setFirstName(e.currentTarget.value);
- clearError('firstName');
- }}
- placeholder="Jane"
- class={inputClass(!!errors().firstName)}
- />
- <Show when={errors().firstName}>
- <p class="text-xs text-failure">{errors().firstName}</p>
- </Show>
- </div>
- <div class="flex-1 flex flex-col gap-2">
- <label for="onb-last-name" class="text-sm font-medium text-ink">
- Last name
- </label>
- <input
- id="onb-last-name"
- type="text"
- maxLength={NAME_MAX_LENGTH}
- value={ctx.lastName()}
- onInput={(e) => {
- ctx.setLastName(e.currentTarget.value);
- clearError('lastName');
- }}
- placeholder="Doe"
- class={inputClass(!!errors().lastName)}
- />
- <Show when={errors().lastName}>
- <p class="text-xs text-failure">{errors().lastName}</p>
- </Show>
- </div>
- </div>
-
- <div class="flex flex-col gap-2">
- <label for="onb-email" class="text-sm font-medium text-ink">
- Email
- </label>
- <input
- id="onb-email"
- type="email"
- maxLength={EMAIL_MAX_LENGTH}
- value={ctx.email()}
- onInput={(e) => {
- ctx.setEmail(e.currentTarget.value);
- clearError('email');
- }}
- placeholder="[email protected]"
- class={inputClass(!!errors().email)}
- />
- <Show when={errors().email}>
- <p class="text-xs text-failure">{errors().email}</p>
- </Show>
- </div>
-
- <div class="flex flex-col gap-2">
- <label for="onb-team-name" class="text-sm font-medium text-ink">
- Team name
- </label>
- <input
- id="onb-team-name"
- type="text"
- maxLength={TEAM_NAME_MAX_LENGTH}
- value={ctx.teamName()}
- onInput={(e) => {
- ctx.setTeamName(e.currentTarget.value);
- clearError('teamName');
- }}
- placeholder="Acme Inc."
- class={inputClass(!!errors().teamName)}
- />
- <Show when={errors().teamName}>
- <p class="text-xs text-failure">{errors().teamName}</p>
- </Show>
- </div>
- </div>
-
- <Show
- when={!isAuthenticated()}
- fallback={
- <Button
- variant="base"
- size="lg"
- onClick={handleContinueAuthed}
- class="w-full mobile:mt-auto bg-accent text-surface border-accent not-disabled:hover:bg-accent/90 not-disabled:hover:text-surface focus-visible:bg-accent focus-visible:text-surface focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
- >
- Continue
- <ArrowRightIcon class="size-4" />
- </Button>
- }
- >
- <div class="flex flex-col gap-3 mobile:mt-auto">
- <Button
- variant="base"
- size="lg"
- onClick={handleGoogleAuth}
- disabled={authPending()}
- class="w-full bg-accent text-surface border-accent not-disabled:hover:bg-accent/90 not-disabled:hover:text-surface focus-visible:bg-accent focus-visible:text-surface focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface [&_svg]:size-6"
- >
- <IconGoogle />
- {authPending() ? 'Redirecting...' : 'Continue with Google'}
- </Button>
-
- <div class="flex items-center gap-3 text-xs text-ink-extra-muted">
- <div class="h-px flex-1 bg-edge-muted" />
- or
- <div class="h-px flex-1 bg-edge-muted" />
- </div>
-
- <Button
- variant="base"
- size="lg"
- onClick={handleContinueWithEmail}
- class="w-full focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
- >
- Continue with email
- <ArrowRightIcon class="size-4" />
- </Button>
- </div>
- </Show>
- </div>
- );
-}
diff --git a/js/app/packages/app/component/onboarding/steps/team-step.tsx b/js/app/packages/app/component/onboarding/steps/team-step.tsx
deleted file mode 100644
index 44397a33e3..0000000000
--- a/js/app/packages/app/component/onboarding/steps/team-step.tsx
+++ /dev/null
@@ -1,278 +0,0 @@
-import ArrowRightIcon from '@phosphor/arrow-right.svg';
-import CalendarIcon from '@phosphor/calendar-dots.svg';
-import PlusIcon from '@phosphor/plus.svg';
-import UsersIcon from '@phosphor/users.svg';
-import XIcon from '@phosphor/x.svg';
-import { Button, cn, Layer } from '@ui';
-import { createSignal, Index, Show } from 'solid-js';
-import { z } from 'zod';
-import type { InvitedMember } from '../onboarding-context';
-import { useOnboarding } from '../onboarding-context';
-
-type InviteEntry = { email: string };
-
-const LARGE_TEAM_THRESHOLD = 25;
-const CONTACT_SALES_URL = 'https://cal.com/team/macro/macro-demo-call';
-
-export function TeamStep() {
- const ctx = useOnboarding();
-
- const initialEntries = (): InviteEntry[] => {
- const members = ctx.invitedMembers();
- if (members.length > 0) {
- return members.map((m) => ({ email: m.email }));
- }
- return [{ email: '' }];
- };
-
- const [entries, setEntries] = createSignal<InviteEntry[]>(initialEntries());
- const [errors, setErrors] = createSignal<Record<number, string>>({});
-
- const hasValidEmail = () =>
- entries().some(
- (e) =>
- e.email.trim() !== '' && z.string().email().safeParse(e.email).success
- );
-
- const isLargeTeam = () => entries().length >= LARGE_TEAM_THRESHOLD;
-
- const emailPlaceholder = () => {
- const email = ctx.email();
- if (!email) return '[email protected]';
- const domain = email.split('@')[1];
- return domain ? `colleague@${domain}` : '[email protected]';
- };
-
- const syncMembers = (next: InviteEntry[]) => {
- const valid: InvitedMember[] = next
- .filter(
- (e) =>
- e.email.trim() !== '' && z.string().email().safeParse(e.email).success
- )
- .map((e) => ({ email: e.email, tier: 'opus' }));
- ctx.setInvitedMembers(valid);
- };
-
- const updateEmail = (index: number, value: string) => {
- const next = [...entries()];
- next[index] = { email: value };
- setEntries(next);
- syncMembers(next);
- if (errors()[index]) {
- setErrors((prev) => {
- const copy = { ...prev };
- delete copy[index];
- return copy;
- });
- }
- };
-
- const removeEntry = (index: number) => {
- const next = entries().filter((_, i) => i !== index);
- setEntries(next);
- syncMembers(next);
- setErrors((prev) => {
- const reindexed: Record<number, string> = {};
- for (const [key, value] of Object.entries(prev)) {
- const k = Number(key);
- if (k < index) reindexed[k] = value;
- else if (k > index) reindexed[k - 1] = value;
- }
- return reindexed;
- });
- };
-
- const validateOnBlur = (index: number, value: string) => {
- if (value.trim() === '') return;
- const result = z.string().email().safeParse(value);
- if (!result.success) {
- setErrors((prev) => ({ ...prev, [index]: 'Invalid email address' }));
- }
- };
-
- const addEntry = () => {
- const idx = entries().length;
- setEntries((prev) => [...prev, { email: '' }]);
- requestAnimationFrame(() => {
- document.getElementById(`onb-invite-${idx}`)?.focus();
- });
- };
-
- const handleContinue = () => {
- const errs: Record<number, string> = {};
- entries().forEach((e, i) => {
- if (e.email.trim() !== '') {
- const result = z.string().email().safeParse(e.email);
- if (!result.success) errs[i] = 'Invalid email address';
- }
- });
- setErrors(errs);
- if (Object.keys(errs).length > 0) return;
-
- syncMembers(entries());
- ctx.next();
- };
-
- return (
- <div class="flex flex-col gap-8 w-full mobile:h-full">
- <div class="flex flex-col gap-1">
- <h1 class="text-2xl font-semibold text-ink tracking-tight">
- Invite your team
- </h1>
- <p class="text-sm text-ink-disabled">
- Add teammates to{' '}
- <strong class="text-ink font-medium">{ctx.teamName()}</strong>. You
- can always invite more later.
- </p>
- </div>
-
- <div class="flex flex-col gap-2 mobile:min-h-0">
- <div class="flex flex-col gap-2 p-1 -m-1 mobile:min-h-0 mobile:overflow-y-auto mobile:scrollbar-hidden">
- <Index each={entries()}>
- {(entry, index) => (
- <div class="flex flex-col gap-1">
- <div class="relative">
- <input
- id={`onb-invite-${index}`}
- type="email"
- value={entry().email}
- onInput={(e) => updateEmail(index, e.currentTarget.value)}
- onBlur={(e) => validateOnBlur(index, e.currentTarget.value)}
- placeholder={emailPlaceholder()}
- class={cn(
- 'w-full px-2.5 h-9 pr-9 text-sm rounded-sm border bg-transparent text-ink placeholder:text-ink-placeholder transition-colors',
- 'outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-surface',
- errors()[index] ? 'border-failure' : 'border-edge-muted'
- )}
- />
- <Show when={entry().email.trim() !== ''}>
- <Button
- variant="ghost"
- size="icon-sm"
- onClick={() =>
- entries().length > 1
- ? removeEntry(index)
- : updateEmail(index, '')
- }
- class="absolute right-1.5 top-1/2 -translate-y-1/2 text-ink-disabled not-disabled:hover:text-ink-muted"
- noTouchResize
- >
- <XIcon class="size-3.5" />
- </Button>
- </Show>
- </div>
- <Show when={errors()[index]}>
- <p class="text-xs text-failure">{errors()[index]}</p>
- </Show>
- </div>
- )}
- </Index>
- </div>
-
- <Show
- when={hasValidEmail()}
- fallback={
- <div class="flex flex-col items-center gap-2 py-8 text-center">
- <div class="size-10 rounded-full bg-accent-bg flex items-center justify-center">
- <UsersIcon class="size-5 text-accent" />
- </div>
- <p class="text-sm text-ink-muted">It's quiet in here...</p>
- <p class="text-xs text-ink-disabled">
- Add your first teammate above
- </p>
- </div>
- }
- >
- <Button
- variant="ghost"
- size="sm"
- onClick={addEntry}
- class="w-full justify-center [&_svg]:size-3"
- >
- <PlusIcon />
- Add another
- </Button>
- </Show>
- </div>
-
- <div class="flex flex-col gap-2 mobile:mt-auto">
- <Show
- when={isLargeTeam()}
- fallback={
- <Show
- when={hasValidEmail()}
- fallback={
- <Button
- variant="base"
- size="lg"
- onClick={() => {
- ctx.setInvitedMembers([]);
- ctx.next();
- }}
- class="w-full bg-accent text-surface border-accent not-disabled:hover:bg-accent/90 not-disabled:hover:text-surface focus-visible:bg-accent focus-visible:text-surface focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
- >
- Maybe later
- <ArrowRightIcon class="size-4" />
- </Button>
- }
- >
- <Button
- variant="base"
- size="lg"
- onClick={handleContinue}
- class="w-full bg-accent text-surface border-accent not-disabled:hover:bg-accent/90 not-disabled:hover:text-surface focus-visible:bg-accent focus-visible:text-surface focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
- >
- Continue
- <ArrowRightIcon class="size-4" />
- </Button>
- <Button
- variant="ghost"
- size="md"
- onClick={() => {
- ctx.setInvitedMembers([]);
- ctx.next();
- }}
- class="w-full"
- >
- Maybe later
- </Button>
- </Show>
- }
- >
- <Layer depth={1}>
- <div class="rounded-sm border border-edge-muted bg-surface p-3 flex flex-col gap-1">
- <p class="text-sm font-medium text-ink">
- Inviting more than {LARGE_TEAM_THRESHOLD} teammates?
- </p>
- <p class="text-xs text-ink-muted">
- Let's chat — we'll set you up with a custom plan that fits.
- </p>
- </div>
- </Layer>
- <Button
- variant="base"
- size="lg"
- onClick={() =>
- window.open(CONTACT_SALES_URL, '_blank', 'noopener,noreferrer')
- }
- class="w-full bg-accent text-surface border-accent not-disabled:hover:bg-accent/90 not-disabled:hover:text-surface focus-visible:bg-accent focus-visible:text-surface focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface"
- >
- <CalendarIcon class="size-4" />
- Book a call
- </Button>
- <Button
- variant="ghost"
- size="md"
- onClick={() => {
- ctx.setInvitedMembers([]);
- ctx.next();
- }}
- class="w-full"
- >
- Maybe later
- </Button>
- </Show>
- </div>
- </div>
- );
-}
diff --git a/js/app/packages/app/component/onboarding/steps/verify-step.tsx b/js/app/packages/app/component/onboarding/steps/verify-step.tsx
deleted file mode 100644
index 97f3734552..0000000000
--- a/js/app/packages/app/component/onboarding/steps/verify-step.tsx
+++ /dev/null
@@ -1,218 +0,0 @@
-import { SERVER_HOSTS } from '@core/constant/servers';
-import { initAndStartEmailSync } from '@core/email-link';
-import { unsetTokenPromise } from '@core/util/fetchWithToken';
-import { platformFetch } from '@core/util/platformFetch';
-import SpinnerIcon from '@phosphor/spinner.svg';
-import { invalidateAllAfterLogin } from '@queries/auth/user-info';
-import { authServiceClient } from '@service-auth/client';
-import { cn } from '@ui';
-import { createSignal, onCleanup, onMount, Show } from 'solid-js';
-import { useOnboarding } from '../onboarding-context';
-
-const RESEND_TIMER = 45;
-
-const protocol = import.meta.hot ? 'http' : 'https';
-const REDIRECT_URI = `${protocol}://${window.location.host}/app`;
-
-export function VerifyStep() {
- const ctx = useOnboarding();
-
- const [code, setCode] = createSignal('');
- const [error, setError] = createSignal<string>();
- const [verifying, setVerifying] = createSignal(false);
- const [sending, setSending] = createSignal(false);
- const [resendTimer, setResendTimer] = createSignal(RESEND_TIMER);
-
- let resendIntervalId: ReturnType<typeof setInterval> | undefined;
-
- const startTimer = () => {
- if (resendIntervalId) clearInterval(resendIntervalId);
- setResendTimer(RESEND_TIMER);
- resendIntervalId = setInterval(
- () => setResendTimer((t) => (t > 0 ? t - 1 : 0)),
- 1000
- );
- };
-
- onCleanup(() => {
- if (resendIntervalId) clearInterval(resendIntervalId);
- });
-
- const sendCode = async () => {
- setSending(true);
- setError(undefined);
-
- try {
- const url = new URL(window.location.href);
- const referralCode = url.searchParams.get('referral_code');
-
- const response = await platformFetch(
- `${SERVER_HOSTS['auth-service']}/login/passwordless`,
- {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({
- redirect_uri: REDIRECT_URI,
- email: ctx.email(),
- ...(referralCode && { referral_code: referralCode }),
- }),
- }
- );
-
- if (!response.ok) {
- throw new Error(await response.text());
- }
-
- if (response.status === 202) {
- setError(
- 'This email requires a different sign-in method. Please use Google instead.'
- );
- return;
- }
-
- startTimer();
- } catch (e) {
- setError(e instanceof Error ? e.message : 'Failed to send code.');
- } finally {
- setSending(false);
- }
- };
-
- onMount(() => {
- sendCode();
- });
-
- const handleVerify = async () => {
- const value = code().trim();
- if (value.length !== 6) return;
-
- setVerifying(true);
- setError(undefined);
-
- try {
- const result = await authServiceClient.passwordlessCallback({
- code: value,
- email: ctx.email(),
- });
-
- if (result.isErr()) {
- if (result.error.some((e) => e.code === 'UNAUTHORIZED')) {
- setError('Invalid code. Please try again.');
- } else {
- setError('Verification failed. Please try again.');
- }
- setVerifying(false);
- return;
- }
-
- unsetTokenPromise();
- await invalidateAllAfterLogin();
-
- initAndStartEmailSync().match(
- () => {},
- (e) => {
- if (e.tag !== 'AlreadyInitialized') {
- console.error('Failed to init email link after verify', e);
- }
- }
- );
-
- if (ctx.firstName() || ctx.lastName()) {
- authServiceClient
- .putUserName({
- first_name: ctx.firstName() || undefined,
- last_name: ctx.lastName() || undefined,
- })
- .catch(() => {});
- }
-
- ctx.next();
- } catch (e) {
- setError(e instanceof Error ? e.message : 'Verification failed.');
- setVerifying(false);
- }
- };
-
- const handleCodeInput = (value: string) => {
- const digits = value.replace(/\D/g, '').slice(0, 6);
- setCode(digits);
- setError(undefined);
-
- if (digits.length === 6) {
- handleVerify();
- }
- };
-
- const canResend = () => !sending() && resendTimer() === 0;
-
- const inputClass = cn(
- 'w-full px-2.5 h-9 text-sm rounded-sm border bg-transparent text-ink placeholder:text-ink-placeholder transition-colors text-center tracking-widest font-mono',
- 'outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-surface',
- 'border-edge-muted'
- );
-
- return (
- <div class="flex flex-col gap-8 w-full mobile:h-full">
- <div class="flex flex-col gap-1">
- <h1 class="text-2xl font-semibold text-ink tracking-tight">
- Verify your email
- </h1>
- <p class="text-sm text-ink-disabled">
- <Show when={!sending()} fallback="Sending a code to ">
- We sent a 6-digit code to{' '}
- </Show>
- <strong class="text-ink font-medium">{ctx.email()}</strong>
- </p>
- </div>
-
- <div class="flex flex-col gap-4">
- <div class="flex flex-col gap-2">
- <label for="onb-otp" class="text-sm font-medium text-ink">
- Verification code
- </label>
- <input
- id="onb-otp"
- type="text"
- inputMode="numeric"
- value={code()}
- onInput={(e) => handleCodeInput(e.currentTarget.value)}
- placeholder="000000"
- disabled={verifying() || sending()}
- class={inputClass}
- autocomplete="one-time-code"
- />
- </div>
-
- <Show when={error()}>
- <p class="text-xs text-failure text-center">{error()}</p>
- </Show>
-
- <Show when={verifying()}>
- <div class="flex items-center justify-center gap-2 text-sm text-ink-muted">
- <SpinnerIcon class="size-4 animate-spin" />
- Verifying...
- </div>
- </Show>
- </div>
-
- <div class="flex items-center justify-center mobile:mt-auto">
- <button
- type="button"
- tabIndex={0}
- onClick={sendCode}
- disabled={!canResend()}
- class={cn(
- 'text-xs transition-colors outline-none rounded-sm focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface',
- canResend()
- ? 'text-accent hover:text-accent/80'
- : 'text-ink-disabled'
- )}
- >
- <Show when={resendTimer() > 0} fallback="Resend code">
- Resend in {resendTimer()}s
- </Show>
- </button>
- </div>
- </div>
- );
-}
diff --git a/js/app/packages/app/component/split-layout/componentRegistry.tsx b/js/app/packages/app/component/split-layout/componentRegistry.tsx
index 7e31556372..b99f28c27b 100644
--- a/js/app/packages/app/component/split-layout/componentRegistry.tsx
+++ b/js/app/packages/app/component/split-layout/componentRegistry.tsx
@@ -3,16 +3,11 @@ import { getViewPreset } from '@app/component/app-sidebar/soup-filter-presets';
import type { SetPredicatesInput } from '@app/component/next-soup/filters/filter-store/predicates-store';
import type { Query } from '@app/component/next-soup/filters/filter-store/types';
import { SoupView } from '@app/component/next-soup/soup-view/soup-view';
-import { ShowFeatureFlag } from '@app/lib/analytics/posthog';
import { ChannelCompose } from '@block-channel/component/Compose';
import { ComposeTask } from '@block-md/component/ComposeTask';
import { useIsAuthenticated } from '@core/auth';
import { LoadingBlock } from '@core/component/LoadingBlock';
-import {
- DEV_MODE_ENV,
- ENABLE_NEW_ONBOARDING_OVERRIDE,
- LOCAL_ONLY,
-} from '@core/constant/featureFlags';
+import { DEV_MODE_ENV, LOCAL_ONLY } from '@core/constant/featureFlags';
import { useUserContext } from '@core/context/user';
import type { ViewId } from '@core/types/view';
import { useAutomationEntities } from '@queries/agent-schedule/entities';
@@ -296,21 +291,6 @@ registerComponent(
lazy(() => import('@app/component/import-linear/ImportLinear'))
);
registerComponent('settings', () => <SettingsPanelComponentWrapper />);
-const NewOnboarding = lazy(
- () => import('@app/component/onboarding/onboarding')
-);
-const OldOnboarding = lazy(
- () => import('@app/component/interactive-onboarding/InteractiveOnboarding')
-);
-registerComponent('welcome', () => (
- <ShowFeatureFlag
- key="enable-new-onboarding"
- enabledOverride={ENABLE_NEW_ONBOARDING_OVERRIDE}
- fallback={<OldOnboarding />}
- >
- <NewOnboarding />
- </ShowFeatureFlag>
-));
if (LOCAL_ONLY) {
registerComponent(