Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
Show new organizations a Getting started track in the cloud sidebar (SKY-15298) (#8391)
Marc Kelechava0479adc965f8
diff --git a/skyvern-frontend/src/components/SidebarResourceLinks.tsx b/skyvern-frontend/src/components/SidebarResourceLinks.tsxindex 553c65d0b..df6478afa 100644--- a/skyvern-frontend/src/components/SidebarResourceLinks.tsx+++ b/skyvern-frontend/src/components/SidebarResourceLinks.tsx@@ -10,6 +10,7 @@ import {starCountFormatter,useGithubStarCount,} from "@/hooks/useGithubStarCount";+import { DISCORD_INVITE_URL, GITHUB_REPO_URL } from "@/util/externalLinks";import { cn } from "@/util/utils";type Props = {@@ -24,13 +25,13 @@ const links = [},{label: "GitHub",- href: "https://github.com/skyvern-ai/skyvern",+ href: GITHUB_REPO_URL,icon: <GitHubLogoIcon className="size-4" />,showStars: true,},{label: "Discord",- href: "https://discord.com/invite/fG2XXEuQX3",+ href: DISCORD_INVITE_URL,icon: <DiscordLogoIcon className="size-4" />,},{diff --git a/skyvern-frontend/src/components/SidebarTreeNav.tsx b/skyvern-frontend/src/components/SidebarTreeNav.tsxindex a60054e78..d52b7baaa 100644--- a/skyvern-frontend/src/components/SidebarTreeNav.tsx+++ b/skyvern-frontend/src/components/SidebarTreeNav.tsx@@ -476,6 +476,11 @@ function SidebarTreeNav({ items, collapsed: collapsedOverride }: Props) {{!collapsed && (<span className="min-w-0 flex-1 truncate">{item.label}</span>)}+ {!collapsed && item.badge ? (+ <span className="rounded bg-neutral-200 px-1.5 py-0.5 text-[9px] font-medium uppercase leading-none text-neutral-500 dark:bg-white/[0.06] dark:text-neutral-400">+ {item.badge}+ </span>+ ) : null}</SidebarNavLink>)}diff --git a/skyvern-frontend/src/components/onboarding/GettingStartedTrack.test.tsx b/skyvern-frontend/src/components/onboarding/GettingStartedTrack.test.tsxnew file mode 100644index 000000000..b68eec5d1--- /dev/null+++ b/skyvern-frontend/src/components/onboarding/GettingStartedTrack.test.tsx@@ -0,0 +1,120 @@+import {+ cleanup,+ fireEvent,+ render,+ screen,+ within,+} from "@testing-library/react";+import { MemoryRouter } from "react-router-dom";+import { afterEach, expect, it, vi } from "vitest";+import {+ SELF_ATTESTED_KEYS,+ TRACK_KEYS,+ type OnboardingTrackV1,+} from "@/routes/root/useOnboardingTrack";+import { GettingStartedTrack } from "./GettingStartedTrack";++function track(completedKeys: readonly string[]): OnboardingTrackV1 {+ return {+ version: "onboarding_track_v1",+ state: "active",+ arm: "treatment",+ completed_count: completedKeys.length,+ total_count: 8,+ items: TRACK_KEYS.map((key) => ({+ key,+ completed_at: completedKeys.includes(key) ? "2026-09-01T12:00:00Z" : null,+ verification: SELF_ATTESTED_KEYS.has(key) ? "self" : "server",+ })),+ };+}+function renderTrack(+ value: OnboardingTrackV1,+ overrides: Partial<Parameters<typeof GettingStartedTrack>[0]> = {},+) {+ const props = {+ track: value,+ credentialUnlocked: true,+ intent: null,+ onAttest: vi.fn(),+ onDismiss: vi.fn(),+ onRestore: vi.fn(),+ isPending: false,+ ...overrides,+ };+ render(+ <MemoryRouter>+ <GettingStartedTrack {...props} />+ </MemoryRouter>,+ );+ return props;+}+const titlesIn = (group: string) =>+ within(screen.getByRole("region", { name: group }))+ .getAllByRole("listitem")+ .map((row) => row.querySelector("p")?.textContent);+const primaryLinks = () =>+ screen+ .getAllByRole("link")+ .filter((link) => link.className.includes("bg-cta"))+ .map((link) => link.textContent);+afterEach(cleanup);++it("orders Keep going by intent and gives the first incomplete row the only primary action", () => {+ renderTrack(track(["first_scheduled_run"]), { intent: "extract_data" });+ expect(titlesIn("Keep going")).toEqual([+ "Current step: Run an agent from your own code",+ "Complete: Run your agent automatically",+ "Upcoming step: Use Skyvern from Claude, Cursor, or ChatGPT",+ "Upcoming step: Let your agent log in for you",+ ]);+ expect(primaryLinks()).toEqual(["Get an API key"]);+ expect(screen.queryByRole("region", { name: "Bring your team" })).toBeNull();+ expect(screen.queryByText("Bring a teammate")).toBeNull();+ expect(titlesIn("Stay in the loop")).toEqual([+ "Upcoming step: Star Skyvern on GitHub",+ "Upcoming step: Join the Discord",+ "Upcoming step: Follow for updates",+ ]);+ expect(screen.getByText("1 of 4 complete")).toBeTruthy();+ expect(+ screen+ .getAllByRole("link", { name: "How it works" })+ .map((link) => link.getAttribute("href")),+ ).toEqual([+ "https://www.skyvern.com/docs/developers/getting-started/quickstart",+ "https://www.skyvern.com/docs/developers/features/authentication-and-2fa",+ ]);+});++it("locks the credential row on Free, keeps it first for fill_forms, and leaves it uncounted", () => {+ renderTrack(track([]), { credentialUnlocked: false, intent: "fill_forms" });+ expect(titlesIn("Keep going")[0]).toBe(+ "Locked: Let your agent log in for you",+ );+ expect(screen.getByText("Available on Hobby and up")).toBeTruthy();+ expect(+ screen.getByRole("link", { name: "Upgrade" }).getAttribute("href"),+ ).toBe("/billing");+ expect(primaryLinks()).toEqual(["Open schedules"]);+ expect(screen.getByText("0 of 3 complete")).toBeTruthy();+ expect(screen.getByRole("progressbar").getAttribute("aria-valuemax")).toBe(+ "3",+ );+});++it("attests the clicked community row and never offers a client control on server rows", () => {+ const props = renderTrack(track([]));+ const keepGoing = screen.getByRole("region", { name: "Keep going" });+ expect(within(keepGoing).queryByRole("button")).toBeNull();+ fireEvent.click(screen.getAllByRole("button", { name: "Mark done" })[1]!);+ expect(props.onAttest).toHaveBeenCalledWith("discord_joined");+ fireEvent.click(screen.getByRole("button", { name: "Hide for now" }));+ expect(props.onDismiss).toHaveBeenCalledOnce();+ cleanup();+ const pending = renderTrack(track([]), { isPending: true });+ fireEvent.click(screen.getAllByRole("button", { name: "Mark done" })[0]!);+ fireEvent.click(screen.getByRole("button", { name: "Hide for now" }));+ expect(pending.onAttest).not.toHaveBeenCalled();+ expect(pending.onDismiss).not.toHaveBeenCalled();+});diff --git a/skyvern-frontend/src/components/onboarding/GettingStartedTrack.tsx b/skyvern-frontend/src/components/onboarding/GettingStartedTrack.tsxnew file mode 100644index 000000000..8013f1c17--- /dev/null+++ b/skyvern-frontend/src/components/onboarding/GettingStartedTrack.tsx@@ -0,0 +1,435 @@+import { ExternalLinkIcon, LockClosedIcon } from "@radix-ui/react-icons";+import { Link } from "react-router-dom";++import {+ PendingIcon,+ ProgressSegments,+ StepDot,+ type StepState,+} from "@/components/onboarding/OnboardingProgressBand";+import { Button } from "@/components/ui/button";+import {+ countedTrackItems,+ SELF_ATTESTED_KEYS,+ type OnboardingTrackItemV1,+ type OnboardingTrackV1,+ type TrackKey,+} from "@/routes/root/useOnboardingTrack";+import {+ DISCORD_INVITE_URL,+ DOCS_API_QUICKSTART_URL,+ DOCS_CREDENTIALS_URL,+ DOCS_MCP_URL,+ DOCS_SCHEDULING_URL,+ GITHUB_REPO_URL,+ LINKEDIN_URL,+ X_URL,+} from "@/util/externalLinks";++type RowLink = { label: string; to: string } | { label: string; href: string };+type RowDefinition = {+ title: string;+ why: string;+ links: RowLink[];+ howItWorks?: string;+};+type RowState = StepState | "locked";+type GettingStartedTrackProps = {+ track: OnboardingTrackV1;+ credentialUnlocked: boolean;+ intent: string | null;+ onAttest: (key: TrackKey) => void;+ onDismiss: () => void;+ onRestore: () => void;+ isPending: boolean;+};++const rowDefinitions: Record<TrackKey, RowDefinition> = {+ first_scheduled_run: {+ title: "Run your agent automatically",+ why: "Set a schedule so it runs without you",+ links: [{ label: "Open schedules", to: "/schedules" }],+ howItWorks: DOCS_SCHEDULING_URL,+ },+ first_api_run: {+ title: "Run an agent from your own code",+ why: "Start a run with an API key from any script",+ links: [{ label: "Get an API key", to: "/settings#api-keys" }],+ howItWorks: DOCS_API_QUICKSTART_URL,+ },+ mcp_installed: {+ title: "Use Skyvern from Claude, Cursor, or ChatGPT",+ why: "Install the MCP server and run agents from your AI tools",+ links: [{ label: "Set up MCP", href: DOCS_MCP_URL }],+ },+ teammate_invited: {+ title: "Bring a teammate",+ why: "Share agents and runs with your team",+ links: [{ label: "Open settings", to: "/settings" }],+ },+ credential_saved: {+ title: "Let your agent log in for you",+ why: "Save a login and 2FA code once; your agents reuse it",+ links: [{ label: "Add a credential", to: "/credentials" }],+ howItWorks: DOCS_CREDENTIALS_URL,+ },+ github_starred: {+ title: "Star Skyvern on GitHub",+ why: "Skyvern is open source",+ links: [{ label: "Star on GitHub", href: GITHUB_REPO_URL }],+ },+ discord_joined: {+ title: "Join the Discord",+ why: "Get help from the team and other builders",+ links: [{ label: "Join Discord", href: DISCORD_INVITE_URL }],+ },+ social_followed: {+ title: "Follow for updates",+ why: "Product updates as they ship",+ links: [+ { label: "Follow on X", href: X_URL },+ { label: "Follow on LinkedIn", href: LINKEDIN_URL },+ ],+ },+};++const productionOrder: readonly TrackKey[] = [+ "first_scheduled_run",+ "first_api_run",+ "mcp_installed",+ "credential_saved",+];+const intentFirstRow: Record<string, TrackKey> = {+ fill_forms: "credential_saved",+ extract_data: "first_api_run",+ monitor_website: "first_scheduled_run",+};+const communityOrder: readonly TrackKey[] = [+ "github_starred",+ "discord_joined",+ "social_followed",+];++function keepGoingOrder(intent: string | null): TrackKey[] {+ const first = intentFirstRow[intent ?? ""] ?? "first_scheduled_run";+ return [first, ...productionOrder.filter((key) => key !== first)];+}++const quietButtonClassName =+ "h-11 touch-manipulation text-muted-foreground hover:text-foreground";+const quietLinkClassName =+ "inline-flex min-h-11 touch-manipulation items-center text-xs text-muted-foreground underline-offset-4 hover:text-foreground hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring";++function RowLinkButton({+ link,+ primary,+ isPending,+}: {+ link: RowLink;+ primary: boolean;+ isPending: boolean;+}) {+ const variant = isPending ? "disabled" : primary ? "default" : "outline";+ return (+ <Button asChild variant={variant} className="h-11 touch-manipulation">+ {"href" in link ? (+ <a href={link.href} target="_blank" rel="noopener noreferrer">+ {link.label}+ <ExternalLinkIcon aria-hidden="true" className="ml-2 size-4" />+ </a>+ ) : (+ <Link to={link.to}>{link.label}</Link>+ )}+ </Button>+ );+}++function RowBullet({+ state,+ index,+}: {+ state: RowState;+ index: number | null;+}) {+ if (index === null) {+ return (+ <span+ aria-hidden="true"+ className={`flex size-6 shrink-0 items-center justify-center rounded-full text-xs font-semibold ${+ state === "complete"+ ? "bg-badge-success text-foreground"+ : "border border-border text-muted-foreground"+ }`}+ >+ {state === "complete" ? "✓" : "•"}+ </span>+ );+ }+ if (state === "locked") {+ return (+ <span+ aria-hidden="true"+ className="flex size-6 shrink-0 items-center justify-center rounded-full border border-border text-muted-foreground"+ >+ <LockClosedIcon className="size-3" />+ </span>+ );+ }+ return <StepDot state={state} index={index} />;+}++function TrackRow({+ item,+ index,+ state,+ onAttest,+ isPending,+}: {+ item: OnboardingTrackItemV1;+ index: number | null;+ state: RowState;+ onAttest: (key: TrackKey) => void;+ isPending: boolean;+}) {+ const definition = rowDefinitions[item.key];+ const isDone = state === "complete";+ const isLocked = state === "locked";+ return (+ <li className="grid min-h-11 gap-3 rounded-md border border-border/70 bg-background/70 px-4 py-3 text-sm sm:grid-cols-[auto_1fr_auto] sm:items-center">+ <RowBullet state={state} index={index} />+ <div className="min-w-0">+ <p+ className={+ isDone || isLocked+ ? "text-muted-foreground"+ : "font-medium text-foreground"+ }+ >+ <span className="sr-only">+ {isDone+ ? "Complete: "+ : isLocked+ ? "Locked: "+ : state === "active"+ ? "Current step: "+ : "Upcoming step: "}+ </span>+ {definition.title}+ </p>+ <p className="text-xs text-muted-foreground">+ {item.completed_at !== null ? (+ <>+ Done{" "}+ <time dateTime={item.completed_at}>+ {new Date(item.completed_at).toLocaleDateString(undefined, {+ month: "short",+ day: "numeric",+ })}+ </time>+ </>+ ) : isLocked ? (+ "Available on Hobby and up"+ ) : (+ definition.why+ )}+ </p>+ </div>+ {isDone ? null : isLocked ? (+ <div className="flex items-center sm:justify-end">+ <Button asChild variant="outline" className="h-11 touch-manipulation">+ <Link to="/billing">Upgrade</Link>+ </Button>+ </div>+ ) : (+ <div className="flex flex-wrap items-center gap-2 sm:justify-end">+ {definition.links.map((link, linkIndex) => (+ <RowLinkButton+ key={link.label}+ link={link}+ primary={state === "active" && linkIndex === 0}+ isPending={isPending}+ />+ ))}+ {definition.howItWorks ? (+ <a+ href={definition.howItWorks}+ target="_blank"+ rel="noopener noreferrer"+ className={quietLinkClassName}+ >+ How it works+ </a>+ ) : null}+ {SELF_ATTESTED_KEYS.has(item.key) ? (+ <Button+ type="button"+ variant={isPending ? "disabled" : "ghost"}+ className={quietButtonClassName}+ aria-disabled={isPending}+ aria-busy={isPending}+ onClick={() => {+ if (!isPending) onAttest(item.key);+ }}+ >+ {isPending ? <PendingIcon /> : null}+ Mark done+ </Button>+ ) : null}+ </div>+ )}+ </li>+ );+}++function TrackGroup({+ label,+ children,+}: {+ label: string;+ children: React.ReactNode;+}) {+ return (+ <section aria-label={label} className="space-y-2">+ <h2 className="text-xs font-semibold uppercase tracking-wide text-muted-foreground">+ {label}+ </h2>+ <ol className="space-y-2">{children}</ol>+ </section>+ );+}++function GettingStartedTrack({+ track,+ credentialUnlocked,+ intent,+ onAttest,+ onDismiss,+ onRestore,+ isPending,+}: GettingStartedTrackProps) {+ const heading = (+ <h1+ id="getting-started-heading"+ className="text-2xl font-semibold tracking-tight"+ >+ Getting started+ </h1>+ );++ if (track.state === "dismissed") {+ return (+ <section+ aria-labelledby="getting-started-heading"+ className="mx-auto max-w-2xl space-y-4"+ >+ {heading}+ <p className="text-sm text-muted-foreground">+ Hidden for now. Resume to see your next steps in the sidebar.+ </p>+ <Button+ type="button"+ variant={isPending ? "disabled" : "outline"}+ className="h-11 touch-manipulation"+ aria-disabled={isPending}+ aria-busy={isPending}+ onClick={() => {+ if (!isPending) onRestore();+ }}+ >+ Resume+ </Button>+ </section>+ );+ }++ const byKey = new Map(track.items.map((item) => [item.key, item]));+ const rowsFor = (keys: readonly TrackKey[]) =>+ keys.flatMap((key) => byKey.get(key) ?? []);+ const keepGoing = rowsFor(keepGoingOrder(intent));+ const community = rowsFor(communityOrder);+ const isLocked = (item: OnboardingTrackItemV1) =>+ item.key === "credential_saved" && !credentialUnlocked;+ const counted = countedTrackItems(track, credentialUnlocked);+ const done = counted.filter((row) => row.completed_at !== null).length;+ const currentKey = keepGoing.find(+ (row) => row.completed_at === null && !isLocked(row),+ )?.key;+ const stateOf = (row: OnboardingTrackItemV1): RowState =>+ row.completed_at !== null+ ? "complete"+ : isLocked(row)+ ? "locked"+ : row.key === currentKey+ ? "active"+ : "upcoming";+ let position = 0;+ const numbered = (row: OnboardingTrackItemV1) =>+ isLocked(row) ? position : position++;++ return (+ <section+ aria-labelledby="getting-started-heading"+ aria-busy={isPending}+ className="mx-auto max-w-2xl space-y-6"+ >+ {isPending ? (+ <span className="sr-only" aria-live="polite">+ Saving your progress…+ </span>+ ) : null}+ <div className="flex flex-wrap items-start justify-between gap-3">+ <div>+ {heading}+ <p className="mt-1 text-sm text-muted-foreground">+ <span className="sr-only">Progress: </span>+ {done} of {counted.length} complete+ </p>+ </div>+ <Button+ type="button"+ variant={isPending ? "disabled" : "ghost"}+ className={quietButtonClassName}+ aria-disabled={isPending}+ aria-busy={isPending}+ onClick={() => {+ if (!isPending) onDismiss();+ }}+ >+ Hide for now+ </Button>+ </div>+ <ProgressSegments+ completedSteps={done}+ totalSteps={counted.length}+ label="Getting started progress"+ />+ <TrackGroup label="Keep going">+ {keepGoing.map((row) => (+ <TrackRow+ key={row.key}+ item={row}+ index={numbered(row)}+ state={stateOf(row)}+ onAttest={onAttest}+ isPending={isPending}+ />+ ))}+ </TrackGroup>+ <TrackGroup label="Stay in the loop">+ {community.map((row) => (+ <TrackRow+ key={row.key}+ item={row}+ index={null}+ state={row.completed_at !== null ? "complete" : "upcoming"}+ onAttest={onAttest}+ isPending={isPending}+ />+ ))}+ </TrackGroup>+ </section>+ );+}++export { GettingStartedTrack };+export type { GettingStartedTrackProps };diff --git a/skyvern-frontend/src/components/onboarding/OnboardingProgressBand.test.tsx b/skyvern-frontend/src/components/onboarding/OnboardingProgressBand.test.tsxindex c63fe49b9..d93dc0c91 100644--- a/skyvern-frontend/src/components/onboarding/OnboardingProgressBand.test.tsx+++ b/skyvern-frontend/src/components/onboarding/OnboardingProgressBand.test.tsx@@ -201,7 +201,7 @@ it("offers the working example as a quiet focus handoff from step 2", () => {onDescribeAgent={vi.fn()}><h2 id="working-example-heading" tabIndex={-1}>- See how an agent run is organized+ What a finished run looks like</h2></OnboardingProgressBand>,{ wrapper: MemoryRouter },@@ -213,6 +213,6 @@ it("offers the working example as a quiet focus handoff from step 2", () => {expect(affordance.getAttribute("href")).toBe("#working-example-heading");fireEvent.click(affordance);expect(document.activeElement).toBe(- screen.getByRole("heading", { name: "See how an agent run is organized" }),+ screen.getByRole("heading", { name: "What a finished run looks like" }),);});diff --git a/skyvern-frontend/src/components/onboarding/OnboardingProgressBand.tsx b/skyvern-frontend/src/components/onboarding/OnboardingProgressBand.tsxindex 16d9b735e..1e777a084 100644--- a/skyvern-frontend/src/components/onboarding/OnboardingProgressBand.tsx+++ b/skyvern-frontend/src/components/onboarding/OnboardingProgressBand.tsx@@ -26,6 +26,11 @@ type OnboardingProgressBandProps = {onDismiss: () => void;onRestore: () => void;onDescribeAgent: () => void;+ trackRemaining?: number;+ onDismissHandoff?: () => void;+ trackDismissed?: boolean;+ trackPending?: boolean;+ onRestoreTrack?: () => void;children?: ReactNode;};type StepState = "complete" | "active" | "pending" | "upcoming";@@ -81,19 +86,28 @@ function StepDot({ state, index }: { state: StepState; index: number }) {);}-function ProgressSegments({ completedSteps }: { completedSteps: number }) {+function ProgressSegments({+ completedSteps,+ totalSteps = milestoneLabels.length,+ label = "Setup progress",+}: {+ completedSteps: number;+ totalSteps?: number;+ label?: string;+}) {return (<div- className="grid grid-cols-3 gap-1"+ className="grid gap-1"+ style={{ gridTemplateColumns: `repeat(${totalSteps}, minmax(0, 1fr))` }}role="progressbar"- aria-label="Setup progress"+ aria-label={label}aria-valuemin={0}- aria-valuemax={3}+ aria-valuemax={totalSteps}aria-valuenow={completedSteps}>- {milestoneLabels.map((label, index) => (+ {Array.from({ length: totalSteps }, (_, index) => (<span- key={label}+ key={index}aria-hidden="true"className={`h-1.5 rounded-full ${index < completedSteps ? "bg-primary" : "bg-muted"@@ -242,6 +256,75 @@ function WorkingExampleAffordance() {);}+function HandoffRow({+ remaining,+ onDismiss,+}: {+ remaining: number;+ onDismiss?: () => void;+}) {+ return (+ <section+ aria-labelledby="onboarding-handoff-heading"+ aria-live="polite"+ role="status"+ className="flex min-h-11 flex-wrap items-center gap-3 rounded-lg border border-border bg-background px-5 py-3 shadow-sm motion-safe:animate-in motion-safe:fade-in motion-reduce:animate-none sm:px-6"+ >+ <span className="flex size-6 shrink-0 items-center justify-center rounded-full bg-badge-success text-foreground">+ <CheckIcon aria-hidden="true" className="size-3.5" />+ </span>+ <p+ id="onboarding-handoff-heading"+ className="text-sm font-semibold tracking-tight"+ >+ First agent ready.+ </p>+ <Link+ to="/getting-started"+ onClick={onDismiss}+ className="inline-flex min-h-11 touch-manipulation items-center text-sm text-muted-foreground underline-offset-4 hover:text-foreground hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"+ >+ Keep going: {remaining} more {remaining === 1 ? "step" : "steps"} →+ </Link>+ <Button+ type="button"+ variant="ghost"+ className="ml-auto h-11 touch-manipulation text-muted-foreground hover:text-foreground"+ onClick={onDismiss}+ >+ Hide+ </Button>+ </section>+ );+}++// A hidden track has no sidebar row and no handoff, so Home keeps one quiet+// way back to it.+function ResumeTrackRow({+ isPending,+ onRestore,+}: {+ isPending: boolean;+ onRestore?: () => void;+}) {+ return (+ <div className="flex justify-end">+ <Button+ type="button"+ variant={isPending ? "disabled" : "ghost"}+ className="h-11 touch-manipulation text-muted-foreground hover:text-foreground"+ aria-disabled={isPending}+ aria-busy={isPending}+ onClick={() => {+ if (!isPending) onRestore?.();+ }}+ >+ Resume getting started+ </Button>+ </div>+ );+}+function CompletionBand() {return (<section@@ -291,16 +374,24 @@ function OnboardingProgressBand({onDismiss,onRestore,onDescribeAgent,+ trackRemaining = 0,+ onDismissHandoff,+ trackDismissed = false,+ trackPending = false,+ onRestoreTrack,children,}: OnboardingProgressBandProps) {const previousState = useRef(progress?.state);const [isCelebrating, setIsCelebrating] = useState(false);+ // Completed progress with an active track keeps a compact handoff in place+ // of the retired band; the timed celebration only remains for a null track.+ const showHandoff = progress?.state === "completed" && trackRemaining > 0;useEffect(() => {const completedFromActive =previousState.current === "active" && progress?.state === "completed";previousState.current = progress?.state;- if (!completedFromActive) {+ if (!completedFromActive || showHandoff) {setIsCelebrating(false);return;}@@ -308,13 +399,21 @@ function OnboardingProgressBand({setIsCelebrating(true);const timeout = window.setTimeout(() => setIsCelebrating(false), 1800);return () => window.clearTimeout(timeout);- }, [progress?.state]);+ }, [progress?.state, showHandoff]);+ const resumeTrack = trackDismissed ? (+ <ResumeTrackRow isPending={trackPending} onRestore={onRestoreTrack} />+ ) : null;+ if (showHandoff) {+ return (+ <HandoffRow remaining={trackRemaining} onDismiss={onDismissHandoff} />+ );+ }if (isCelebrating) return <CompletionBand />;const activeProgress = isActiveProgress(progress) ? progress : null;const isDismissed = progress?.state === "dismissed";- if (!activeProgress && !isDismissed) return null;+ if (!activeProgress && !isDismissed) return resumeTrack;const completedSteps = activeProgress? activeProgress.completed_count + 1@@ -329,114 +428,118 @@ function OnboardingProgressBand({: 1;return (- <div className={activeProgress ? "relative" : "flex justify-end"}>- <Button- type="button"- variant={isPending ? "disabled" : "ghost"}- className={`z-10 h-11 touch-manipulation text-muted-foreground hover:text-foreground ${- activeProgress ? "absolute right-5 top-4" : ""- }`}- aria-disabled={isPending}- aria-busy={isPending}- onClick={() => {- if (isPending) return;- if (activeProgress) onDismiss();- else onRestore();- }}- >- {isPending && <PendingIcon />}- {activeProgress ? "Hide setup" : "Resume setup"}- </Button>-- {activeProgress && action ? (- <section- aria-labelledby="onboarding-progress-heading"+ <>+ <div className={activeProgress ? "relative" : "flex justify-end"}>+ <Button+ type="button"+ variant={isPending ? "disabled" : "ghost"}+ className={`z-10 h-11 touch-manipulation text-muted-foreground hover:text-foreground ${+ activeProgress ? "absolute right-5 top-4" : ""+ }`}+ aria-disabled={isPending}aria-busy={isPending}- className="overflow-hidden rounded-lg border border-border bg-background shadow-sm"+ onClick={() => {+ if (isPending) return;+ if (activeProgress) onDismiss();+ else onRestore();+ }}>- {isPending ? (- <span className="sr-only" aria-live="polite">- Saving setup progress…- </span>- ) : null}- <div className="border-b border-border bg-card px-5 py-4 sm:px-6">- <div className="pr-28">- <h2- id="onboarding-progress-heading"- className="text-base font-semibold tracking-tight"- >- Build your first agent- </h2>- <p className="mt-1 text-sm text-muted-foreground">- An agent is a browser automation you describe in plain words.- </p>- <p className="mt-1 text-sm text-muted-foreground">- <span className="font-semibold tabular-nums text-foreground">- {completedSteps} of 3- </span>{" "}- complete- </p>- </div>+ {isPending && <PendingIcon />}+ {activeProgress ? "Hide setup" : "Resume setup"}+ </Button>- <div className="mt-4">- <ProgressSegments completedSteps={completedSteps} />- </div>+ {activeProgress && action ? (+ <section+ aria-labelledby="onboarding-progress-heading"+ aria-busy={isPending}+ className="overflow-hidden rounded-lg border border-border bg-background shadow-sm"+ >+ {isPending ? (+ <span className="sr-only" aria-live="polite">+ Saving setup progress…+ </span>+ ) : null}+ <div className="border-b border-border bg-card px-5 py-4 sm:px-6">+ <div className="pr-28">+ <h2+ id="onboarding-progress-heading"+ className="text-base font-semibold tracking-tight"+ >+ Build your first agent+ </h2>+ <p className="mt-1 text-sm text-muted-foreground">+ An agent is a browser automation you describe in plain words.+ </p>+ <p className="mt-1 text-sm text-muted-foreground">+ <span className="font-semibold tabular-nums text-foreground">+ {completedSteps} of 3+ </span>{" "}+ complete+ </p>+ </div>- <ol aria-label="Setup milestones" className="mt-4 grid gap-2">- {milestoneLabels.map((label, index) => {- const state: StepState =- index < completedSteps- ? "complete"- : isPending && index === activeIndex- ? "pending"- : index === activeIndex- ? "active"- : "upcoming";- return (- <SetupRow- key={label}- label={label}- index={index}- state={state}- secondaryAffordance={- index === 1 &&- activeProgress.next_action_key ===- "first_agent_created" ? (- <WorkingExampleAffordance />- ) : undefined- }- affordance={- index === activeIndex ? (- <QuietResourceLink- href={action.resourceHref}- label={action.resourceLabel}- isPending={isPending}- />- ) : undefined- }- />- );- })}- </ol>+ <div className="mt-4">+ <ProgressSegments completedSteps={completedSteps} />+ </div>- <div className="mt-4 flex flex-col items-stretch gap-2 sm:flex-row sm:items-center">- <ProgressPrimaryAction- nextActionKey={activeProgress.next_action_key}- isPending={isPending}- onDescribeAgent={onDescribeAgent}- />- </div>- </div>+ <ol aria-label="Setup milestones" className="mt-4 grid gap-2">+ {milestoneLabels.map((label, index) => {+ const state: StepState =+ index < completedSteps+ ? "complete"+ : isPending && index === activeIndex+ ? "pending"+ : index === activeIndex+ ? "active"+ : "upcoming";+ return (+ <SetupRow+ key={label}+ label={label}+ index={index}+ state={state}+ secondaryAffordance={+ index === 1 &&+ activeProgress.next_action_key ===+ "first_agent_created" ? (+ <WorkingExampleAffordance />+ ) : undefined+ }+ affordance={+ index === activeIndex ? (+ <QuietResourceLink+ href={action.resourceHref}+ label={action.resourceLabel}+ isPending={isPending}+ />+ ) : undefined+ }+ />+ );+ })}+ </ol>- {children && (- <div className="[&>section]:rounded-none [&>section]:border-0">- {children}+ <div className="mt-4 flex flex-col items-stretch gap-2 sm:flex-row sm:items-center">+ <ProgressPrimaryAction+ nextActionKey={activeProgress.next_action_key}+ isPending={isPending}+ onDescribeAgent={onDescribeAgent}+ />+ </div></div>- )}- </section>- ) : null}- </div>++ {children && (+ <div className="[&>section]:rounded-none [&>section]:border-0">+ {children}+ </div>+ )}+ </section>+ ) : null}+ </div>+ {resumeTrack}+ </>);}-export { OnboardingProgressBand };+export { OnboardingProgressBand, PendingIcon, ProgressSegments, StepDot };+export type { StepState };diff --git a/skyvern-frontend/src/components/onboarding/WorkingExampleInspector.test.tsx b/skyvern-frontend/src/components/onboarding/WorkingExampleInspector.test.tsxindex 0363c9353..220b31db3 100644--- a/skyvern-frontend/src/components/onboarding/WorkingExampleInspector.test.tsx+++ b/skyvern-frontend/src/components/onboarding/WorkingExampleInspector.test.tsx@@ -6,17 +6,19 @@ it("shows provenance, structure, playback, and result before one safe copy", ()const onMakeCopy = vi.fn();render(<WorkingExampleInspector isPending={false} onMakeCopy={onMakeCopy} />);expect(screen.getByText("Example data, not your run")).toBeTruthy();- expect(screen.getByRole("heading", { name: "Agent structure" })).toBeTruthy();+ expect(+ screen.getByRole("heading", { name: "How the agent is built" }),+ ).toBeTruthy();expect(screen.getByText("Visit a public page")).toBeTruthy();- expect(screen.getByRole("heading", { name: "Agent playback" })).toBeTruthy();+ expect(+ screen.getByRole("heading", { name: "What the agent did" }),+ ).toBeTruthy();expect(screen.getByText("Opened https://www.skyvern.com/ in this static agent example.",),).toBeTruthy();- expect(- screen.getByRole("heading", { name: "Synthetic agent result" }),- ).toBeTruthy();+ expect(screen.getByRole("heading", { name: "Example result" })).toBeTruthy();expect(screen.getByText("Product summary")).toBeTruthy();expect(screen.getByRole("region").textContent).not.toMatch(/workflow/i);expect(onMakeCopy).not.toHaveBeenCalled();diff --git a/skyvern-frontend/src/components/onboarding/WorkingExampleInspector.tsx b/skyvern-frontend/src/components/onboarding/WorkingExampleInspector.tsxindex 3f049aeba..9ca2aa77c 100644--- a/skyvern-frontend/src/components/onboarding/WorkingExampleInspector.tsx+++ b/skyvern-frontend/src/components/onboarding/WorkingExampleInspector.tsx@@ -34,7 +34,7 @@ function WorkingExampleInspector({</header><div className="grid gap-5 p-5 sm:p-6 lg:grid-cols-3"><div className="min-w-0">- <h3 className="text-sm font-semibold">Agent structure</h3>+ <h3 className="text-sm font-semibold">How the agent is built</h3><ol className="mt-3 list-decimal space-y-3 pl-4 marker:text-muted-foreground">{structure.map((step) => (<li key={step.title} className="break-words pl-1">@@ -47,7 +47,7 @@ function WorkingExampleInspector({</ol></div><div className="min-w-0">- <h3 className="text-sm font-semibold">Agent playback</h3>+ <h3 className="text-sm font-semibold">What the agent did</h3><ol className="mt-3 list-decimal space-y-2 pl-4 marker:text-muted-foreground">{playback.map((detail) => (<lidiff --git a/skyvern-frontend/src/hooks/useDismissedFlag.test.ts b/skyvern-frontend/src/hooks/useDismissedFlag.test.tsnew file mode 100644index 000000000..debc382f7--- /dev/null+++ b/skyvern-frontend/src/hooks/useDismissedFlag.test.ts@@ -0,0 +1,22 @@+import { act, renderHook } from "@testing-library/react";+import { afterEach, expect, it } from "vitest";+import { useDismissedFlag } from "./useDismissedFlag";++afterEach(() => window.localStorage.clear());++it("remembers a dismissal across mounts and follows key changes", () => {+ const hook = renderHook(({ key }) => useDismissedFlag(key), {+ initialProps: { key: "org-a" },+ });+ expect(hook.result.current[0]).toBe(false);+ act(() => hook.result.current[1]());+ expect(hook.result.current[0]).toBe(true);+ hook.rerender({ key: "org-b" });+ expect(hook.result.current[0]).toBe(false);+ hook.rerender({ key: "org-a" });+ expect(hook.result.current[0]).toBe(true);+ hook.unmount();+ expect(renderHook(() => useDismissedFlag("org-a")).result.current[0]).toBe(+ true,+ );+});diff --git a/skyvern-frontend/src/hooks/useDismissedFlag.ts b/skyvern-frontend/src/hooks/useDismissedFlag.tsnew file mode 100644index 000000000..484391c70--- /dev/null+++ b/skyvern-frontend/src/hooks/useDismissedFlag.ts@@ -0,0 +1,38 @@+import { useState } from "react";++// Per-browser dismissal for surfaces the server cannot hide (it rejects+// visibility changes on completed onboarding progress).+function readDismissedFlag(key: string): boolean {+ try {+ return window.localStorage.getItem(key) === "1";+ } catch {+ return false;+ }+}++function setDismissedFlag(key: string) {+ try {+ window.localStorage.setItem(key, "1");+ } catch {+ // Storage can be unavailable in embedded contexts; hide for the session.+ }+}++function useDismissedFlag(key: string): [boolean, () => void] {+ const [state, setState] = useState(() => ({+ key,+ dismissed: readDismissedFlag(key),+ }));+ if (state.key !== key) {+ setState({ key, dismissed: readDismissedFlag(key) });+ }+ return [+ state.key === key && state.dismissed,+ () => {+ setDismissedFlag(key);+ setState({ key, dismissed: true });+ },+ ];+}++export { setDismissedFlag, useDismissedFlag };diff --git a/skyvern-frontend/src/hooks/useScrollToHash.ts b/skyvern-frontend/src/hooks/useScrollToHash.tsnew file mode 100644index 000000000..8cce6b07b--- /dev/null+++ b/skyvern-frontend/src/hooks/useScrollToHash.ts@@ -0,0 +1,15 @@+import { useEffect } from "react";+import { useLocation } from "react-router-dom";++function useScrollToHash(ready = true) {+ const { hash } = useLocation();+ useEffect(() => {+ if (!hash || !ready) return;+ document.getElementById(hash.slice(1))?.scrollIntoView({+ behavior: "smooth",+ block: "start",+ });+ }, [hash, ready]);+}++export { useScrollToHash };diff --git a/skyvern-frontend/src/routes/discover/DiscoverPage.test.tsx b/skyvern-frontend/src/routes/discover/DiscoverPage.test.tsxindex b4e551acc..64501052a 100644--- a/skyvern-frontend/src/routes/discover/DiscoverPage.test.tsx+++ b/skyvern-frontend/src/routes/discover/DiscoverPage.test.tsx@@ -428,7 +428,7 @@ describe("DiscoverPage progress surfaces", () => {mocks.progressState = "active";const { container, rerender } = render(<DiscoverPage />);expect(container.innerHTML).toMatch(- /<h1[^>]*>Create an agent<\/h1>.*prompt.*Build your first agent.*See how an agent run is organized.*templates/s,+ /<h1[^>]*>Create an agent<\/h1>.*prompt.*Build your first agent.*What a finished run looks like.*templates/s,);expect(screen.getByText("1 of 3")).toBeTruthy();expect(mocks.createWorkflow).not.toHaveBeenCalled();@@ -447,7 +447,7 @@ describe("DiscoverPage progress surfaces", () => {name: "or copy a working example",});const workingExampleHeading = screen.getByRole("heading", {- name: "See how an agent run is organized",+ name: "What a finished run looks like",});expect(workingExampleLink.getAttribute("href")).toBe("#working-example-heading",@@ -498,7 +498,7 @@ describe("DiscoverPage progress surfaces", () => {const resume = screen.getByRole("button", { name: "Resume setup" });expect(resume).toBe(hide);expect(document.activeElement).toBe(resume);- expect(screen.queryByText("See how an agent run is organized")).toBeNull();+ expect(screen.queryByText("What a finished run looks like")).toBeNull();fireEvent.click(resume);expect(mocks.restore).toHaveBeenCalledTimes(1);});@@ -549,7 +549,7 @@ describe("DiscoverPage progress surfaces", () => {</MemoryRouter>,);expect(screen.getByRole("status").textContent).toContain("3 of 3 complete");- expect(screen.queryByText("See how an agent run is organized")).toBeNull();+ expect(screen.queryByText("What a finished run looks like")).toBeNull();act(() => vi.advanceTimersByTime(1800));expect(screen.queryByText("First agent ready")).toBeNull();@@ -562,7 +562,7 @@ describe("DiscoverPage progress surfaces", () => {mocks.progressState = state;render(<DiscoverPage />);expect(document.body.textContent).not.toMatch(- /Build your first agent|See how an agent run is organized|Hide setup|Resume setup/,+ /Build your first agent|What a finished run looks like|Hide setup|Resume setup/,);},);diff --git a/skyvern-frontend/src/routes/discover/DiscoverPage.tsx b/skyvern-frontend/src/routes/discover/DiscoverPage.tsxindex 176129284..f9c62fbc2 100644--- a/skyvern-frontend/src/routes/discover/DiscoverPage.tsx+++ b/skyvern-frontend/src/routes/discover/DiscoverPage.tsx@@ -34,7 +34,19 @@ function getIntentExampleKey(}}-function DiscoverPage() {+function DiscoverPage({+ trackRemaining = 0,+ onDismissHandoff,+ trackDismissed = false,+ trackPending = false,+ onRestoreTrack,+}: {+ trackRemaining?: number;+ onDismissHandoff?: () => void;+ trackDismissed?: boolean;+ trackPending?: boolean;+ onRestoreTrack?: () => void;+} = {}) {const enableCopilotHandoff =useFeatureFlag("ENABLE_DISCOVER_COPILOT_HANDOFF") === true;const createWorkflowMutation = useCreateWorkflowMutation();@@ -110,6 +122,11 @@ function DiscoverPage() {onDismiss={dismiss}onRestore={restore}onDescribeAgent={handleDescribeAgent}+ trackRemaining={trackRemaining}+ onDismissHandoff={onDismissHandoff}+ trackDismissed={trackDismissed}+ trackPending={trackPending}+ onRestoreTrack={onRestoreTrack}>{progress?.state === "active" ? (<WorkingExampleInspectordiff --git a/skyvern-frontend/src/routes/discover/onboardingExample.test.ts b/skyvern-frontend/src/routes/discover/onboardingExample.test.tsindex dfe9f04e2..5d785996a 100644--- a/skyvern-frontend/src/routes/discover/onboardingExample.test.ts+++ b/skyvern-frontend/src/routes/discover/onboardingExample.test.ts@@ -26,11 +26,11 @@ it("keeps the copy payload to one passive public task", () => {it("labels playback and result data as synthetic examples", () => {const { title, provenance, playback, result } =example.onboardingExamplePresentation;- expect(title).toBe("See how an agent run is organized");+ expect(title).toBe("What a finished run looks like");expect(provenance).toBe("Example data, not your run");expect(playback[0]).toMatch(/static agent example/);expect(playback[2]).toMatch(/agent result/);- expect(result.title).toMatch(/synthetic.*agent/i);+ expect(result.title).toBe("Example result");expect(result.fields.map(({ label }) => label)).toEqual(["Headline","Product summary",diff --git a/skyvern-frontend/src/routes/discover/onboardingExample.ts b/skyvern-frontend/src/routes/discover/onboardingExample.tsindex 4d09fc376..b32a6865b 100644--- a/skyvern-frontend/src/routes/discover/onboardingExample.ts+++ b/skyvern-frontend/src/routes/discover/onboardingExample.ts@@ -2,7 +2,7 @@ import { RunEngine } from "@/api/types";import type { WorkflowCreateYAMLRequest } from "@/routes/workflows/types/workflowYamlTypes";export const onboardingExamplePresentation = {- title: "See how an agent run is organized",+ title: "What a finished run looks like",provenance: "Example data, not your run",structure: [{@@ -24,7 +24,7 @@ export const onboardingExamplePresentation = {"Prepared the bounded agent result shown below.",],result: {- title: "Synthetic agent result",+ title: "Example result",fields: [{label: "Headline",diff --git a/skyvern-frontend/src/routes/discover/useOnboardingProgress.test.tsx b/skyvern-frontend/src/routes/discover/useOnboardingProgress.test.tsxindex 70bb1a342..7fecaf0a0 100644--- a/skyvern-frontend/src/routes/discover/useOnboardingProgress.test.tsx+++ b/skyvern-frontend/src/routes/discover/useOnboardingProgress.test.tsx@@ -1,4 +1,4 @@-import type { ReactNode } from "react";+import { useState, type ReactNode } from "react";import {QueryClient,QueryClientProvider,@@ -6,6 +6,7 @@ import {} from "@tanstack/react-query";import {act,+ fireEvent,render,renderHook,screen,@@ -19,11 +20,19 @@ const mocks = vi.hoisted<{flag: boolean | undefined;org: string | undefined;user: string | undefined;+ trackRemaining: number;+ dismissHandoff: ReturnType<typeof vi.fn<() => void>>;+ trackDismissed: boolean;+ restoreTrack: ReturnType<typeof vi.fn<() => void>>;}>(() => ({get: vi.fn(),flag: true,org: "org-test",user: "user-test",+ trackRemaining: 0,+ dismissHandoff: vi.fn<() => void>(),+ trackDismissed: false,+ restoreTrack: vi.fn<() => void>(),}));vi.mock("@/api/AxiosClient", () => ({getClient: () => Promise.resolve({ get: mocks.get }),@@ -81,6 +90,7 @@ function renderProgress(client = new QueryClient()) {}function ProgressBand() {const { progress, isPending, dismiss, restore } = useOnboardingProgress();+ const [trackRemaining, setTrackRemaining] = useState(mocks.trackRemaining);return (<OnboardingProgressBandprogress={progress}@@ -88,6 +98,13 @@ function ProgressBand() {onDismiss={dismiss}onRestore={restore}onDescribeAgent={vi.fn()}+ trackRemaining={trackRemaining}+ onDismissHandoff={() => {+ mocks.dismissHandoff();+ setTrackRemaining(0);+ }}+ trackDismissed={mocks.trackDismissed}+ onRestoreTrack={mocks.restoreTrack}/>);}@@ -105,6 +122,8 @@ beforeEach(() => {mocks.flag = true;mocks.org = "org-test";mocks.user = "user-test";+ mocks.trackRemaining = 0;+ mocks.trackDismissed = false;});afterEach(() => vi.useRealTimers());it.each([@@ -171,6 +190,60 @@ it("refetches fresh cached progress when Discover remounts", async () => {);expect(secondMount.result.current.progress).toEqual(refreshedPayload);});+it("keeps one way back to a hidden track on Home", async () => {+ mocks.trackDismissed = true;+ mocks.get.mockResolvedValueOnce({ data: completedPayload() });+ renderProgressBand(new QueryClient());+ const resume = await screen.findByRole("button", {+ name: "Resume getting started",+ });+ expect(screen.queryByText(/First agent ready/)).toBeNull();+ fireEvent.click(resume);+ expect(mocks.restoreTrack).toHaveBeenCalledOnce();+});++it("keeps a persistent handoff instead of the timed celebration when the track is active", async () => {+ const client = new QueryClient();+ mocks.get.mockResolvedValueOnce({ data: validPayload() });+ const activeMount = renderProgressBand(client);+ expect(await screen.findByText("Build your first agent")).toBeTruthy();+ activeMount.unmount();++ const completedRequest = deferred<{ data: unknown }>();+ mocks.get.mockReturnValueOnce(completedRequest.promise);+ mocks.trackRemaining = 4;+ vi.useFakeTimers();+ const completionMount = renderProgressBand(client);+ completedRequest.resolve({ data: completedPayload() });+ await completedRequest.promise;+ await act(() => vi.advanceTimersByTimeAsync(0));+ const handoff = screen.getByRole("link", {+ name: "Keep going: 4 more steps →",+ });+ expect(handoff.getAttribute("href")).toBe("/getting-started");+ expect(screen.getByRole("status").textContent).toContain(+ "First agent ready.",+ );+ expect(screen.queryByText("3 of 3 complete")).toBeNull();+ act(() => vi.advanceTimersByTime(5000));+ expect(+ screen.getByRole("link", { name: "Keep going: 4 more steps →" }),+ ).toBeTruthy();+ fireEvent.click(screen.getByRole("button", { name: "Hide" }));+ expect(mocks.dismissHandoff).toHaveBeenCalledOnce();+ expect(screen.queryByText(/First agent ready/)).toBeNull();+ act(() => vi.advanceTimersByTime(1800));+ expect(screen.queryByText(/First agent ready/)).toBeNull();+ completionMount.unmount();+ vi.useRealTimers();++ mocks.get.mockResolvedValueOnce({ data: completedPayload() });+ renderProgressBand(new QueryClient());+ expect(+ await screen.findByRole("link", { name: "Keep going: 4 more steps →" }),+ ).toBeTruthy();+ expect(screen.queryByText("3 of 3 complete")).toBeNull();+});it("celebrates only cached active progress completing on remount", async () => {const freshClient = new QueryClient();mocks.get.mockResolvedValueOnce({ data: completedPayload() });@@ -207,6 +280,7 @@ it("celebrates only cached active progress completing on remount", async () => {await act(() => vi.advanceTimersByTimeAsync(0));expect(screen.getAllByText("First agent ready")).toHaveLength(1);expect(screen.getByRole("status").textContent).toContain("3 of 3 complete");+ expect(screen.queryByRole("link", { name: /Keep going/ })).toBeNull();act(() => vi.advanceTimersByTime(1799));expect(screen.getByText("First agent ready")).toBeTruthy();diff --git a/skyvern-frontend/src/routes/discover/useOnboardingProgress.ts b/skyvern-frontend/src/routes/discover/useOnboardingProgress.tsindex aa0f9d875..9f68bfb77 100644--- a/skyvern-frontend/src/routes/discover/useOnboardingProgress.ts+++ b/skyvern-frontend/src/routes/discover/useOnboardingProgress.ts@@ -153,4 +153,4 @@ function useOnboardingProgress() {restore: () => mutate("restore"),};}-export { useOnboardingProgress };+export { isTimestampOrNull, useOnboardingProgress };diff --git a/skyvern-frontend/src/routes/root/SideNav.tsx b/skyvern-frontend/src/routes/root/SideNav.tsxindex 76963f14f..707495f82 100644--- a/skyvern-frontend/src/routes/root/SideNav.tsx+++ b/skyvern-frontend/src/routes/root/SideNav.tsx@@ -1,3 +1,4 @@+import { DOCS_MCP_URL } from "@/util/externalLinks";import {BookmarkIcon,CalendarIcon,@@ -244,7 +245,7 @@ function SideNav({ collapsed }: Props = {}) {children: [{label: "MCP",- to: "https://www.skyvern.com/docs/developers/getting-started/mcp",+ to: DOCS_MCP_URL,external: true,icon: <RobotIcon className="size-3.5" />,},diff --git a/skyvern-frontend/src/routes/root/useOnboardingTrack.test.ts b/skyvern-frontend/src/routes/root/useOnboardingTrack.test.tsnew file mode 100644index 000000000..ce526b3f1--- /dev/null+++ b/skyvern-frontend/src/routes/root/useOnboardingTrack.test.ts@@ -0,0 +1,86 @@+import { expect, it } from "vitest";+import {+ countedTrackItems,+ parseOnboardingTrack,+ TRACK_KEYS,+} from "./useOnboardingTrack";++const validTrack = () => ({+ version: "onboarding_track_v1",+ state: "active",+ arm: "treatment",+ completed_count: 1,+ total_count: 8,+ items: TRACK_KEYS.map((key, index) => ({+ key,+ completed_at: index === 0 ? "2026-09-01T00:00:00Z" : null,+ verification:+ key === "github_starred" ||+ key === "discord_joined" ||+ key === "social_followed"+ ? "self"+ : "server",+ })),+});++it("accepts a well-formed track", () => {+ expect(parseOnboardingTrack(validTrack())?.completed_count).toBe(1);+});++it("rejects the retired six-key shape", () => {+ const track = validTrack();+ expect(+ parseOnboardingTrack({+ ...track,+ total_count: 6,+ items: track.items.filter(+ (item) => item.key !== "mcp_installed" && item.key !== "github_starred",+ ),+ }),+ ).toBeNull();+});++it("rejects a count that disagrees with the rows", () => {+ expect(+ parseOnboardingTrack({ ...validTrack(), completed_count: 2 }),+ ).toBeNull();+});++it("rejects rows out of the fixed order", () => {+ const track = validTrack();+ [track.items[0], track.items[1]] = [track.items[1]!, track.items[0]!];+ expect(parseOnboardingTrack(track)).toBeNull();+});++it("rejects a server row that claims self attestation", () => {+ const track = validTrack();+ track.items[0]!.verification = "self";+ expect(parseOnboardingTrack(track)).toBeNull();+});++it("rejects an impossible completion date", () => {+ const track = validTrack();+ track.items[0]!.completed_at = "2026-02-30T00:00:00Z";+ expect(parseOnboardingTrack(track)).toBeNull();+});++it("counts only production rows and drops a locked credential row", () => {+ const track = parseOnboardingTrack(validTrack())!;+ expect(countedTrackItems(track, true).map((row) => row.key)).toEqual([+ "first_scheduled_run",+ "first_api_run",+ "mcp_installed",+ "credential_saved",+ ]);+ expect(countedTrackItems(track, false).map((row) => row.key)).toEqual([+ "first_scheduled_run",+ "first_api_run",+ "mcp_installed",+ ]);+});++it("rejects a date-only completion timestamp", () => {+ const track = validTrack();+ track.items[0]!.completed_at = "2026-09-01";+ expect(parseOnboardingTrack(track)).toBeNull();+});diff --git a/skyvern-frontend/src/routes/root/useOnboardingTrack.ts b/skyvern-frontend/src/routes/root/useOnboardingTrack.tsnew file mode 100644index 000000000..fb14fe4f1--- /dev/null+++ b/skyvern-frontend/src/routes/root/useOnboardingTrack.ts@@ -0,0 +1,184 @@+import { getClient } from "@/api/AxiosClient";+import { useCredentialGetter } from "@/hooks/useCredentialGetter";+import { useFeatureFlag } from "@/hooks/useFeatureFlag";+import { useUser } from "@/hooks/useUser";+import {+ getActiveOrgQueryKeyScope,+ getOrgScopedQueryKey,+ useActiveOrgId,+} from "@/store/ActiveOrgContext";+import { isTimestampOrNull } from "@/routes/discover/useOnboardingProgress";+import { ONBOARDING_TRACK_FLAG } from "@/util/featureFlags";+import { isRecord } from "@/util/utils";+import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";++const TRACK_KEYS = [+ "first_scheduled_run",+ "first_api_run",+ "mcp_installed",+ "teammate_invited",+ "credential_saved",+ "github_starred",+ "discord_joined",+ "social_followed",+] as const;+type TrackKey = (typeof TRACK_KEYS)[number];+const TRACK_SIZE = TRACK_KEYS.length;+const SELF_ATTESTED_KEYS: ReadonlySet<TrackKey> = new Set([+ "github_starred",+ "discord_joined",+ "social_followed",+]);+// Rows that count toward N/M. The teammate row stays out until its+// destination exists; community rows are never counted.+const COUNTED_KEYS: readonly TrackKey[] = [+ "first_scheduled_run",+ "first_api_run",+ "mcp_installed",+ "credential_saved",+];+type TrackState = "ineligible" | "active" | "dismissed" | "completed";+type OnboardingTrackItemV1 = {+ key: TrackKey;+ completed_at: string | null;+ verification: "server" | "self";+};+type TrackMutation =+ | { action: "dismiss" | "restore" }+ | { action: "attest"; key: TrackKey };+type OnboardingTrackV1 = {+ version: "onboarding_track_v1";+ state: TrackState;+ arm: "control" | "treatment";+ completed_count: number;+ total_count: typeof TRACK_SIZE;+ items: OnboardingTrackItemV1[];+};++function isTrackState(value: unknown): value is TrackState {+ return (+ value === "ineligible" ||+ value === "active" ||+ value === "dismissed" ||+ value === "completed"+ );+}++function parseOnboardingTrack(value: unknown): OnboardingTrackV1 | null {+ if (!isRecord(value) || value.version !== "onboarding_track_v1") return null;+ const { state, arm, completed_count, total_count, items } = value;+ if (!isTrackState(state)) return null;+ if (arm !== "control" && arm !== "treatment") return null;+ if (+ total_count !== TRACK_SIZE ||+ !Array.isArray(items) ||+ items.length !== TRACK_SIZE+ )+ return null;+ const parsed: OnboardingTrackItemV1[] = [];+ for (const [index, item] of items.entries()) {+ const key = TRACK_KEYS[index];+ if (key === undefined || !isRecord(item) || item.key !== key) return null;+ const completedAt = item.completed_at;+ if (!isTimestampOrNull(completedAt)) return null;+ const verification = SELF_ATTESTED_KEYS.has(key) ? "self" : "server";+ if (item.verification !== verification) return null;+ parsed.push({ key, completed_at: completedAt, verification });+ }+ const derivedCount = parsed.filter((row) => row.completed_at !== null).length;+ if (completed_count !== derivedCount) return null;+ if ((state === "completed") !== (derivedCount === TRACK_SIZE)) return null;+ return {+ version: "onboarding_track_v1",+ state,+ arm,+ completed_count: derivedCount,+ total_count: TRACK_SIZE,+ items: parsed,+ };+}++function useOnboardingTrack() {+ const credentialGetter = useCredentialGetter();+ const activeOrgId = useActiveOrgId();+ const activeUserId = useUser().get()?.id;+ const queryClient = useQueryClient();+ const flag = useFeatureFlag(ONBOARDING_TRACK_FLAG);+ const enabled =+ flag === true && activeOrgId !== undefined && activeUserId !== undefined;+ const queryKey = getOrgScopedQueryKey(+ ["onboarding-track", activeUserId],+ getActiveOrgQueryKeyScope(activeOrgId),+ );+ const {+ data,+ isError,+ isPending: isLoading,+ refetch,+ } = useQuery<OnboardingTrackV1 | null>({+ queryKey,+ queryFn: async ({ signal }) => {+ const client = await getClient(credentialGetter);+ const response = await client.get<unknown>("/users/me/onboarding/track", {+ signal,+ });+ return parseOnboardingTrack(response.data);+ },+ enabled,+ retry: false,+ staleTime: 0,+ refetchOnMount: "always",+ refetchOnWindowFocus: "always",+ });+ const { isPending, mutate } = useMutation({+ mutationFn: async (input: TrackMutation) => {+ const client = await getClient(credentialGetter);+ await client.post(`/users/me/onboarding/track/${input.action}`, {+ ...(input.action === "attest" ? { key: input.key } : {}),+ mutation_id: crypto.randomUUID(),+ });+ },+ onSuccess: () => queryClient.invalidateQueries({ queryKey, exact: true }),+ });+ const track = enabled && !isError ? (data ?? null) : null;+ // An undefined flag, org, or user is still resolving; only an explicit+ // `false` flag disables the track.+ const status: "disabled" | "loading" | "error" | "ready" = !enabled+ ? flag === false+ ? "disabled"+ : "loading"+ : isError+ ? "error"+ : isLoading+ ? "loading"+ : "ready";+ return {+ track: track?.arm === "treatment" ? track : null,+ status,+ isPending,+ refetch,+ dismiss: () => mutate({ action: "dismiss" }),+ restore: () => mutate({ action: "restore" }),+ attest: (key: TrackKey) => mutate({ action: "attest", key }),+ };+}++function countedTrackItems(+ track: OnboardingTrackV1,+ credentialUnlocked: boolean,+): OnboardingTrackItemV1[] {+ return track.items.filter(+ (item) =>+ COUNTED_KEYS.includes(item.key) &&+ (credentialUnlocked || item.key !== "credential_saved"),+ );+}++export {+ countedTrackItems,+ parseOnboardingTrack,+ SELF_ATTESTED_KEYS,+ TRACK_KEYS,+ useOnboardingTrack,+};+export type { OnboardingTrackItemV1, OnboardingTrackV1, TrackKey };diff --git a/skyvern-frontend/src/routes/settings/Settings.tsx b/skyvern-frontend/src/routes/settings/Settings.tsxindex a025fa981..c1d9d511e 100644--- a/skyvern-frontend/src/routes/settings/Settings.tsx+++ b/skyvern-frontend/src/routes/settings/Settings.tsx@@ -1,6 +1,4 @@-import { useEffect } from "react";-import { useLocation } from "react-router-dom";-+import { useScrollToHash } from "@/hooks/useScrollToHash";import { Label } from "@/components/ui/label";import {Select,@@ -48,23 +46,12 @@ function describeRuntimeCredential(credential: RuntimeCredential): string {}function Settings() {- const { hash } = useLocation();+ useScrollToHash();const { environment, organization, setEnvironment, setOrganization } =useSettingsStore();const credential = useRuntimeCredential();const { data: versionData } = useVersionQuery();- useEffect(() => {- if (!hash) {- return;- }-- document.getElementById(hash.slice(1))?.scrollIntoView({- behavior: "smooth",- block: "start",- });- }, [hash]);-return (<div className="flex flex-col gap-8"><Card>diff --git a/skyvern-frontend/src/util/externalLinks.ts b/skyvern-frontend/src/util/externalLinks.tsnew file mode 100644index 000000000..38ff7eeac--- /dev/null+++ b/skyvern-frontend/src/util/externalLinks.ts@@ -0,0 +1,10 @@+export const DISCORD_INVITE_URL = "https://discord.com/invite/fG2XXEuQX3";+export const GITHUB_REPO_URL = "https://github.com/skyvern-ai/skyvern";+export const X_URL = "https://x.com/skyvernai";+export const LINKEDIN_URL = "https://www.linkedin.com/company/skyvern/";++const DOCS_BASE_URL = "https://www.skyvern.com/docs";+export const DOCS_SCHEDULING_URL = `${DOCS_BASE_URL}/cloud/building-agents/scheduling`;+export const DOCS_API_QUICKSTART_URL = `${DOCS_BASE_URL}/developers/getting-started/quickstart`;+export const DOCS_MCP_URL = `${DOCS_BASE_URL}/developers/getting-started/mcp`;+export const DOCS_CREDENTIALS_URL = `${DOCS_BASE_URL}/developers/features/authentication-and-2fa`;diff --git a/skyvern-frontend/src/util/featureFlags.ts b/skyvern-frontend/src/util/featureFlags.tsindex 9ce7e4fac..c3d706098 100644--- a/skyvern-frontend/src/util/featureFlags.ts+++ b/skyvern-frontend/src/util/featureFlags.ts@@ -42,3 +42,5 @@ export const CREDENTIAL_FALLBACK_RETRY_FLAG = "CREDENTIAL_FALLBACK_RETRY";export const RECORD_BROWSER_CODE_FIRST_FLAG = "record_browser_code_first";export const ONBOARDING_PROGRESS_FLAG = "onboarding_progress_v1";++export const ONBOARDING_TRACK_FLAG = "onboarding_track_v1";