Files
PaperClipAI/ui/src/components/onboarding/OnboardingPrimitives.tsx
T
Tonio 539c9212f4 fix(onboarding): keep the pasted code on screen, and make the auto-copy real (#12921)
The Claude card cleared its field the instant the paste was submitted, so the code appeared and vanished in the same breath and the seconds that followed had no feedback at all - it read as the paste having been dropped. The code stays now; the field is disabled and the step's button carries the status. Scoped to the onboarding chrome: the panel in the agent form stays open long after its login and has its own status area, so clearing is still right there.

The OpenAI card's auto-copy took its latch before the attempt rather than on success, so the first refusal was permanent - and the first attempt is the one most likely to be refused, since it fires while the card is still arriving. It also ran with an empty code on the paths where the row renders before the server's one-time prompt has a value, which wrote nothing and then said Copied! over whatever the clipboard already held. It now waits for the document to have focus, retries when focus returns, guards against a second attempt while one is in flight, and only latches once a write has actually landed.

The arc's question is a quarter larger, 36px to 45px, as a token with its own leading. paperclipai/paperclip-cloud#400 moves the signup wizard's matching heading by the same quarter - the two flows are pinned to each other on purpose.
2026-09-06 09:02:21 -07:00

48 lines
1.2 KiB
TypeScript

// Presentational primitives for the onboarding wizard's agent arc, ported from
// the onboarding prototype onto the repo's design tokens. No backend logic
// lives here — these are pure view pieces.
import type { ReactNode } from "react";
import { cn } from "../../lib/utils";
/** The centered card frame each step of the arc sits in. */
export function OnboardingCard({
children,
className,
}: {
children: ReactNode;
className?: string;
}) {
return (
<div
className={cn(
"w-(--sz-560px) max-w-full rounded-xl border border-border bg-card px-8 py-10 sm:px-10 sm:py-11",
className,
)}
>
{children}
</div>
);
}
/** Display heading + supporting lede, ported from the prototype's hero type. */
export function OnboardingHeading({
title,
lede,
center,
}: {
title: ReactNode;
lede?: ReactNode;
center?: boolean;
}) {
return (
<div className={cn("space-y-2", center && "text-center")}>
<h1 className="text-(length:--text-onboarding-title) font-semibold leading-(--leading-onboarding-title) tracking-tight text-foreground">
{title}
</h1>
{lede ? (
<p className="text-base leading-relaxed text-muted-foreground">{lede}</p>
) : null}
</div>
);
}