From 24e095c160aec0f7381b72bcc915df09b22dc7e2 Mon Sep 17 00:00:00 2001
From: Tonio
Date: Thu, 3 Dec 2026 01:35:02 -0800
Subject: [PATCH] Keep provider navigation visible in Connect account (#23602)
## Thinking Path
> - Paperclip helps people manage AI agents.
> - Agents use provider connections to run tasks.
> - People choose those providers in the Connect account dialog.
> - A selected provider needs a direct path back to the grid.
> - Two cards keep that path visible during sign-in.
## Linked Issues or Issue Description
**Subsystem affected**
Connect account dialog.
**Current behavior**
The grid entry disappears for some providers. A disabled Next button
takes up space during automatic sign-in.
**Proposed behavior**
Show the selected provider and Other Models together. Show a primary
action when the flow requires one.
## What Changed
- Added access to the provider grid from native and custom connection
forms.
- Hid the footer during automatic sign-in and retained explicit
connection actions.
## Verification
- Ran the two AgentProviderConnection test files. All 13 tests passed.
## Risks
- Switching to another provider leaves the current credential draft.
## Model Used
GPT-6 (Codex).
---
.../AiConnectionCredentialStep.tsx | 7 +++++--
.../ai-connections/AiConnectionField.tsx | 6 +-----
.../ai-connections/AiProviderSetup.tsx | 9 ++++++---
.../new-agent/AgentProviderConnection.test.tsx | 3 ++-
.../new-agent/AgentProviderConnection.tsx | 17 ++++++++---------
.../components/onboarding/ModelSourceTiles.tsx | 17 +++++++++++++++++
6 files changed, 39 insertions(+), 20 deletions(-)
diff --git a/ui/src/components/ai-connections/AiConnectionCredentialStep.tsx b/ui/src/components/ai-connections/AiConnectionCredentialStep.tsx
index bd7c492dfd0..c1ad3fc8f6e 100644
--- a/ui/src/components/ai-connections/AiConnectionCredentialStep.tsx
+++ b/ui/src/components/ai-connections/AiConnectionCredentialStep.tsx
@@ -2,6 +2,8 @@ import { AI_CONNECTION_CAPABILITIES, adapterLoginCommandKey, pluginLoginChoices,
import { useMemo, useState, type ReactNode } from "react";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { type AiProvider, type AiAuthMethod, type AiConnectionLoginIntent } from "@paperclipai/shared";
+import { AccountProviderTiles } from "../onboarding/ModelSourceTiles";
+import { AppLogo } from "@/pages/apps/AppLogo";
import { AgentProviderConnection } from "@/components/new-agent/AgentProviderConnection";
import { ProviderApiKeyCard } from "@/components/AdapterLoginChrome";
import { Button } from "@/components/ui/button";
@@ -140,7 +142,7 @@ function SubscriptionConnectionStep({ defaultAccountDialog, providerDialog, onOt
;
}
-function ApiKeyConnectionStep({ providerDialog, advancedProviders, companyId, provider, connectionId, name: initialName, hideName, nameForMethod, ownership, agentIds, allAgents, environmentId: suppliedEnvironmentId, defaults, disabled, onComplete, onCancel }: Props) {
+function ApiKeyConnectionStep({ providerDialog, onOtherModels, advancedProviders, companyId, provider, connectionId, name: initialName, hideName, nameForMethod, ownership, agentIds, allAgents, environmentId: suppliedEnvironmentId, defaults, disabled, onComplete, onCancel }: Props) {
const [name, setName] = useState(initialName);
const [apiKey, setApiKey] = useState("");
const client = useQueryClient();
@@ -157,6 +159,7 @@ function ApiKeyConnectionStep({ providerDialog, advancedProviders, companyId, pr
onSettled: () => setApiKey(""),
});
return
+ {onOtherModels &&
}} mode="api" onOtherModels={onOtherModels} />}
{!hideName &&
Connection name setName(event.target.value)} disabled={Boolean(connectionId)} /> }
{save.error &&
{describeError(save.error).body}
}
{copilot &&
Use a personal fine-grained token with Copilot Requests permission. GitHub token instructions . Verification discovers models in the selected environment and sends no model prompt. Repository access uses a separate connection.
}
@@ -168,6 +171,6 @@ function ApiKeyConnectionStep({ providerDialog, advancedProviders, companyId, pr
{ if (!preparing && !environmentError && name.trim() && apiKey.trim()) save.mutate(); }} disabled={disabled || save.isPending || preparing || Boolean(environmentError)} placeholder={copilot ? "github_pat_..." : "Enter API key here"} autoFocus />
{defaults}
{advancedProviders}
- Cancel save.mutate()}>{save.isPending ? "Connecting…" : "Connect"}
+ {!onOtherModels && Cancel } save.mutate()}>{save.isPending ? "Connecting…" : "Connect"}
;
}
diff --git a/ui/src/components/ai-connections/AiConnectionField.tsx b/ui/src/components/ai-connections/AiConnectionField.tsx
index e2c247162e2..26fd2b22276 100644
--- a/ui/src/components/ai-connections/AiConnectionField.tsx
+++ b/ui/src/components/ai-connections/AiConnectionField.tsx
@@ -294,15 +294,11 @@ export function AiConnectionField({
:
showSetup(true)}
+ onOtherModels={() => { setReconnecting(undefined); showSetup(true); }}
defaults={!reconnecting &&
setAllAgents(checked === true)} />
Allow all agents in this company to use this account for my tasks
}
- advancedProviders={!reconnecting && provider !== "anthropic" && provider !== "openai" &&
- Advanced providers
- showSetup(true)}>Choose another provider or gateway
- }
companyId={companyId}
provider={provider}
initialMethod={reconnecting?.method ?? method}
diff --git a/ui/src/components/ai-connections/AiProviderSetup.tsx b/ui/src/components/ai-connections/AiProviderSetup.tsx
index 21a995a4467..64230d84787 100644
--- a/ui/src/components/ai-connections/AiProviderSetup.tsx
+++ b/ui/src/components/ai-connections/AiProviderSetup.tsx
@@ -16,6 +16,7 @@ import { describeError } from "@/api/errors";
import { QueryErrorState, useQueryView } from "@/components/QueryView";
import { ConnectionChoiceList } from "@/features/connections/ConnectionChoiceList";
import { ConnectionAccessDefaults, connectionDefaultSummarySentence } from "@/features/connections/ConnectionSetupFlow";
+import { AccountProviderTiles } from "../onboarding/ModelSourceTiles";
import { PluginTile } from "@/pages/apps/PluginMarketplace";
import { AppLogo } from "@/pages/apps/AppLogo";
import { Button } from "@/components/ui/button";
@@ -320,6 +321,7 @@ export function AiProviderSetup({
) : !advanced ? (
+ {providerGrid && provider && : provider === "local" ? : }} mode={provider === "gateway" || provider === "local" ? "advanced" : "api"} onOtherModels={cancel} />}
{(provider === "gateway" || provider === "local") && (
<>
@@ -458,15 +461,15 @@ export function AiProviderSetup({
)}
{accessDefaults}
-
-
+ {!providerGrid &&
Back
-
+ }
{
flushSync(() => button("Sign in")!.click());
expect(open).toHaveBeenCalledOnce();
expect(button(waiting)?.disabled).toBe(true);
- expect(button("Next")?.disabled).toBe(true);
+ expect(button("Next")).toBeUndefined();
+ expect(button("Back")).toBeUndefined();
expect(host.querySelector("a")).toBeNull();
} finally {
open.mockRestore();
diff --git a/ui/src/components/new-agent/AgentProviderConnection.tsx b/ui/src/components/new-agent/AgentProviderConnection.tsx
index 042dc34b70a..50c033e0131 100644
--- a/ui/src/components/new-agent/AgentProviderConnection.tsx
+++ b/ui/src/components/new-agent/AgentProviderConnection.tsx
@@ -4,7 +4,7 @@ import { aiConnectionsApi } from "@/api/ai-connections";
import { useLocalAiLogin } from "../ai-connections/useLocalAiLogin";
import type { AiConnectionBinding, AiConnectionLoginIntent } from "@paperclipai/shared";
import { useEffect, useRef, useState, type ReactNode } from "react";
-import { Cable, Cpu, Loader2 } from "lucide-react";
+import { Cable, Loader2 } from "lucide-react";
import { useQuery } from "@tanstack/react-query";
import { motion } from "motion/react";
import {
@@ -25,7 +25,7 @@ import {
} from "../AdapterLoginChrome";
import { Button } from "../ui/button";
import { ModelSourceMark } from "../onboarding/ModelSourceMark";
-import { ModelSourceTiles, type ModelConnectionMode } from "../onboarding/ModelSourceTiles";
+import { ModelSourceTiles, otherModelsTile, type ModelConnectionMode } from "../onboarding/ModelSourceTiles";
import { useQueryView } from "../QueryView";
import { CredentialModeLink } from "../onboarding/CredentialModeLink";
import { FooterNav } from "../onboarding/FooterNav";
@@ -306,8 +306,7 @@ export function AgentProviderConnection({
onBeforeRetry: () => setError(null),
});
const localLoginAction = localLoginPrimary.action;
- const wizardCard = managedAccount?.defaultAccountDialog &&
- (adapterType === "claude_local" || adapterType === "codex_local");
+ const wizardCard = managedAccount?.defaultAccountDialog;
const inlineLogin = Boolean((wizardCard || managedAccount?.providerDialog) && opened && method === "subscription");
const localReady = inlineLogin && !needsLogin && canUseLocalLogin && localLogin.status === "ready";
const autoSaved = useRef(false);
@@ -357,14 +356,14 @@ export function AgentProviderConnection({
label: provider,
icon: providerMark,
},
- ...(wizardCard && managedAccount?.onOtherModels ? [{ id: "other", label: "Other Models", icon: }] : []),
+ ...(managedAccount?.onOtherModels ? [otherModelsTile] : []),
]}
mode={advanced ? "advanced" : method}
selectedId={advancedConnection ? (advanced ? "advanced" : method) : opened ? adapterType : null}
collapsed={!managedAccount?.providerDialog && !wizardCard && !advancedConnection && opened}
onSelect={id => {
- if (managedAccount?.disabled) return;
if (id === "other") { managedAccount?.onOtherModels?.(); return; }
+ if (managedAccount?.disabled) return;
if (advancedConnection) switchMode(id as ModelConnectionMode);
else setOpened(true);
}}
@@ -559,8 +558,8 @@ export function AgentProviderConnection({
)}
{managedAccount?.accessSettings && {managedAccount.accessSettings}
}
{managedAccount?.advancedProviders && {managedAccount.advancedProviders}
}
- {
+ {(!inlineLogin || (localReady && error)) && {
if (opened && !advancedConnection) {
localLoginPrimary.resetSubmitting();
cancel();
@@ -627,7 +626,7 @@ export function AgentProviderConnection({
return;
} else void connect();
}}
- />
+ />}
>}
);
diff --git a/ui/src/components/onboarding/ModelSourceTiles.tsx b/ui/src/components/onboarding/ModelSourceTiles.tsx
index 32b269f6937..72393b629af 100644
--- a/ui/src/components/onboarding/ModelSourceTiles.tsx
+++ b/ui/src/components/onboarding/ModelSourceTiles.tsx
@@ -1,6 +1,7 @@
import { useRef, type ReactNode } from "react";
import { AnimatePresence, motion } from "motion/react";
+import { Cpu } from "lucide-react";
import { cn } from "../../lib/utils";
import {
SOURCE_EXIT_FADE,
@@ -32,6 +33,22 @@ export type ModelSource = {
credentialMode?: ModelConnectionMode | null;
};
+export const otherModelsTile: ModelSource = {
+ id: "other",
+ label: "Other Models",
+ icon: ,
+};
+
+export function AccountProviderTiles({ source, mode, onOtherModels }: {
+ source: ModelSource;
+ mode: ModelConnectionMode;
+ onOtherModels: () => void;
+}) {
+ return { if (id === otherModelsTile.id) onOtherModels(); }} />;
+}
+
const CREDENTIAL_TAG_LABEL: Record = {
subscription: "Subscription",
api: "API key",