diff --git a/ui/src/components/AdapterLoginChrome.test.tsx b/ui/src/components/AdapterLoginChrome.test.tsx index 33d11fc1c3b..56e99f348f2 100644 --- a/ui/src/components/AdapterLoginChrome.test.tsx +++ b/ui/src/components/AdapterLoginChrome.test.tsx @@ -121,6 +121,20 @@ describe("the connect step's cards", () => { expect(key!.getAttribute("aria-label")).toBe("API key"); }); + it("associates a field with its optional description", () => { + render( + <> + {}} onSubmit={() => {}} /> + {}} onSubmit={() => {}} /> + , + ); + + const [described, plain] = container.querySelectorAll("input"); + const descriptionId = described!.getAttribute("aria-describedby"); + expect(document.getElementById(descriptionId ?? "")?.textContent).toBe("Account details"); + expect(plain!.hasAttribute("aria-describedby")).toBe(false); + }); + it("holds one height across the card's waiting and ready states", () => { // The card opens on a spinner and then fills. Both states share a floor, so // the footer below is pushed down once for one event rather than twice — diff --git a/ui/src/components/AdapterLoginChrome.tsx b/ui/src/components/AdapterLoginChrome.tsx index 914b62cdd06..2e7cd7a821f 100644 --- a/ui/src/components/AdapterLoginChrome.tsx +++ b/ui/src/components/AdapterLoginChrome.tsx @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState, type ClipboardEvent, type ReactNode } from "react"; +import { useEffect, useId, useRef, useState, type ClipboardEvent, type ReactNode } from "react"; import { AnimatePresence, motion } from "motion/react"; import { Copy, Check, Loader2 } from "lucide-react"; @@ -365,6 +365,7 @@ export function OnboardingCardField({ onPaste, disabled, label = "Authorization code", + description, placeholder = "Paste authorization code here", masked = false, autoFocus = false, @@ -376,6 +377,7 @@ export function OnboardingCardField({ onPaste?: (event: ClipboardEvent) => void; disabled?: boolean; label?: string; + description?: string; placeholder?: string; /** * Dots instead of the value. The key card asks for it because a provider key @@ -395,11 +397,13 @@ export function OnboardingCardField({ autoFocus?: boolean; className?: string; }) { - return ( + const descriptionId = useId(); + const input = ( ); + if (!description) return input; + + return ( +
+ {input} +

{description}

+
+ ); } /** Shared authentication presentation. Hosts retain their existing session lifecycle. */ diff --git a/ui/src/components/OnboardingWizard.tsx b/ui/src/components/OnboardingWizard.tsx index cb9e2d6a999..9c6451ff957 100644 --- a/ui/src/components/OnboardingWizard.tsx +++ b/ui/src/components/OnboardingWizard.tsx @@ -3306,6 +3306,7 @@ function OnboardingWizardInner({ }} />} {!selectedApiKey && !hasGatewaySelection && !connectionModels && handleConnectStepPrimary()} />} - {managedProvider && !selectedApiKey && !hasGatewaySelection && !connectionModels &&

This will be your default {CONNECT_SOURCE_NAMES[adapterType] ?? managedProvider} account.

} {hasGatewaySelection && (gatewayLookupFailed ? <>

Your saved gateway connection could not be loaded. Retry to choose a model and connect your agent.