diff --git a/tests/e2e/conference-room-typing-intro.spec.ts b/tests/e2e/conference-room-typing-intro.spec.ts
index 40f675d78b9..e251a62946a 100644
--- a/tests/e2e/conference-room-typing-intro.spec.ts
+++ b/tests/e2e/conference-room-typing-intro.spec.ts
@@ -144,7 +144,8 @@ test.describe("Chat launch after onboarding wizard", () => {
await runOnboardingWizard(page, companyName, { source: /Claude/, complete: async () => {
const code = page.getByRole("textbox", { name: "Authorization code", exact: true });
await expect(code).toBeVisible({ timeout: 20_000 });
- await expect(page.getByRole("button", { name: "Sign in to Claude", exact: true })).toBeEnabled();
+ await expect(page.getByRole("link", { name: "Sign in", exact: true })).toBeVisible();
+ await expect(page.getByRole("button", { name: "Next", exact: true })).toBeDisabled();
await expect(page.getByRole("button", { name: "Connect", exact: true })).toHaveCount(0);
await code.evaluate(input => {
const clipboardData = new DataTransfer();
diff --git a/tests/e2e/onboarding-resume.spec.ts b/tests/e2e/onboarding-resume.spec.ts
index 50e0800751d..9af9bf635e0 100644
--- a/tests/e2e/onboarding-resume.spec.ts
+++ b/tests/e2e/onboarding-resume.spec.ts
@@ -195,8 +195,8 @@ test.describe("Onboarding wizard", () => {
await source.waitFor({ timeout: 30_000 });
await source.click();
- const cardInstruction = page.getByText("then come back and enter authorization code");
- const authorizationLink = page.getByRole("link", { name: /^Sign in to / });
+ const cardInstruction = page.getByText("Return to this window and enter the authorization code.");
+ const authorizationLink = page.getByRole("link", { name: "Sign in", exact: true });
await expect(cardInstruction).toBeVisible({ timeout: 30_000 });
await expect(authorizationLink).toBeVisible({ timeout: 15_000 });
diff --git a/tests/e2e/onboarding.spec.ts b/tests/e2e/onboarding.spec.ts
index c9a90b78079..cae3be267ff 100644
--- a/tests/e2e/onboarding.spec.ts
+++ b/tests/e2e/onboarding.spec.ts
@@ -388,7 +388,7 @@ test.describe("Onboarding wizard", () => {
// Nothing before the row is answered: the card is the answer to the tile,
// and the button has nothing to do until there is a source to do it with.
- const cardInstruction = page.getByText("then come back and enter authorization code");
+ const cardInstruction = page.getByText("Return to this window and enter the authorization code.");
await expect(cardInstruction).toHaveCount(0);
await expect(page.getByRole("button", { name: "Next", exact: true })).toBeDisabled();
@@ -399,9 +399,7 @@ test.describe("Onboarding wizard", () => {
await source.click();
await expect(cardInstruction).toBeVisible({ timeout: 30_000 });
- // One destination, two ways to it: the card's own link for anyone
- // finishing in another browser, and the step's button for the flow.
- const cardLink = page.getByRole("link", { name: /^Sign in to / });
+ const cardLink = page.getByRole("link", { name: "Sign in", exact: true });
await expect(cardLink).toBeVisible({ timeout: 15_000 });
await expect(cardLink).toHaveAttribute("href", /claude\.ai\/oauth\/authorize/);
await expect.poll(() => persistedAgentStatus).toBe(200);
@@ -409,8 +407,8 @@ test.describe("Onboarding wizard", () => {
expect(persisted.ok()).toBe(true);
expect(await persisted.json()).toMatchObject({ id: persistedAgentId, name: "Ada", defaultEnvironmentId: null });
await expect(
- page.getByRole("button", { name: /^Sign in to / }),
- ).toBeEnabled({ timeout: 15_000 });
+ page.getByRole("button", { name: "Next", exact: true }),
+ ).toBeDisabled({ timeout: 15_000 });
// No "Use saved login" here: the hire step applies a stored login itself.
await expect(page.getByRole("button", { name: "Use saved login" })).toHaveCount(0);
expect(hireCalled).toBe(false);
diff --git a/ui/src/components/AdapterLoginChrome.tsx b/ui/src/components/AdapterLoginChrome.tsx
index f72e5eb7e46..645eaa897bd 100644
--- a/ui/src/components/AdapterLoginChrome.tsx
+++ b/ui/src/components/AdapterLoginChrome.tsx
@@ -1,4 +1,4 @@
-import { useEffect, useId, useRef, useState, type ClipboardEvent, type ReactNode } from "react";
+import { createContext, useContext, useEffect, useId, useRef, useState, type ClipboardEvent, type ReactNode } from "react";
import { AnimatePresence, motion } from "motion/react";
import { Copy, Check, Loader2 } from "lucide-react";
@@ -72,6 +72,7 @@ export function connectSourceName(adapterType: string): string {
*/
export function OnboardingLoginCard({
instruction,
+ revealTogether = false,
loading = false,
children,
}: {
@@ -81,6 +82,7 @@ export function OnboardingLoginCard({
* be mono to read as a name rather than as prose.
*/
instruction: ReactNode;
+ revealTogether?: boolean;
/**
* Show a spinner instead of the contents, at the same height.
*
@@ -93,6 +95,25 @@ export function OnboardingLoginCard({
loading?: boolean;
children: ReactNode;
}) {
+ if (revealTogether) {
+ return (
+
+
+
{instruction}
+ {children}
+
+ {loading && (
+
+
+
+ )}
+
+ );
+ }
+
if (loading) {
return (
{/* The row is the instruction alone. It shared this line with a Cancel
@@ -339,6 +361,10 @@ export const onboardingCardInputClass =
"placeholder:font-sans placeholder:text-sm placeholder:text-muted-foreground " +
"outline-none focus-visible:ring-ring/50 focus-visible:ring-(length:--rad-3)";
+function focusWithoutScrolling(input: HTMLInputElement | null) {
+ input?.focus({ preventScroll: true });
+}
+
/**
* The card's single-line field, whatever the card is asking for.
*
@@ -366,6 +392,7 @@ export function OnboardingCardField({
disabled,
label = "Authorization code",
description,
+ describedBy,
placeholder = "Paste authorization code here",
masked = false,
autoFocus = false,
@@ -378,6 +405,7 @@ export function OnboardingCardField({
disabled?: boolean;
label?: string;
description?: string;
+ describedBy?: string;
placeholder?: string;
/**
* Dots instead of the value. The key card asks for it because a provider key
@@ -400,10 +428,9 @@ export function OnboardingCardField({
const descriptionId = useId();
const input = (
(null);
+
/** Shared authentication presentation. Hosts retain their existing session lifecycle. */
export function ProviderSubscriptionCard({
providerName,
@@ -453,6 +482,31 @@ export function ProviderSubscriptionCard({
loading?: boolean;
children: ReactNode;
}) {
+ const mark = useContext(OnboardingSignInMark);
+ if (mark && !failure && (mode === "submitted_code" || mode === "displayed_code")) {
+ return (
+
+ 1. Sign into your {providerName} account{mode === "submitted_code" && " and copy the authorization code"}.
+ 2. {mode === "submitted_code" ? "Return to this window and enter the authorization code." : "Enter the code below in the sign-in window."}
+
+ }>
+
+
+ );
+ }
return (
void;
login?: { isolated?: boolean; command?: string; authorizationUrl?: string | null; code?: string | null; accountLabel?: string | null; submitCode?: (code: string) => Promise; preparing: boolean; status?: "ready" | "sign_in_required" | "expired" | null; error: string | null; retry: () => void };
}) {
+ const onboardingSignIn = useContext(OnboardingSignInMark);
const [showCommand, setShowCommand] = useState(false);
const [browserCode, setBrowserCode] = useState("");
const [submitting, setSubmitting] = useState(false);
@@ -706,7 +761,7 @@ export function LocalProviderLoginInstructions({ adapterType, login, hostedRedir
onSubmit={() => void submitBrowserCode()}
disabled={submitting}
/>
-
+ {!onboardingSignIn && }
: hostedGoogleRedirect ?
{optionalHostedGoogleRedirect
diff --git a/ui/src/components/OnboardingWizard.tsx b/ui/src/components/OnboardingWizard.tsx
index dd509235fb6..835eba6e3b3 100644
--- a/ui/src/components/OnboardingWizard.tsx
+++ b/ui/src/components/OnboardingWizard.tsx
@@ -1,3 +1,4 @@
+import { OnboardingSignInMark } from "./AdapterLoginChrome";
import type { AiConnectionLoginIntent } from "@paperclipai/shared";
import { cancelAdapterLoginSession, cancelPendingAdapterLogin, matchesAdapterLoginTarget } from "./useAdapterLoginCancellation";
import { useQueryView } from "@/components/QueryView";
@@ -72,6 +73,7 @@ type ConnectPhase =
| "unwindRow";
function resolveOnboardingConnectCta(input: {
+ passiveSubscriptionFooter: boolean;
setupError: boolean;
retryLogin: boolean;
connectProgress: string | null;
@@ -87,6 +89,7 @@ function resolveOnboardingConnectCta(input: {
}): { label: string; icon: FooterPrimaryIcon; disabled: boolean } {
if (input.setupError) return { label: "Retry", icon: "arrow", disabled: false };
if (input.retryLogin) return { label: "Retry sign-in", icon: "arrow", disabled: false };
+ if (input.passiveSubscriptionFooter) return { label: "Next", icon: "arrow", disabled: true };
if (input.connectProgress) {
return { label: input.adapterEnvLoading ? "Testing…" : input.connectProgress, icon: "spinner", disabled: true };
}
@@ -267,7 +270,7 @@ const MODEL_SOURCE_BRAND_MARKS: Record = {
*/
function OpenAiBlossom({ className }: { className?: string }) {
return (
-