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.

fix(frontend): keep onboarding brain dump visible on short screens (#15610)

Nicholas Tindlef9acc70937eb
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/brain-dump.test.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/brain-dump.test.tsx
index 739734f27a..c217217bc4 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/brain-dump.test.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/brain-dump.test.tsx
@@ -391,6 +391,22 @@ afterEach(() => {
});
describe("onboarding brain dump — flag gating", () => {
+ it("explains what to share before choosing Talk or Write", async () => {
+ mockFlags = { "onboarding-brain-dump": true };
+ landOnPainPointsStep();
+
+ render(<OnboardingPage />);
+
+ expect(
+ await screen.findByText(
+ "Tell me what you do and what eats up your week. Two or three minutes is plenty. You can type instead if you prefer.",
+ ),
+ ).toBeDefined();
+ expect(screen.getByRole("button", { name: "Talk" })).toBeDefined();
+ expect(screen.getByRole("button", { name: "Write" })).toBeDefined();
+ expect(getUserMedia).not.toHaveBeenCalled();
+ });
+
it("renders the brain dump in the pillbox slot when the flag is on", async () => {
mockFlags = { "onboarding-brain-dump": true };
landOnPainPointsStep();
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/BrainDumpStep.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/BrainDumpStep.tsx
index 4c3a17efeb..a862db29b2 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/BrainDumpStep.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/BrainDumpStep.tsx
@@ -32,7 +32,6 @@ export function BrainDumpStep() {
const dump = useBrainDumpStep();
const isRecording = dump.screen === "recording";
const isProcessing = dump.screen === "processing";
- const isMicScreen = dump.screen === "rest" || isRecording;
const isTyping = dump.screen === "typing";
const showPrivacyNote =
dump.screen !== "failed" &&
@@ -52,7 +51,7 @@ export function BrainDumpStep() {
<>
<RevealGroup
className={cn(
- "-mt-44 flex w-full flex-col items-center gap-8 px-4",
+ "flex w-full flex-col items-center gap-6 px-4",
isTyping ? "w-[calc(100vw-3rem)] max-w-3xl" : "max-w-2xl",
)}
>
@@ -82,7 +81,7 @@ export function BrainDumpStep() {
<RevealItem>
<SwapFade
swapKey={isRecording ? "timer" : "headline"}
- className="flex h-10 items-center justify-center"
+ className="flex min-h-10 items-center justify-center"
>
{isRecording ? (
<ElapsedTime seconds={dump.elapsedSeconds} />
@@ -97,6 +96,14 @@ export function BrainDumpStep() {
)}
</SwapFade>
</RevealItem>
+ {dump.screen === "rest" && (
+ <RevealItem>
+ <Text variant="body" tone="muted" className="max-w-lg">
+ Tell me what you do and what eats up your week. Two or three
+ minutes is plenty. You can type instead if you prefer.
+ </Text>
+ </RevealItem>
+ )}
</div>
{orbScreen && (
@@ -105,10 +112,7 @@ export function BrainDumpStep() {
className="flex w-full flex-col items-center gap-4"
>
<MicButton screen={orbScreen} audioStream={dump.audioStream} />
- {/* One fixed-height slot holds whichever control the screen
- needs, so switching between the mic, the recording controls
- and the composer never moves the avatar or the headline. */}
- <div className="flex min-h-[236px] w-full flex-col items-center">
+ <div className="flex w-full flex-col items-center">
{isTyping ? (
<TypedFallback
value={dump.typedText}
@@ -138,25 +142,12 @@ export function BrainDumpStep() {
)
)}
</div>
- {/* Both slots keep their height across rest → recording →
- processing, so advancing a screen swaps their contents without
- nudging the orb or the headline. Failure has its own layout
- below the orb and needs neither. */}
- {orbScreen !== "failed" && !isRecording && (
- <>
- <div className="flex h-10 w-full items-center justify-center">
- <SwapFade
- swapKey={orbScreen}
- className="flex w-full justify-center"
- >
- <OrbCaption
- screen={orbScreen}
- reachedTimeLimit={dump.reachedTimeLimit}
- />
- </SwapFade>
- </div>
- <div className="flex h-10 items-center justify-center" />
- </>
+ {isProcessing && (
+ <Text variant="body" tone="muted" className="text-center">
+ {dump.reachedTimeLimit
+ ? TIME_LIMIT_CAPTION
+ : "Got it. One second…"}
+ </Text>
)}
</RevealItem>
)}
@@ -191,53 +182,48 @@ export function BrainDumpStep() {
/>
</RevealItem>
)}
- </RevealGroup>
-
- {/* Viewport-anchored, and kept outside the reveal group: an ancestor
- that animates `filter` or `transform` would turn these into
- absolutely positioned elements. */}
- {!isRecording &&
- (isMicScreen ||
- isTyping ||
- dump.screen === "failed" ||
- dump.screen === "recovery") && (
- <div className="fixed inset-x-0 bottom-32 flex justify-center px-4">
- <SwapFade swapKey={dump.screen}>
- {dump.screen === "failed" && (
- <Button
- variant="ghost"
- size="xs"
- onClick={dump.showTyping}
- className="underline underline-offset-4"
- >
- type instead
- </Button>
- )}
- {isTyping && !dump.isMicBlocked && (
- <Button
- variant="ghost"
- size="xs"
- onClick={dump.showRecording}
- className="underline underline-offset-4"
- >
- record instead
- </Button>
- )}
- {dump.screen === "recovery" && (
- <Button
- variant="ghost"
- size="xs"
- onClick={dump.handleTypeInsteadOfRecovered}
- className="underline underline-offset-4"
- >
- type instead
- </Button>
- )}
- </SwapFade>
- </div>
- )}
+ {!isRecording &&
+ (isTyping ||
+ dump.screen === "failed" ||
+ dump.screen === "recovery") && (
+ <div className="flex justify-center">
+ <SwapFade swapKey={dump.screen}>
+ {dump.screen === "failed" && (
+ <Button
+ variant="ghost"
+ size="xs"
+ onClick={dump.showTyping}
+ className="underline underline-offset-4"
+ >
+ type instead
+ </Button>
+ )}
+ {isTyping && !dump.isMicBlocked && (
+ <Button
+ variant="ghost"
+ size="xs"
+ onClick={dump.showRecording}
+ className="underline underline-offset-4"
+ >
+ record instead
+ </Button>
+ )}
+ {dump.screen === "recovery" && (
+ <Button
+ variant="ghost"
+ size="xs"
+ onClick={dump.handleTypeInsteadOfRecovered}
+ className="underline underline-offset-4"
+ >
+ type instead
+ </Button>
+ )}
+ </SwapFade>
+ </div>
+ )}
- {showPrivacyNote && !isRecording && <PrivacyNote />}
+ {showPrivacyNote && !isRecording && <PrivacyNote />}
+ </RevealGroup>
</>
);
}
@@ -262,21 +248,3 @@ function stateHeadline(
return INSUFFICIENT_HEADLINES[insufficientMode];
return restHeadline;
}
-
-function OrbCaption({
- screen,
- reachedTimeLimit,
-}: {
- screen: OrbScreen;
- reachedTimeLimit: boolean;
-}) {
- if (screen === "processing") {
- return (
- <Text variant="body" tone="muted">
- {reachedTimeLimit ? TIME_LIMIT_CAPTION : "Got it. One second…"}
- </Text>
- );
- }
-
- return null;
-}
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
index 4ba1670e0c..407892cab1 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
@@ -9,7 +9,7 @@ const PRIVACY_COPY =
export function PrivacyNote() {
return (
- <div className="fixed inset-x-0 bottom-20 flex items-center justify-center gap-2 px-4">
+ <div className="flex items-center justify-center gap-2 px-4">
<Icon icon={LockIcon} size={14} className="shrink-0 text-zinc-400" />
<Text
variant="small"