diff --git a/ui/src/components/AdapterLoginChrome.tsx b/ui/src/components/AdapterLoginChrome.tsx index d8901f55c81..2209893b00f 100644 --- a/ui/src/components/AdapterLoginChrome.tsx +++ b/ui/src/components/AdapterLoginChrome.tsx @@ -533,13 +533,17 @@ export function ProviderSubscriptionCard({ ); } - if (mark && (mode === "submitted_code" || mode === "displayed_code")) { + if (mark) { + const nextInstruction = mode === "submitted_code" ? "Return to this window and enter the authorization code." + : mode === "displayed_code" ? "Enter the code below in the sign-in window." + : mode === "hosted_redirect" ? "Return here and paste the authorization code or callback URL." + : "Finish signing in and return to this window."; const signInInstruction = `Sign into your ${providerName} account`; return ( 1. {signInInstruction}{mode === "submitted_code" && " and copy the authorization code"}. - 2. {mode === "submitted_code" ? "Return to this window and enter the authorization code." : "Enter the code below in the sign-in window."} + 2. {nextInstruction} }>
diff --git a/ui/src/components/ai-connections/AiConnectionCredentialStep.tsx b/ui/src/components/ai-connections/AiConnectionCredentialStep.tsx index 72b605b74a4..bd7c492dfd0 100644 --- a/ui/src/components/ai-connections/AiConnectionCredentialStep.tsx +++ b/ui/src/components/ai-connections/AiConnectionCredentialStep.tsx @@ -27,7 +27,7 @@ type Props = { name: string; hideName?: boolean; defaultAccountDialog?: boolean; - inlineOpenAiSubscription?: boolean; + providerDialog?: boolean; onOtherModels?: () => void; advancedProviders?: ReactNode; nameForMethod?: (method: AiAuthMethod) => string; @@ -48,7 +48,7 @@ export function AiConnectionCredentialStep(props: Props) { return ; } -function SubscriptionConnectionStep({ defaultAccountDialog, inlineOpenAiSubscription, onOtherModels, advancedProviders, companyId, provider, initialMethod, fixedMethod, connectionId, name: initialName, hideName, nameForMethod, ownership, agentIds, allAgents, environmentId: suppliedEnvironmentId, loginAgentId, onComplete, onCancel, defaults, disabled }: Props) { +function SubscriptionConnectionStep({ defaultAccountDialog, providerDialog, onOtherModels, advancedProviders, companyId, provider, initialMethod, fixedMethod, connectionId, name: initialName, hideName, nameForMethod, ownership, agentIds, allAgents, environmentId: suppliedEnvironmentId, loginAgentId, onComplete, onCancel, defaults, disabled }: Props) { const [name, setName] = useState(initialName); const [draftMethod, setDraftMethod] = useState<"subscription" | "api">(initialMethod === "api_key" ? "api" : "subscription"); const [draftKey, setDraftKey] = useState(""); @@ -114,8 +114,8 @@ function SubscriptionConnectionStep({ defaultAccountDialog, inlineOpenAiSubscrip const loadError = views.find((view) => view.kind === "error"); const intent: AiConnectionLoginIntent = { provider: provider as AiConnectionLoginIntent["provider"], method: "subscription", name, ownership, agentIds, allAgents, connectionId }; const dialogFields = defaultAccountDialog && (provider === "anthropic" || provider === "openai"); - const accountFields = <>{!hideName && }{defaults}; - return
+ const accountFields = <>{!hideName && }{!providerDialog && defaults}; + return
{!dialogFields && accountFields} {!suppliedEnvironmentId && !forced.forced && loginEnvironments.length > 1 && 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.

} @@ -165,8 +165,8 @@ function ApiKeyConnectionStep({ advancedProviders, companyId, provider, connecti {(envs.data ?? []).filter(env => env.status === "active").map(env => {env.name})} } {environmentError &&

{environmentError}

} - {defaults} { 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}
; diff --git a/ui/src/components/ai-connections/AiProviderSetup.tsx b/ui/src/components/ai-connections/AiProviderSetup.tsx index ef8ffab1366..21a995a4467 100644 --- a/ui/src/components/ai-connections/AiProviderSetup.tsx +++ b/ui/src/components/ai-connections/AiProviderSetup.tsx @@ -267,6 +267,7 @@ export function AiProviderSetup({ ); const accessDefaults = !reconnect ? ( ; return (
event.stopPropagation()}> - {!(step === "provider" && hideProviderHeading) && ( + {!(hideProviderHeading && (providerGrid || step === "provider")) && (

{step === "provider" @@ -318,7 +319,7 @@ export function AiProviderSetup({ ) : !advanced ? ( true} managedAccount={{ defaultAccountDialog: presentation === true, - inlineOpenAiSubscription: presentation === "other-models", + providerDialog: presentation === "other-models", intent: { provider, method: "subscription", diff --git a/ui/src/components/new-agent/AgentProviderConnection.tsx b/ui/src/components/new-agent/AgentProviderConnection.tsx index 901cd2c2e63..304630218f8 100644 --- a/ui/src/components/new-agent/AgentProviderConnection.tsx +++ b/ui/src/components/new-agent/AgentProviderConnection.tsx @@ -77,7 +77,8 @@ export function AgentProviderConnection({ /** Connections supplies its access intent; presentation and login controllers stay shared. */ managedAccount?: { defaultAccountDialog?: boolean; - inlineOpenAiSubscription?: boolean; + providerDialog?: boolean; + accessSettings?: ReactNode; preparingEnvironment?: boolean; draft?: { method: "subscription" | "api"; @@ -307,7 +308,7 @@ export function AgentProviderConnection({ const localLoginAction = localLoginPrimary.action; const wizardCard = managedAccount?.defaultAccountDialog && (adapterType === "claude_local" || adapterType === "codex_local"); - const inlineLogin = Boolean((wizardCard || managedAccount?.inlineOpenAiSubscription) && opened && method === "subscription"); + const inlineLogin = Boolean((wizardCard || managedAccount?.providerDialog) && opened && method === "subscription"); const localReady = inlineLogin && !needsLogin && canUseLocalLogin && localLogin.status === "ready"; const autoSaved = useRef(false); useEffect(() => { @@ -318,9 +319,9 @@ export function AgentProviderConnection({ void connect(); } }, [localReady, managedAccount?.disabled, connect]); - const providerMark = wizardCard || inlineLogin + const providerMark = (wizardCard || managedAccount?.providerDialog) && (adapterType === "claude_local" || adapterType === "codex_local") ? - : ; + : ; const switchMode = (next: ModelConnectionMode) => { if (advancedConnection && next === (advanced ? "advanced" : method)) return; onDraftChanged?.(); @@ -337,7 +338,7 @@ export function AgentProviderConnection({ return (
{ if (managedAccount?.disabled) return; if (id === "other") { managedAccount?.onOtherModels?.(); return; } @@ -459,7 +460,7 @@ export function AgentProviderConnection({

) : inlineLogin && (managedAccount?.preparingEnvironment || (needsHealth && health.isPending && !needsLogin) || (canUseLocalLogin && !needsLogin && !localLogin.error && localLogin.status !== "expired" && !localReady && - (localLogin.preparing || !localLogin.authorizationUrl))) ? ( + (adapterType === "grok_local" ? !localLogin.command : localLogin.preparing || !localLogin.authorizationUrl))) ? ( {null} @@ -549,6 +550,7 @@ export function AgentProviderConnection({ {needsHealth && healthView.kind === "error" && (

Could not prepare sign-in. Reload this page to try again.

)} + {managedAccount?.accessSettings &&
{managedAccount.accessSettings}
} {managedAccount?.advancedProviders &&
{managedAccount.advancedProviders}
} { diff --git a/ui/src/features/connections/ConnectionSetupFlow.tsx b/ui/src/features/connections/ConnectionSetupFlow.tsx index 87f9f1b2316..7e25f2c16eb 100644 --- a/ui/src/features/connections/ConnectionSetupFlow.tsx +++ b/ui/src/features/connections/ConnectionSetupFlow.tsx @@ -4333,6 +4333,7 @@ export function AccessStepContent({ hideFooter = false, /** Embedded: drop the page-level width cap so it fits its container. */ bare = false, + flat = false, onBack, onContinue, }: { @@ -4364,6 +4365,7 @@ export function AccessStepContent({ pending?: boolean; hideFooter?: boolean; bare?: boolean; + flat?: boolean; onBack: () => void; onContinue: () => void; }) { @@ -4414,9 +4416,9 @@ export function AccessStepContent({ return (
-
+
-
+

{identityHeading}

{githubIdentity && grantKind === "agent" ? (

This agent uses this GitHub account for everyone’s work, instead of the person giving instructions.

@@ -4510,7 +4512,7 @@ export function AccessStepContent({ )}
-
+

{agentAccessHeading}

{preserveAgentAccess ? (
@@ -4655,6 +4657,7 @@ export function ConnectionAccessDefaults({ sentence, notice, extra, + flat = false, forceOpen = false, disabled = false, ...accessProps @@ -4682,7 +4685,7 @@ export function ConnectionAccessDefaults({ const [open, setOpen] = useState(false); const expanded = open || forceOpen; return ( - +

{sentence}

{(notice ?? []).map((reason) => ( @@ -4701,8 +4704,8 @@ export function ConnectionAccessDefaults({
{extra} {agents - ? {}} onContinue={() => {}} /> - : {}} onContinue={() => {}} />} + ? {}} onContinue={() => {}} /> + : {}} onContinue={() => {}} />}