From a93d971eedfe5d06e59dd7f8156a9374ee92d3e1 Mon Sep 17 00:00:00 2001 From: Tonio Date: Wed, 2 Dec 2026 18:25:24 -0800 Subject: [PATCH] Refine Connect account sign-in controls and access badges (#23576) ## Thinking Path > - Paperclip lets people connect provider accounts to agents. > - The Connect account dialog shows the sign-in controls and credential access. > - A pasted callback requires an additional submit action. > - The desktop dialog has room for the three controls on one row. > - Back should return to the provider grid in one step. ## Linked Issues or Issue Description Related PR #23551. **What happened?** The submit control occupied a second row and Back collapsed the selected provider before returning to the grid. **Expected behavior** Keep desktop controls inline, stack them on mobile, and return directly to the grid. **Steps to reproduce** Select Antigravity under Other Models. Inspect the sign-in controls, then press Back. ## What Changed Adjust the Antigravity and Grok sign-in marks. Show overlapping credential access badges. Simplify the submit label and the Back action. ## Verification All 35 focused AdapterLoginChrome and AgentProviderConnection tests passed. ## Risks Narrow viewports use a stacked layout. The available callback controls depend on the environment. ## Model Used OpenAI GPT-6, via Codex. ## Checklist - [ ] I have included a thinking path that traces from project context to this change - [ ] I have specified the model used (with version and capability details) - [ ] 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 - [ ] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [ ] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [ ] 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 - [ ] I have added or updated tests where applicable - [ ] I have updated relevant documentation to reflect my changes - [ ] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [ ] I will address all Greptile and reviewer comments before requesting merge --- ui/src/components/AdapterLoginChrome.test.tsx | 8 ++-- ui/src/components/AdapterLoginChrome.tsx | 44 ++++++++++--------- .../ai-connections/useLocalAiLogin.test.tsx | 2 +- .../new-agent/AgentProviderConnection.tsx | 12 ++++- .../connections/ConnectionSetupFlow.tsx | 30 ++++++++++++- .../credential-access-badges.test.ts | 14 ++++++ .../connections/credential-access-badges.ts | 13 ++++++ 7 files changed, 93 insertions(+), 30 deletions(-) create mode 100644 ui/src/features/connections/credential-access-badges.test.ts create mode 100644 ui/src/features/connections/credential-access-badges.ts diff --git a/ui/src/components/AdapterLoginChrome.test.tsx b/ui/src/components/AdapterLoginChrome.test.tsx index bae179d506d..f4cc938440f 100644 --- a/ui/src/components/AdapterLoginChrome.test.tsx +++ b/ui/src/components/AdapterLoginChrome.test.tsx @@ -420,7 +420,7 @@ describe("session replay", () => { Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")!.set!.call(input, "http://127.0.0.1:41234/?state=bad&code=abc"); input!.dispatchEvent(new Event("input", { bubbles: true })); }); - const submitButton = Array.from(container.querySelectorAll("button")).find(b => b.textContent === "Submit redirect URL") as HTMLButtonElement; + const submitButton = Array.from(container.querySelectorAll("button")).find(b => b.textContent === "Submit") as HTMLButtonElement; await act(async () => { submitButton.click(); }); await vi.waitFor(() => expect(container.querySelector('[role="alert"]')?.textContent).toContain("does not match")); expect(submitCode).toHaveBeenCalledWith("http://127.0.0.1:41234/?state=bad&code=abc"); @@ -432,13 +432,13 @@ describe("session replay", () => { Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")!.set!.call(retryInput, "http://127.0.0.1:41234/?state=good&code=xyz"); retryInput!.dispatchEvent(new Event("input", { bubbles: true })); }); - const retrySubmit = Array.from(container.querySelectorAll("button")).find(b => b.textContent === "Submit redirect URL") as HTMLButtonElement; + const retrySubmit = Array.from(container.querySelectorAll("button")).find(b => b.textContent === "Submit") as HTMLButtonElement; await act(async () => { retrySubmit.click(); }); await vi.waitFor(() => expect(container.textContent).toContain("Finishing sign-in")); expect(submitCode).toHaveBeenCalledWith("http://127.0.0.1:41234/?state=good&code=xyz"); }); - it("prompts for an authorization code with a Submit code button for antigravity.google/oauth-callback", async () => { + it("prompts for an authorization code with a Submit button for antigravity.google/oauth-callback", async () => { const submitCode = vi.fn().mockResolvedValueOnce(undefined); const container = await render( { Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")!.set!.call(input, "4/0code-value"); input!.dispatchEvent(new Event("input", { bubbles: true })); }); - const submitButton = Array.from(container.querySelectorAll("button")).find(b => b.textContent === "Submit code") as HTMLButtonElement | undefined; + const submitButton = Array.from(container.querySelectorAll("button")).find(b => b.textContent === "Submit") as HTMLButtonElement | undefined; expect(submitButton).toBeDefined(); await act(async () => { submitButton!.click(); }); expect(submitCode).toHaveBeenCalledWith("4/0code-value"); diff --git a/ui/src/components/AdapterLoginChrome.tsx b/ui/src/components/AdapterLoginChrome.tsx index 2209893b00f..06e2dbcd8cd 100644 --- a/ui/src/components/AdapterLoginChrome.tsx +++ b/ui/src/components/AdapterLoginChrome.tsx @@ -524,7 +524,7 @@ export function ProviderSubscriptionCard({ {failureMessage ?? (failure === "expired" ? "This sign-in expired. Retry signing in to get a new code." : "Sign-in didn’t finish. Try signing in again.")} Your setup is saved. }> -
+
{retry && } @@ -547,7 +547,7 @@ export function ProviderSubscriptionCard({ }>
-
+
{waiting ? ( } -
{children}
+
{children}
{waiting && authorizationUrl && (
@@ -882,29 +882,31 @@ export function LocalProviderLoginInstructions({ adapterType, login, hostedRedir {submitError &&

{submitError}

} {!onboardingSignIn && }
: hostedGoogleRedirect ?
-

+ {(!onboardingSignIn || optionalHostedGoogleRedirect) &&

{optionalHostedGoogleRedirect ? <>Finish signing in in the Antigravity browser window, then return here. If your browser is on another machine and the 127.0.0.1 redirect page won’t load, copy the full URL from your address bar and paste it below. : isHostedAntigravityCodeCallback(safeAuthorizationUrl) ? <>After signing in to Antigravity, copy the authorization code shown on the page and paste it below. : <>After signing in to Antigravity, copy the authorization code or full callback URL from your browser and paste it below.} -

- { - setSubmitError(null); - setBrowserCode(value); - }} - onPaste={pasteBrowserCode} - onSubmit={() => void submitBrowserCode()} - disabled={submitting} - /> - +

} +
+ { + setSubmitError(null); + setBrowserCode(value); + }} + onPaste={pasteBrowserCode} + onSubmit={() => void submitBrowserCode()} + disabled={submitting} + /> + +
{submitError &&

{submitError}

}
: adapterType === "antigravity_runtime" ?

Finish signing in in the Antigravity browser window, then return here.

: } } diff --git a/ui/src/components/ai-connections/useLocalAiLogin.test.tsx b/ui/src/components/ai-connections/useLocalAiLogin.test.tsx index e0fc012c3c6..f4e87cfd071 100644 --- a/ui/src/components/ai-connections/useLocalAiLogin.test.tsx +++ b/ui/src/components/ai-connections/useLocalAiLogin.test.tsx @@ -194,7 +194,7 @@ it("immediately triggers check after submitting a hosted Google redirect URL", a Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")!.set!.call(input, "http://127.0.0.1:41234/?state=hosted&code=abc123"); input.dispatchEvent(new Event("input", { bubbles: true })); }); - flushSync(() => Array.from(host.querySelectorAll("button")).find(b => b.textContent === "Submit redirect URL")!.click()); + flushSync(() => Array.from(host.querySelectorAll("button")).find(b => b.textContent === "Submit")!.click()); await vi.waitFor(() => expect(api.submitLocalLoginCode).toHaveBeenCalledWith("company", "attempt-1", "http://127.0.0.1:41234/?state=hosted&code=abc123")); await vi.waitFor(() => expect(api.checkLocalLogin).toHaveBeenCalledTimes(2)); diff --git a/ui/src/components/new-agent/AgentProviderConnection.tsx b/ui/src/components/new-agent/AgentProviderConnection.tsx index 304630218f8..042dc34b70a 100644 --- a/ui/src/components/new-agent/AgentProviderConnection.tsx +++ b/ui/src/components/new-agent/AgentProviderConnection.tsx @@ -322,6 +322,13 @@ export function AgentProviderConnection({ const providerMark = (wizardCard || managedAccount?.providerDialog) && (adapterType === "claude_local" || adapterType === "codex_local") ? : ; + const signInMark = adapterType === "claude_local" || adapterType === "codex_local" ? providerMark : ( + + {adapterType === "grok_local" + ? + : } + + ); const switchMode = (next: ModelConnectionMode) => { if (advancedConnection && next === (advanced ? "advanced" : method)) return; onDraftChanged?.(); @@ -399,7 +406,7 @@ export function AgentProviderConnection({ />
)} - + ) : needsLogin ? !awaitingLoginRequest && ( @@ -557,6 +564,7 @@ export function AgentProviderConnection({ if (opened && !advancedConnection) { localLoginPrimary.resetSubmitting(); cancel(); + if (managedAccount?.providerDialog) onBack(); } else onBack(); }} compact={Boolean(wizardCard)} diff --git a/ui/src/features/connections/ConnectionSetupFlow.tsx b/ui/src/features/connections/ConnectionSetupFlow.tsx index 7e25f2c16eb..bca0a9c712d 100644 --- a/ui/src/features/connections/ConnectionSetupFlow.tsx +++ b/ui/src/features/connections/ConnectionSetupFlow.tsx @@ -93,6 +93,8 @@ import { toolsApi } from "@/api/tools"; import { agentsApi } from "@/api/agents"; import { appCopyFor, credentialFieldLabel } from "@/lib/app-gallery-copy"; import { JsonSchemaForm, validateJsonSchemaForm, type JsonSchemaNode } from "@/components/JsonSchemaForm"; +import { credentialAccessBadges } from "./credential-access-badges"; +import { Avatar, AvatarFallback, AvatarGroup, AvatarGroupCount } from "@/components/ui/avatar"; import { AgentMultiSelect, type AgentMultiSelectOption } from "@/components/AgentMultiSelect"; import { describeError, errorStatus } from "@/api/errors"; import { InlineBanner } from "@/components/InlineBanner"; @@ -4684,10 +4686,34 @@ export function ConnectionAccessDefaults({ }) { const [open, setOpen] = useState(false); const expanded = open || forceOpen; + const { installChoice, installAgentIds } = accessProps; + const { visible, remaining } = useMemo( + () => credentialAccessBadges(flat ? agents ?? [] : [], installAgentIds, installChoice === "all"), + [flat, agents, installAgentIds, installChoice], + ); + const ownerLabel = accessProps.grantKind === "organization" ? "Organization" : "You"; + return ( -
-

{sentence}

+
+
+

{sentence}

+ {flat && + + + {accessProps.grantKind === "organization" ? : } + + + {visible.map((agent, index) => ( + + {Array.from(agent.name.trim())[0]?.toLocaleUpperCase()} + + ))} + {remaining > 0 && +{remaining}} + } +