From e45340c0cfe1b45bd9af1e4457bdb03a4acfe096 Mon Sep 17 00:00:00 2001 From: scotttong Date: Thu, 26 Nov 2026 00:44:56 +0000 Subject: [PATCH] Align the default-account note with the onboarding API key field (#23009) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Thinking Path > - People use Paperclip to manage agents at work. > - Onboarding connects the first agent to a model provider. > - When a user enters a new API key, the form explains which account becomes the default. > - The note touched the input border. Its text started to the left of the placeholder. > - The field now lays out its own note and exposes it as an accessible description. ## Linked Issues or Issue Description **What happened?** The default-account note touched the lower edge of the API key field. The input had no accessible description. **Expected behavior** The note should sit below the field, align with the input text, and wrap at narrow widths. Assistive technology should announce it with the field. **Steps to reproduce** 1. Start onboarding with a new organization that has no saved provider keys. 2. Name the agent. Choose **Use API key instead**, then **OpenAI**. 3. Inspect the field and note at desktop width and at 320 px. **Paperclip version or commit** Reproduced on `e18fe61c8f`. Related PR #19557 added the note. ## What Changed - Give the shared onboarding field an optional description. Use the input's horizontal inset and an 8 px vertical gap. - Associate the description with its input through `aria-describedby`. - Pass the existing provider-specific sentence from the new-key form. Add a regression test for fields with and without a description. ## Verification - The regression test failed on the original field and passed after the fix. All 17 focused field and saved-credential tests passed. - The UI typecheck passed. The selected UI suites passed 3,944 tests, with one skip. - In Chrome, verified alignment and wrapping at 1280 × 900 and 320 × 740. Checked the accessible description, password masking, and the saved-key path with a disposable database. - Three local CLI worktree tests could not start native PostgreSQL clusters because the host exhausted its shared-memory slots. The CLI telemetry test passed on a separate run using its standard environment. ## Risks The field also serves sign-in flows. The description is optional. Fields without one retain their existing input markup. ## Model Used OpenAI Codex (GPT-6) with local code execution and browser verification. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [ ] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge Co-Authored-By: Scott Tong Co-authored-by: Scott Tong --- ui/src/components/AdapterLoginChrome.test.tsx | 14 ++++++++++++++ ui/src/components/AdapterLoginChrome.tsx | 16 ++++++++++++++-- ui/src/components/OnboardingWizard.tsx | 2 +- 3 files changed, 29 insertions(+), 3 deletions(-) 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.