Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

feat(frontend): introduce the expert team model in copilot onboarding (#14465)

Abhimanyu Yadavcc9081228e77
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx
index 155636649c..c3e4627d11 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx
@@ -317,10 +317,10 @@ export function ChatInput({
<InputGroup
className={cn(
"relative z-10 flex-col overflow-hidden !rounded-[2rem] border-zinc-200 shadow-[0_1px_2px_rgba(0,0,0,0.04),0_4px_20px_rgba(0,0,0,0.08)] has-[[data-slot=input-group-control]:focus-visible]:border-zinc-300 has-[[data-slot=input-group-control]:focus-visible]:ring-0",
- // Card composer: a hairline ring and a shallow drop instead of the
- // pill's deep shadow, so it reads as a surface the text sits on.
+ // Card composer: a hairline border and a shallow drop instead of
+ // the pill's deep shadow, so it reads as a surface the text sits on.
stacked &&
- "gap-3 !rounded-3xl border-transparent px-3.5 pb-3.5 pt-3 shadow-[0_0_0_0.5px_rgba(0,0,0,0.08),0_1px_2px_rgba(0,0,0,0.05),0_2px_4px_rgba(0,0,0,0.02)] has-[[data-slot=input-group-control]:focus-visible]:border-transparent",
+ "gap-3 !rounded-3xl border-zinc-200 px-3.5 pb-3.5 pt-3 shadow-[0_1px_2px_rgba(0,0,0,0.05),0_2px_4px_rgba(0,0,0,0.02)] has-[[data-slot=input-group-control]:focus-visible]:border-zinc-300",
isCompact &&
"!rounded-xl border-zinc-200 shadow-[0_1px_2px_rgba(0,0,0,0.04)] has-[[data-slot=input-group-control]:focus-visible]:border-zinc-400",
isRecording &&
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx
index c3fb82ada6..bc6741091b 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx
@@ -181,22 +181,14 @@ export function EmptySession({
: "w-full px-2",
// The greeting's prompt card bleeds 1.25rem past the text
// (-mx-5); the composer stretches the same amount so their
- // borders line up. The regular hero keeps it centered, and
- // drops the card chrome so the composer pill is the only
- // outline on screen.
+ // edges line up. No chrome of its own: the composer card is
+ // the only outline on screen. The regular hero keeps it
+ // centered.
isBrainDumpEnabled &&
(intro.isVisible
- ? "-mx-5 max-w-[50.5rem] overflow-hidden rounded-xlarge border"
+ ? "-mx-5 max-w-[50.5rem]"
: "mx-auto w-full max-w-[42rem]"),
)}
- style={
- isBrainDumpEnabled && intro.isVisible
- ? {
- borderColor: "#e4e4e7",
- boxShadow: "0 2px 8px rgba(0,0,0,0.04)",
- }
- : undefined
- }
>
<ChatInput
inputId="chat-input-empty"
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/components/EmptyHero.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/components/EmptyHero.tsx
index 5922c9e39a..21f532b151 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/components/EmptyHero.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/components/EmptyHero.tsx
@@ -18,8 +18,8 @@ export function EmptyHero({ name, intro }: Props) {
return (
<>
<div className="mb-1 flex items-center justify-center gap-3">
- <Text variant="h3" className="!text-[1.375rem] text-zinc-700">
- Hey, <span className="text-violet-600">{name}</span>
+ <Text variant="h4" tone="primary">
+ Hey, <span className="text-zinc-900">{name}</span>
<EditNameDialog currentName={name} />
</Text>
</div>
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/OnboardingIntroCard.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/OnboardingIntroCard.tsx
index 4974d8f4ec..6b54811db7 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/OnboardingIntroCard.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/OnboardingIntroCard.tsx
@@ -6,13 +6,11 @@ import {
GREETING_ORB_LAYOUT_ID,
ORB_FLIP_TRANSITION,
ORB_FLIP_TRANSITION_REDUCED,
- ORB_PURPLE,
SMALL_ORB_PARAMS,
} from "../../helpers/greetingOrb";
import { Icon } from "@/components/atoms/Icon/Icon";
import { Text } from "@/components/atoms/Text/Text";
import { useToast } from "@/components/molecules/Toast/use-toast";
-import { TextGenerateEffect } from "@/components/ui/text-generate-effect";
import {
Tooltip,
TooltipContent,
@@ -86,19 +84,16 @@ interface Props {
// trip to finish.
const HEADING_START = 0.2;
const GREETING_START = 0.5;
-const WORD_STAGGER = 0.08;
-const ROW_STAGGER = 0.12;
+const GREETING_DURATION = 0.45;
const ROW_START_BUFFER = 0.3;
const FOOTER_BUFFER = 0.35;
// One reveal schedule shared with EmptySession so the composer can enter
-// after everything here has finished. All timings hang off the greeting's
-// word count — the prompts wait for the last word, the footer waits for
-// the last row, the composer comes after the footer.
-export function introRevealTimings(greeting: string, promptCount: number) {
- const words = greeting.split(" ").filter(Boolean).length;
- const promptsStart = GREETING_START + words * WORD_STAGGER + ROW_START_BUFFER;
- const footerStart = promptsStart + promptCount * ROW_STAGGER + FOOTER_BUFFER;
+// after everything here has finished. The greeting lands in one piece, the
+// prompt list follows as one block, then the footer, then the composer.
+export function introRevealTimings() {
+ const promptsStart = GREETING_START + GREETING_DURATION + ROW_START_BUFFER;
+ const footerStart = promptsStart + FOOTER_BUFFER;
const composerStart = footerStart + 0.4;
return { promptsStart, footerStart, composerStart };
}
@@ -134,10 +129,7 @@ export function OnboardingIntroCard({
setIsCopied(true);
setTimeout(() => setIsCopied(false), 2000);
}
- const { promptsStart, footerStart } = introRevealTimings(
- greeting,
- prompts.length,
- );
+ const { promptsStart, footerStart } = introRevealTimings();
function reveal(delay: number) {
if (prefersReducedMotion) {
@@ -174,8 +166,8 @@ export function OnboardingIntroCard({
<GlassOrb params={SMALL_ORB_PARAMS} />
</motion.span>
<motion.div {...reveal(HEADING_START)}>
- <Text variant="h3" className="!text-[1.25rem] text-zinc-800">
- Hey, <span style={{ color: ORB_PURPLE }}>{name}</span>
+ <Text variant="large-medium" tone="primary">
+ Hey, <span className="text-zinc-900">{name}</span>
</Text>
</motion.div>
{transcript && (
@@ -207,28 +199,23 @@ export function OnboardingIntroCard({
)}
</div>
- <TextGenerateEffect
- words={greeting}
- duration={0.4}
- delay={GREETING_START}
- className="text-left !font-normal [&>div]:!mt-0 [&_div]:!text-[1.25rem] [&_div]:!leading-normal [&_div]:!tracking-normal [&_span]:!text-zinc-700"
- />
+ <motion.div {...reveal(GREETING_START)}>
+ <Text variant="large" tone="secondary" className="text-pretty">
+ {greeting}
+ </Text>
+ </motion.div>
{prompts.length > 0 && (
<motion.ol
{...reveal(promptsStart)}
// Negative margins let the card's border breathe outward while
// the row content (px-5) stays aligned with the text above it.
- className="-mx-5 mt-6 divide-y divide-zinc-100 overflow-hidden rounded-2xl border border-zinc-100 bg-white shadow-sm"
+ className="-mx-5 mt-5 divide-y divide-zinc-100 overflow-hidden rounded-lg border border-zinc-200 bg-white"
>
- {prompts.map((prompt, index) => {
+ {prompts.map((prompt) => {
const promptIcon = PROMPT_ICONS[prompt.icon ?? ""] ?? SparklesIcon;
return (
- <motion.li
- key={prompt.title}
- {...reveal(promptsStart + 0.15 + index * ROW_STAGGER)}
- data-testid="onboarding-intro-prompt"
- >
+ <li key={prompt.title} data-testid="onboarding-intro-prompt">
<button
type="button"
disabled={disabled}
@@ -236,33 +223,30 @@ export function OnboardingIntroCard({
// which also creates the session and retires the greeting
// via the regular first-send path in useCopilotPage.
onClick={() => onSelectPrompt(prompt.prompt)}
- className="group flex w-full cursor-pointer items-center gap-4 px-5 py-4 text-left transition-colors duration-150 hover:bg-violet-50/60 disabled:cursor-default disabled:opacity-60 disabled:hover:bg-transparent"
+ className="group flex w-full cursor-pointer items-center gap-3 px-4 py-3 text-left transition-colors duration-150 hover:bg-zinc-50 disabled:cursor-default disabled:opacity-60 disabled:hover:bg-transparent"
>
<Icon
icon={promptIcon}
- size={18}
- className="shrink-0 text-violet-500"
+ size={15}
+ className="shrink-0 text-zinc-400"
/>
- <Text
- variant="body-medium"
- className="!text-[0.9375rem] !text-zinc-800"
- >
+ <Text variant="body-medium" tone="primary">
{prompt.title}
</Text>
<Icon
icon={ArrowRight01Icon}
- size={16}
- className="ml-auto shrink-0 text-violet-500 transition-transform duration-150 ease-out group-hover:translate-x-1"
+ size={15}
+ className="ml-auto shrink-0 text-zinc-400 transition-transform duration-150 ease-out group-hover:translate-x-1"
/>
</button>
- </motion.li>
+ </li>
);
})}
</motion.ol>
)}
<motion.div {...reveal(footerStart)}>
- <Text variant="body" className="mt-6 !text-[0.9375rem] !text-zinc-500">
+ <Text variant="body" tone="muted" className="mt-5">
Want to do something else? Just write it in the textbox below.
</Text>
</motion.div>
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/OnboardingIntroCard.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/OnboardingIntroCard.test.tsx
index d2deb49cd3..b6943ab6c4 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/OnboardingIntroCard.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/OnboardingIntroCard.test.tsx
@@ -239,40 +239,11 @@ describe("OnboardingIntroCard — transcript copy", () => {
});
describe("introRevealTimings", () => {
- it("pushes every stage back as the greeting gets longer", () => {
- const short = introRevealTimings("Hello there", 0);
- const long = introRevealTimings("Hello there, this is a longer line", 0);
-
- expect(short.promptsStart).toBeCloseTo(0.5 + 2 * 0.08 + 0.3, 5);
- expect(long.promptsStart).toBeGreaterThan(short.promptsStart);
- expect(long.footerStart).toBeGreaterThan(short.footerStart);
- expect(long.composerStart).toBeGreaterThan(short.composerStart);
- });
-
- it("staggers the footer behind the last prompt row and the composer behind the footer", () => {
- const none = introRevealTimings("Hello there", 0);
- const three = introRevealTimings("Hello there", 3);
-
- expect(three.promptsStart).toBe(none.promptsStart);
- expect(three.footerStart - none.footerStart).toBeCloseTo(3 * 0.12, 5);
- expect(three.composerStart - three.footerStart).toBeCloseTo(0.4, 5);
- });
-
- it("ignores empty words so padding does not delay the reveal", () => {
- const padded = introRevealTimings(" Hello there ", 2);
- const tidy = introRevealTimings("Hello there", 2);
-
- expect(padded).toEqual(tidy);
- });
-
- it("still produces an ordered schedule for an empty greeting", () => {
- const { promptsStart, footerStart, composerStart } = introRevealTimings(
- "",
- 0,
- );
+ it("orders greeting, prompts, footer and composer with fixed offsets", () => {
+ const { promptsStart, footerStart, composerStart } = introRevealTimings();
- expect(promptsStart).toBeCloseTo(0.8, 5);
- expect(footerStart).toBeGreaterThan(promptsStart);
- expect(composerStart).toBeGreaterThan(footerStart);
+ expect(promptsStart).toBeCloseTo(0.5 + 0.45 + 0.3, 5);
+ expect(footerStart - promptsStart).toBeCloseTo(0.35, 5);
+ expect(composerStart - footerStart).toBeCloseTo(0.4, 5);
});
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/useOnboardingIntroCard.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/useOnboardingIntroCard.test.tsx
index 2e19fac52d..616afe5885 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/useOnboardingIntroCard.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/useOnboardingIntroCard.test.tsx
@@ -21,7 +21,11 @@ vi.mock("@/lib/auth/hooks/useAuth", () => ({
const flags = vi.hoisted(() => ({ current: {} as Record<string, boolean> }));
const flagsReady = vi.hoisted(() => ({ current: true }));
vi.mock("@/services/feature-flags/use-get-flag", () => ({
- Flag: { ONBOARDING_BRAIN_DUMP: "onboarding-brain-dump" },
+ Flag: {
+ ONBOARDING_BRAIN_DUMP: "onboarding-brain-dump",
+ ONBOARDING_EXPERT_TEAM: "onboarding-expert-team",
+ HIRE_EXPERTS: "hire-experts",
+ },
useGetFlag: (flag: string) => flags.current[flag] ?? false,
useFlagStatus: (flag: string) => ({
enabled: flags.current[flag] ?? false,
@@ -458,3 +462,30 @@ describe("useOnboardingIntroCard — the greeting itself", () => {
expect(result.current.greeting).toBe("");
});
});
+
+describe("useOnboardingIntroCard — team selection belongs to the wizard", () => {
+ it.each([false, true])(
+ "does not poll for a team after the greeting settles (done=%s)",
+ async (greetingDone) => {
+ flags.current = {
+ "onboarding-brain-dump": true,
+ "onboarding-expert-team": true,
+ "hire-experts": true,
+ };
+ const requests = countIntroRequests({
+ ...READY_INTRO,
+ greeting_done: greetingDone,
+ team_pending: true,
+ });
+ const { result } = renderIntro();
+ await waitFor(() => expect(requests).toHaveLength(1));
+ await waitFor(() =>
+ expect(result.current.isAwaitingGreeting).toBe(false),
+ );
+ expect(result.current.isVisible).toBe(!greetingDone);
+ await new Promise((resolve) => setTimeout(resolve, 3200));
+ expect(requests).toHaveLength(1);
+ },
+ 10_000,
+ );
+});
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/useOnboardingIntroCard.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/useOnboardingIntroCard.ts
index 67b295aa75..2533e2e0c6 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/useOnboardingIntroCard.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/useOnboardingIntroCard.ts
@@ -34,7 +34,6 @@ export function useOnboardingIntroCard() {
const { enabled: isBrainDumpEnabled, ready: isFlagReady } = useFlagStatus(
Flag.ONBOARDING_BRAIN_DUMP,
);
-
// localStorage answers first so a returning user never flashes the
// greeting; only when it has no answer do we ask the server. The flag
// is keyed to the user id, so a fresh account on the same browser
@@ -111,9 +110,8 @@ export function useOnboardingIntroCard() {
const latest = query.state.data;
if (!latest || latest.status !== 200) return false;
const body = latest.data;
- if (!body.greeting_done && body.greeting_pending) {
- return PENDING_POLL_MS;
- }
+ if (body.greeting_done) return false;
+ if (body.greeting_pending) return PENDING_POLL_MS;
return false;
},
},
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/ConnectProviderRow.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/ConnectProviderRow.tsx
index ce6dff0a47..e58f44695c 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/ConnectProviderRow.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/ConnectProviderRow.tsx
@@ -36,14 +36,14 @@ export function ConnectProviderRow({
type="button"
onClick={() => onSelect(provider.id)}
className={cn(
- "group flex h-14 w-full items-center gap-2.5 rounded-xl bg-neutral-100 px-3 text-left transition-colors hover:bg-neutral-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-purple-400 active:bg-neutral-200",
+ "group flex h-14 w-full items-center gap-2.5 rounded-md border border-zinc-200 bg-white px-3 text-left transition-colors hover:bg-zinc-50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-zinc-900 active:bg-zinc-100",
className,
)}
>
{broken ? (
<div
aria-hidden
- className="flex size-7 shrink-0 items-center justify-center rounded-md bg-white text-[12px] font-semibold uppercase text-zinc-600"
+ className="flex size-7 shrink-0 items-center justify-center rounded-md bg-zinc-100 text-[12px] font-semibold uppercase text-zinc-600"
>
{provider.name?.charAt(0) ?? provider.id.charAt(0)}
</div>
@@ -68,20 +68,20 @@ export function ConnectProviderRow({
{isConnected && (
<Icon
icon={CheckmarkCircle02Icon}
- size={18}
+ size={15}
className="shrink-0 text-emerald-500"
/>
)}
</span>
{description && (
- <span className="truncate text-[11px] leading-[16px] text-zinc-500">
+ <span className="truncate text-[12px] leading-[16px] text-zinc-500">
{description}
</span>
)}
</span>
<span
aria-hidden
- className="flex size-6 shrink-0 items-center justify-center rounded-lg bg-zinc-700 text-white transition-transform group-hover:bg-zinc-800 group-active:scale-[0.96]"
+ className="flex size-6 shrink-0 items-center justify-center rounded-md bg-zinc-100 text-zinc-500 transition-colors group-hover:bg-zinc-200 group-hover:text-zinc-700"
>
<Icon icon={Add01Icon} size={14} />
</span>
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/ConnectToolsPanel.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/ConnectToolsPanel.tsx
index 9aabdf0c62..fe1e42c4e4 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/ConnectToolsPanel.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/ConnectToolsPanel.tsx
@@ -79,8 +79,8 @@ export function ConnectToolsPanel({ onBack, onNext }: Props) {
}, [selectedProvider, handleBackToList, onBack]);
return (
- <div className="flex flex-col gap-4 p-6">
- <Text variant="h3" className="!text-[1.25rem] text-zinc-900">
+ <div className="flex flex-col gap-4 px-5 pb-5 pt-4">
+ <Text variant="h5" tone="primary">
Connect your tools
</Text>
@@ -122,7 +122,7 @@ export function ConnectToolsPanel({ onBack, onNext }: Props) {
{isLoading ? (
<div className="flex flex-col gap-2">
{[0, 1, 2].map((row) => (
- <Skeleton key={row} className="h-16 w-full rounded-xl" />
+ <Skeleton key={row} className="h-14 w-full rounded-md" />
))}
</div>
) : isError ? (
@@ -140,8 +140,8 @@ export function ConnectToolsPanel({ onBack, onNext }: Props) {
<div className="relative w-full">
<Icon
icon={Search01Icon}
- size={20}
- className="pointer-events-none absolute left-4 top-1/2 -translate-y-1/2 text-[#83838C]"
+ size={16}
+ className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-zinc-400"
/>
<input
type="text"
@@ -149,19 +149,19 @@ export function ConnectToolsPanel({ onBack, onNext }: Props) {
onChange={(e) => setQuery(e.target.value)}
placeholder="Search services..."
aria-label="Search services"
- className="h-[46px] w-full rounded-xl border border-[#DADADC] bg-white pl-12 pr-4 text-sm leading-[22px] text-[#1F1F20] transition-colors placeholder:text-[#83838C] focus:border-violet-500 focus:outline-none"
+ className="h-9 w-full rounded-md border border-zinc-200 bg-white pl-9 pr-3 text-sm leading-[22px] text-zinc-900 transition-colors placeholder:text-zinc-400 focus:border-zinc-900 focus:outline-none"
/>
</div>
{query.trim() ? (
providers.length === 0 ? (
- <div className="flex flex-col items-center justify-center gap-2 rounded-2xl border border-dashed border-[#DADADC] py-8 text-center">
+ <div className="flex flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-zinc-200 py-8 text-center">
<Icon
icon={Plug01Icon}
- size={24}
- className="text-[#83838C]"
+ size={16}
+ className="text-zinc-400"
/>
- <Text variant="body" className="text-[#505057]">
+ <Text variant="body" tone="secondary">
{`No services match "${query.trim()}"`}
</Text>
</div>
@@ -180,11 +180,11 @@ export function ConnectToolsPanel({ onBack, onNext }: Props) {
)
) : recommendedProviders.length > 0 ? (
<div className="flex flex-col gap-2">
- <span className="text-xs font-medium text-violet-600">
+ <Text variant="eyebrow" as="span">
{isPersonalized
? "Recommended from our conversation"
: "Popular places to start"}
- </span>
+ </Text>
<ul className="grid grid-cols-2 gap-2">
{recommendedProviders.map((provider) => (
<li key={provider.id}>
@@ -199,7 +199,11 @@ export function ConnectToolsPanel({ onBack, onNext }: Props) {
</ul>
</div>
) : (
- <Text variant="body" className="text-center text-[#505057]">
+ <Text
+ variant="body"
+ tone="secondary"
+ className="text-center"
+ >
Search to find a service to connect.
</Text>
)}
@@ -210,16 +214,16 @@ export function ConnectToolsPanel({ onBack, onNext }: Props) {
</AnimatePresence>
</div>
- <div className="flex items-center justify-end gap-3">
+ <div className="flex items-center justify-end gap-2">
{selectedProvider ? (
<>
- <Button variant="secondary" size="small" onClick={handleBackToList}>
+ <Button variant="outline" size="xs" onClick={handleBackToList}>
Back
</Button>
{showContinue && (
<Button
variant="primary"
- size="small"
+ size="xs"
disabled={isContinueDisabled}
loading={isConnecting}
onClick={handleContinue}
@@ -230,10 +234,10 @@ export function ConnectToolsPanel({ onBack, onNext }: Props) {
</>
) : (
<>
- <Button variant="secondary" size="small" onClick={onBack}>
+ <Button variant="outline" size="xs" onClick={onBack}>
Back
</Button>
- <Button variant="primary" size="small" onClick={onNext}>
+ <Button variant="primary" size="xs" onClick={onNext}>
Next
</Button>
</>
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/OnboardingWelcomeDialog.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/OnboardingWelcomeDialog.tsx
index d6be27eae5..ef681f222c 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/OnboardingWelcomeDialog.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/OnboardingWelcomeDialog.tsx
@@ -2,9 +2,11 @@
import { usePostV1CompleteOnboardingStep } from "@/app/api/__generated__/endpoints/onboarding/onboarding";
import { Button } from "@/components/atoms/Button/Button";
+import { GlassPixelBackdrop } from "@/components/atoms/GlassPixelBackdrop/GlassPixelBackdrop";
import { Icon } from "@/components/atoms/Icon/Icon";
import { Text } from "@/components/atoms/Text/Text";
import { useToast } from "@/components/molecules/Toast/use-toast";
+import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
import { trackBrainDump } from "@/services/onboarding/brain-dump-analytics";
import {
ArrowLeft01Icon,
@@ -12,13 +14,14 @@ import {
ElectricPlugsIcon,
GraduationCapIcon,
SparklesIcon,
+ Sun01Icon,
+ UserGroupIcon,
} from "@hugeicons/core-free-icons";
import type { IconSvgElement } from "@hugeicons/react";
import { AnimatePresence, motion } from "framer-motion";
import { useEffect, useRef, useState } from "react";
import { useMeasuredHeight } from "@/components/contextual/IntegrationsPanel/components/ConnectServiceDialog/useMeasuredHeight";
import { ConnectToolsPanel } from "./ConnectToolsPanel";
-import { GlassPixelBackdrop } from "@/components/atoms/GlassPixelBackdrop/GlassPixelBackdrop";
import { isKey } from "@/lib/keyboard";
interface Props {
@@ -30,7 +33,7 @@ interface CapabilityCard {
title: string;
// Capped at 20 words — an icon, short title, one sentence.
body: string;
- /** Stage art: big duotone-violet icon in a white tile. */
+ /** Stage art: a zinc icon in a white tile. */
icon?: IconSvgElement;
/** Expands the dialog into the embedded provider picker. */
cta?: { label: string };
@@ -60,8 +63,35 @@ const CARDS: CapabilityCard[] = [
},
];
+// With the team feature on the deck stops being about AutoPilot's own
+// abilities: AutoPilot is the Head of AI, and what the user is about to
+// meet on the greeting page is a team.
+const TEAM_CARDS: CapabilityCard[] = [
+ {
+ title: "Meet your Head of AI.",
+ body: "AutoPilot is yours alone — never shared. It listens, diagnoses, and builds the team that does the work.",
+ icon: SparklesIcon,
+ },
+ {
+ title: "Hire an expert, or raise your own.",
+ body: "Pick a ready-made expert for marketing, sales or ops, or describe a role and raise one from scratch.",
+ icon: UserGroupIcon,
+ },
+ {
+ title: "It works inside your tools.",
+ body: "Slack, Gmail, Notion, GitHub and 40+ more. 500+ blocks under the hood.",
+ icon: ElectricPlugsIcon,
+ cta: { label: "Connect your tools" },
+ },
+ {
+ title: "Every morning, a briefing.",
+ body: "What the team did, what needs you, what's next — before you open a tab.",
+ icon: Sun01Icon,
+ },
+];
+
// First-run capability cards on the copilot home (ChatGPT/Claude style):
-// a tinted stage on top carrying the card's icon, copy below,
+// a stage on top carrying the card's icon, copy below,
// skippable at any card, shown once — completion is recorded server-side
// as the CAPABILITY_CARDS onboarding step. It also buys the background
// pipeline its last seconds: the greeting is only fetched, and only
@@ -84,15 +114,21 @@ export function OnboardingWelcomeDialog({ isOpen, onClose }: Props) {
}),
},
});
- const card = CARDS[cardIndex];
- const isLastCard = cardIndex === CARDS.length - 1;
+ // Child of HIRE_EXPERTS: without hiring there is no team to promise.
+ const isExpertTeamFlagOn = useGetFlag(Flag.ONBOARDING_EXPERT_TEAM);
+ const isHireExpertsFlagOn = useGetFlag(Flag.HIRE_EXPERTS);
+ const isTeamEnabled = Boolean(isExpertTeamFlagOn && isHireExpertsFlagOn);
+ const deck = isTeamEnabled ? "team" : "autopilot";
+ const cards = isTeamEnabled ? TEAM_CARDS : CARDS;
+ const card = cards[cardIndex];
+ const isLastCard = cardIndex === cards.length - 1;
function finish(outcome: "completed" | "skipped") {
trackBrainDump(
outcome === "completed"
? "capability_cards_completed"
: "capability_cards_skipped",
- { card_index: cardIndex },
+ { card_index: cardIndex, deck },
);
completeStep({ params: { step: "CAPABILITY_CARDS" } });
onClose();
@@ -111,14 +147,17 @@ export function OnboardingWelcomeDialog({ isOpen, onClose }: Props) {
window.addEventListener("keydown", handleKeyDown);
return () => window.removeEventListener("keydown", handleKeyDown);
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [isOpen, cardIndex, isConnectOpen]);
+ }, [isOpen, cardIndex, isConnectOpen, deck]);
function handleNext() {
if (isLastCard) {
finish("completed");
return;
}
- trackBrainDump("capability_card_viewed", { card_index: cardIndex + 1 });
+ trackBrainDump("capability_card_viewed", {
+ card_index: cardIndex + 1,
+ deck,
+ });
setCardIndex(cardIndex + 1);
}
@@ -137,15 +176,15 @@ export function OnboardingWelcomeDialog({ isOpen, onClose }: Props) {
aria-label="Welcome to AutoPilot"
>
<motion.div
- initial={{ opacity: 0, y: 16, scale: 0.97, maxWidth: "26rem" }}
+ initial={{ opacity: 0, y: 16, scale: 0.97, maxWidth: "20rem" }}
animate={{
opacity: 1,
y: 0,
scale: 1,
- maxWidth: isConnectOpen ? "30rem" : "26rem",
+ maxWidth: isConnectOpen ? "30rem" : "20rem",
}}
transition={{ duration: 0.45, ease: [0, 0, 0.2, 1] }}
- className="w-full max-w-[26rem] overflow-hidden rounded-3xl bg-white shadow-[0_24px_80px_-24px_rgba(0,0,0,0.3)] outline-none"
+ className="w-full max-w-[20rem] overflow-hidden rounded-xl border border-zinc-200 bg-white shadow-lg outline-none"
ref={dialogRef}
tabIndex={-1}
>
@@ -182,22 +221,19 @@ export function OnboardingWelcomeDialog({ isOpen, onClose }: Props) {
exit={{ opacity: 0, y: -8 }}
transition={{ duration: 0.2, ease: [0, 0, 0.2, 1] }}
>
- {/* Tinted stage: the card's icon floats here. */}
- <div className="relative h-44 bg-gradient-to-br from-[#e6dbff] via-[#ddccff] to-[#d0b9ff]">
+ {/* Stage: the card's icon floats here. */}
+ <div className="relative h-36 bg-gradient-to-br from-violet-100 via-violet-200 to-violet-300">
<GlassPixelBackdrop />
- <span className="absolute left-5 top-4 z-10 flex items-center gap-1 text-xs font-medium text-[#5b21b6]/70">
- {cardIndex > 0 && (
- <button
- type="button"
- aria-label="Previous card"
- onClick={() => setCardIndex(cardIndex - 1)}
- className="-ml-1 flex h-5 w-5 items-center justify-center rounded-full transition-colors hover:bg-white/50"
- >
- <Icon icon={ArrowLeft01Icon} size={13} />
- </button>
- )}
- {cardIndex + 1} of {CARDS.length}
- </span>
+ {cardIndex > 0 && (
+ <button
+ type="button"
+ aria-label="Previous card"
+ onClick={() => setCardIndex(cardIndex - 1)}
+ className="absolute left-3 top-3 z-10 flex size-5 items-center justify-center rounded-full text-violet-800/70 transition-colors hover:bg-white/50"
+ >
+ <Icon icon={ArrowLeft01Icon} size={13} />
+ </button>
+ )}
<AnimatePresence mode="wait">
<motion.div
key={cardIndex}
@@ -210,10 +246,10 @@ export function OnboardingWelcomeDialog({ isOpen, onClose }: Props) {
>
{card.icon && (
<div className="flex h-full items-center justify-center">
- <div className="flex h-20 w-20 items-center justify-center rounded-3xl bg-white shadow-lg">
+ <div className="flex size-14 items-center justify-center rounded-2xl bg-white shadow-md">
<Icon
icon={card.icon}
- size={40}
+ size={28}
className="text-violet-600"
/>
</div>
@@ -224,56 +260,55 @@ export function OnboardingWelcomeDialog({ isOpen, onClose }: Props) {
</div>
{/* Copy + controls, reference-style white lower half. */}
- <div className="flex flex-col gap-3 px-7 pb-7 pt-6 text-left">
- <Text
- variant="h3"
- className="!text-[1.25rem] text-zinc-900"
- >
+ <div className="flex flex-col gap-2 px-5 pb-5 pt-4 text-left">
+ <Text variant="h5" tone="primary">
{card.title}
</Text>
- <Text
- variant="body"
- className="!text-[0.9375rem] !text-zinc-600"
- >
+ <Text variant="body" tone="secondary">
{card.body}
</Text>
{card.cta && (
- <button
- type="button"
+ <Button
+ variant="ghost"
+ size="xs"
+ className="-ml-2.5 w-fit"
onClick={() => setIsConnectOpen(true)}
- className="w-fit text-sm font-medium text-violet-600 underline-offset-4 hover:underline"
>
{card.cta.label}
- </button>
+ </Button>
)}
<div className="mt-3 flex items-center justify-between">
- <div className="flex items-center gap-2">
- {CARDS.map((_, index) => (
+ <div className="flex items-center gap-1.5">
+ {cards.map((_, index) => (
<span
key={index}
className={
index === cardIndex
- ? "h-2 w-6 rounded-full bg-violet-500 transition-all"
- : "h-2 w-2 rounded-full bg-zinc-200 transition-all"
+ ? "h-1.5 w-4 rounded-full bg-zinc-900 transition-all"
+ : "size-1.5 rounded-full bg-zinc-300 transition-all"
}
/>
))}
</div>
- <div className="flex items-center gap-3">
+ <div className="flex items-center gap-2">
<Button
- variant="secondary"
- size="small"
+ variant="ghost"
+ size="xs"
onClick={() => finish("skipped")}
>
Skip
</Button>
<Button
variant="primary"
- size="small"
+ size="xs"
onClick={handleNext}
>
- {isLastCard ? "Meet AutoPilot" : "Next"}
+ {!isLastCard
+ ? "Next"
+ : isTeamEnabled
+ ? "Meet your team"
+ : "Meet AutoPilot"}
</Button>
</div>
</div>
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/welcome-dialog.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/welcome-dialog.test.tsx
index c3fd8a6d88..960f6555e5 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/welcome-dialog.test.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/__tests__/welcome-dialog.test.tsx
@@ -9,6 +9,20 @@ vi.mock("posthog-js", () => ({
default: { capture: (...a: unknown[]) => capture(...a) },
}));
+// All off by default, so every existing assertion keeps describing the
+// flag-off deck; the team tests below turn both flags on.
+const flags = vi.hoisted(() => ({ current: {} as Record<string, boolean> }));
+vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {
+ const actual =
+ await importActual<
+ typeof import("@/services/feature-flags/use-get-flag")
+ >();
+ return {
+ ...actual,
+ useGetFlag: (flag: string) => flags.current[flag] ?? false,
+ };
+});
+
const toastSpy = vi.fn();
vi.mock("@/components/molecules/Toast/use-toast", () => ({
toast: (...args: unknown[]) => toastSpy(...args),
@@ -67,10 +81,11 @@ async function advanceToCard(index: number) {
beforeEach(() => {
capture.mockClear();
toastSpy.mockClear();
+ flags.current = {};
});
describe("OnboardingWelcomeDialog — deck", () => {
- it("renders the first card with its position in the deck and no way back", async () => {
+ it("renders the first card with no way back", async () => {
render(<OnboardingWelcomeDialog isOpen onClose={vi.fn()} />);
expect(await screen.findByText("Meet AutoPilot.")).toBeDefined();
@@ -79,7 +94,6 @@ describe("OnboardingWelcomeDialog — deck", () => {
"It does the work. Ask once, or put it on a schedule. It delivers while you do something else.",
),
).toBeDefined();
- expect(screen.getByText("1 of 4")).toBeDefined();
expect(screen.getByRole("button", { name: "Next" })).toBeDefined();
expect(screen.getByRole("button", { name: "Skip" })).toBeDefined();
expect(screen.queryByRole("button", { name: "Previous card" })).toBeNull();
@@ -92,15 +106,14 @@ describe("OnboardingWelcomeDialog — deck", () => {
expect(
await screen.findByText("It works inside your tools."),
).toBeDefined();
- expect(screen.getByText("2 of 4")).toBeDefined();
expect(capture).toHaveBeenCalledWith("capability_card_viewed", {
card_index: 1,
+ deck: "autopilot",
});
await user.click(screen.getByRole("button", { name: "Previous card" }));
expect(await screen.findByText("Meet AutoPilot.")).toBeDefined();
- expect(screen.getByText("1 of 4")).toBeDefined();
});
it("renders nothing and completes no step while closed", async () => {
@@ -129,6 +142,7 @@ describe("OnboardingWelcomeDialog — completion", () => {
await waitFor(() => expect(steps).toEqual(["CAPABILITY_CARDS"]));
expect(capture).toHaveBeenCalledWith("capability_cards_completed", {
card_index: 3,
+ deck: "autopilot",
});
});
@@ -146,6 +160,7 @@ describe("OnboardingWelcomeDialog — completion", () => {
await waitFor(() => expect(steps).toEqual(["CAPABILITY_CARDS"]));
expect(capture).toHaveBeenCalledWith("capability_cards_skipped", {
card_index: 1,
+ deck: "autopilot",
});
});
@@ -162,6 +177,7 @@ describe("OnboardingWelcomeDialog — completion", () => {
await waitFor(() => expect(steps).toEqual(["CAPABILITY_CARDS"]));
expect(capture).toHaveBeenCalledWith("capability_cards_skipped", {
card_index: 0,
+ deck: "autopilot",
});
});
@@ -210,7 +226,6 @@ describe("OnboardingWelcomeDialog — connect tools CTA", () => {
expect(
await screen.findByText("It works inside your tools."),
).toBeDefined();
- expect(screen.getByText("2 of 4")).toBeDefined();
});
it("steps back out of the picker on Escape instead of ending onboarding", async () => {
@@ -258,6 +273,93 @@ describe("OnboardingWelcomeDialog — connect tools CTA", () => {
await user.click(screen.getByRole("button", { name: "Next" }));
expect(await screen.findByText("It learns how you operate.")).toBeDefined();
- expect(screen.getByText("3 of 4")).toBeDefined();
});
});
+
+describe("OnboardingWelcomeDialog — the team deck", () => {
+ beforeEach(() => {
+ flags.current = {
+ "onboarding-expert-team": true,
+ "hire-experts": true,
+ };
+ });
+
+ it("frames AutoPilot as the Head of AI that builds a team", async () => {
+ render(<OnboardingWelcomeDialog isOpen onClose={vi.fn()} />);
+
+ expect(await screen.findByText("Meet your Head of AI.")).toBeDefined();
+ expect(
+ screen.getByText(
+ "AutoPilot is yours alone — never shared. It listens, diagnoses, and builds the team that does the work.",
+ ),
+ ).toBeDefined();
+ expect(screen.queryByText("Meet AutoPilot.")).toBeNull();
+
+ const user = await advanceToCard(1);
+ expect(
+ await screen.findByText("Hire an expert, or raise your own."),
+ ).toBeDefined();
+
+ await user.click(screen.getByRole("button", { name: "Next" }));
+ // The connect card and its CTA survive the swap.
+ expect(
+ await screen.findByText("It works inside your tools."),
+ ).toBeDefined();
+ expect(
+ screen.getByRole("button", { name: "Connect your tools" }),
+ ).toBeDefined();
+
+ await user.click(screen.getByRole("button", { name: "Next" }));
+ expect(await screen.findByText("Every morning, a briefing.")).toBeDefined();
+ expect(
+ screen.getByRole("button", { name: "Meet your team" }),
+ ).toBeDefined();
+ expect(screen.queryByText("It remembers everything.")).toBeNull();
+ });
+
+ it("keeps the old deck when only the team flag is on", async () => {
+ flags.current = { "onboarding-expert-team": true };
+
+ render(<OnboardingWelcomeDialog isOpen onClose={vi.fn()} />);
+
+ expect(await screen.findByText("Meet AutoPilot.")).toBeDefined();
+ });
+});
+
+it("keeps the last card valid when team flags change in either direction", async () => {
+ flags.current = { "onboarding-expert-team": true, "hire-experts": true };
+ const { rerender } = render(
+ <OnboardingWelcomeDialog isOpen onClose={vi.fn()} />,
+ );
+ await advanceToCard(3);
+ expect(await screen.findByText("Every morning, a briefing.")).toBeDefined();
+ flags.current = {};
+ rerender(<OnboardingWelcomeDialog isOpen onClose={vi.fn()} />);
+ expect(await screen.findByText("It remembers everything.")).toBeDefined();
+ flags.current = { "onboarding-expert-team": true, "hire-experts": true };
+ rerender(<OnboardingWelcomeDialog isOpen onClose={vi.fn()} />);
+ expect(await screen.findByText("Every morning, a briefing.")).toBeDefined();
+});
+
+it.each(["completed", "skipped"] as const)(
+ "identifies the team deck in view and %s events",
+ async (outcome) => {
+ flags.current = { "onboarding-expert-team": true, "hire-experts": true };
+ recordCompletedSteps();
+ render(<OnboardingWelcomeDialog isOpen onClose={vi.fn()} />);
+ const user = await advanceToCard(3);
+ expect(capture).toHaveBeenCalledWith("capability_card_viewed", {
+ card_index: 3,
+ deck: "team",
+ });
+ if (outcome === "completed") {
+ await user.click(screen.getByRole("button", { name: "Meet your team" }));
+ } else {
+ await user.keyboard("{Escape}");
+ }
+ expect(capture).toHaveBeenCalledWith(`capability_cards_${outcome}`, {
+ card_index: 3,
+ deck: "team",
+ });
+ },
+);