From 741bed66515f7d6e89248d7ad545e961e8b65bb0 Mon Sep 17 00:00:00 2001 From: Tonio Date: Thu, 3 Dec 2026 00:43:39 -0800 Subject: [PATCH] Align credential chips and clarify Restart sign-in (#23600) ## Thinking Path > - Paperclip lets people share provider credentials with selected agents. > - Connect account shows those agents as profile chips. > - The identity chip and disclosure link have different alignment needs. > - Give the chips one height and place the disclosure beside the access summary. > - Label the sign-in restart action directly. ## Linked Issues or Issue Description Related PR #23598. **What happened?** The identity chip was shorter than the agent chips, and the Change link moved when the chips wrapped. **Expected behavior** Keep chips at 28 pixels. Align Change and Done with the summary. Show Restart sign-in for the isolated sign-in flow. **Steps to reproduce** Open Antigravity under Other Models in Connect account and expand the access editor. ## What Changed Move the disclosure to the summary row and align its baseline. Set a common chip height. Update the restart link and its tests. ## Verification All 51 focused credential access and sign-in tests passed. ## Risks Long summaries can wrap on narrow viewports. ## 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 --- doc/connections/AI-CONNECTIONS.md | 2 +- ui/src/components/AdapterLoginChrome.test.tsx | 5 ++- ui/src/components/AdapterLoginChrome.tsx | 2 +- .../ai-connections/useLocalAiLogin.test.tsx | 12 ++--- .../AgentProviderConnection.test.tsx | 2 +- .../connections/ConnectionSetupFlow.tsx | 44 +++++++++---------- .../onboarding-agent-arc.stories.tsx | 2 +- 7 files changed, 34 insertions(+), 35 deletions(-) diff --git a/doc/connections/AI-CONNECTIONS.md b/doc/connections/AI-CONNECTIONS.md index b319152be5c..bc9e3376009 100644 --- a/doc/connections/AI-CONNECTIONS.md +++ b/doc/connections/AI-CONNECTIONS.md @@ -715,7 +715,7 @@ Claude, Codex, and Grok check only their connection-specific login home. The health response selects whether a self-hosted user may sign in. Leaving and returning to a local sign-in screen resumes its active attempt. Navigation -does not delete its credential home. **Start sign-in again** +does not delete its credential home. **Restart sign-in** explicitly cancels the old attempt; abandoned attempts expire after 30 minutes. Completed and expired attempts are cleaned up through the existing lifecycle. diff --git a/ui/src/components/AdapterLoginChrome.test.tsx b/ui/src/components/AdapterLoginChrome.test.tsx index f4cc938440f..feda2e8e6f1 100644 --- a/ui/src/components/AdapterLoginChrome.test.tsx +++ b/ui/src/components/AdapterLoginChrome.test.tsx @@ -520,19 +520,20 @@ describe("session replay", () => { it("hides the inline error retry link only when primaryHandlesRetry is enabled", async () => { const failedLogin = { ...login, + isolated: true, status: "expired" as const, error: "Google sign-in did not complete. Start sign-in again.", }; const standalone = await render( , ); - expect(standalone.textContent).toContain("Start sign-in again"); + expect(standalone.textContent).toContain("Restart sign-in"); const footerOwned = await render( , ); expect(footerOwned.textContent).toContain("Google sign-in did not complete."); - expect(Array.from(footerOwned.querySelectorAll("button")).find(b => b.textContent === "Start sign-in again")).toBeUndefined(); + expect(Array.from(footerOwned.querySelectorAll("button")).find(b => b.textContent === "Restart sign-in")).toBeUndefined(); }); it("maps local/hosted sign-in state to the expected primary footer CTA", () => { diff --git a/ui/src/components/AdapterLoginChrome.tsx b/ui/src/components/AdapterLoginChrome.tsx index 06e2dbcd8cd..f422f609502 100644 --- a/ui/src/components/AdapterLoginChrome.tsx +++ b/ui/src/components/AdapterLoginChrome.tsx @@ -918,6 +918,6 @@ export function LocalProviderLoginInstructions({ adapterType, login, hostedRedir } } {login?.error &&

{login.error}

} - {showInlineRetry && } + {showInlineRetry && } ; } diff --git a/ui/src/components/ai-connections/useLocalAiLogin.test.tsx b/ui/src/components/ai-connections/useLocalAiLogin.test.tsx index f4e87cfd071..2d89287e6d0 100644 --- a/ui/src/components/ai-connections/useLocalAiLogin.test.tsx +++ b/ui/src/components/ai-connections/useLocalAiLogin.test.tsx @@ -39,7 +39,7 @@ it("checks once under StrictMode, preserves renaming and navigation, and cancels expect(api.cancelLocalLogin).not.toHaveBeenCalled(); flushSync(() => Array.from(host.querySelectorAll('button')).find(b => b.textContent === 'Connect')!.click()); await vi.waitFor(() => expect(api.connectLocal).toHaveBeenCalledWith("company", expect.objectContaining({ name: "Renamed", localSessionId: "attempt-1" }))); - flushSync(() => Array.from(host.querySelectorAll('button')).find(b => b.textContent === 'Start sign-in again')!.click()); + flushSync(() => Array.from(host.querySelectorAll('button')).find(b => b.textContent === 'Restart sign-in')!.click()); await vi.waitFor(() => expect(api.startLocalLogin).toHaveBeenCalledTimes(2)); expect(api.cancelLocalLogin).toHaveBeenCalledTimes(1); expect(api.cancelLocalLogin.mock.invocationCallOrder[0]).toBeLessThan(api.startLocalLogin.mock.invocationCallOrder[1]); @@ -48,7 +48,7 @@ it.each(["anthropic", "openai"] as const)("waits for the %s authorization card b api.checkLocalLogin.mockResolvedValue({ status: "sign_in_required" }); flushSync(() => root.render()); await vi.waitFor(() => expect(host.textContent).toContain("Preparing browser sign-in")); - expect(host.textContent).not.toContain("Start sign-in again"); + expect(host.textContent).not.toContain("Restart sign-in"); expect(api.startLocalLogin).toHaveBeenCalledTimes(1); api.checkLocalLogin.mockResolvedValue({ status: "sign_in_required", authorizationUrl: "https://example.test/authorize", code: "ABCD-12345" }); @@ -56,14 +56,14 @@ it.each(["anthropic", "openai"] as const)("waits for the %s authorization card b await vi.waitFor(() => expect(host.querySelector('a[href="https://example.test/authorize"]')).not.toBeNull()); if (provider === "anthropic") expect(host.querySelector('input[aria-label="Authorization code"]')).not.toBeNull(); else expect(host.textContent).toContain("ABCD-12345"); - const retry = Array.from(host.querySelectorAll("button")).find(button => button.textContent === "Start sign-in again"); + const retry = Array.from(host.querySelectorAll("button")).find(button => button.textContent === "Restart sign-in"); expect(retry).toBeTruthy(); api.checkLocalLogin.mockResolvedValue({ status: "sign_in_required" }); flushSync(() => retry!.click()); await vi.waitFor(() => expect(api.startLocalLogin).toHaveBeenCalledTimes(2)); await vi.waitFor(() => expect(host.textContent).toContain("Preparing browser sign-in")); - expect(host.textContent).not.toContain("Start sign-in again"); + expect(host.textContent).not.toContain("Restart sign-in"); expect(api.cancelLocalLogin).toHaveBeenCalledTimes(1); }); @@ -100,7 +100,7 @@ it("explicit retry can replace an attempt opened in another authentication host" api.startLocalLogin.mockRejectedValueOnce(new Error("Another sign-in is still open.")); flushSync(() => root.render()); await vi.waitFor(() => expect(host.textContent).toContain("Another sign-in")); - flushSync(() => Array.from(host.querySelectorAll('button')).find(b => b.textContent === 'Start sign-in again')!.click()); + flushSync(() => Array.from(host.querySelectorAll('button')).find(b => b.textContent === 'Restart sign-in')!.click()); await vi.waitFor(() => expect(host.textContent).toContain("ABCD-12345")); expect(api.startLocalLogin).toHaveBeenLastCalledWith("company", expect.objectContaining({ restart: true })); }); @@ -158,7 +158,7 @@ it("hides a failed device prompt and lets the user restart sign-in", async () => expect(host.textContent).not.toContain("OLD-CODE"); expect(host.querySelector('a[href="https://auth.openai.com/codex/device"]')).toBeNull(); api.checkLocalLogin.mockResolvedValue({ status: "sign_in_required", authorizationUrl: "https://auth.openai.com/codex/device", code: "NEW-CODE" }); - flushSync(() => Array.from(host.querySelectorAll("button")).find(b => b.textContent === "Start sign-in again")!.click()); + flushSync(() => Array.from(host.querySelectorAll("button")).find(b => b.textContent === "Restart sign-in")!.click()); await vi.waitFor(() => expect(host.textContent).toContain("NEW-CODE")); expect(host.querySelector('[role="alert"]')).toBeNull(); }); diff --git a/ui/src/components/new-agent/AgentProviderConnection.test.tsx b/ui/src/components/new-agent/AgentProviderConnection.test.tsx index 96ddb455178..871cd243b0e 100644 --- a/ui/src/components/new-agent/AgentProviderConnection.test.tsx +++ b/ui/src/components/new-agent/AgentProviderConnection.test.tsx @@ -201,7 +201,7 @@ describe("AgentProviderConnection hosted Google sign-in gating", () => { expect(startSignInCta!.disabled).toBe(false); // Redundant inline retry link is hidden when the footer owns Start sign in. expect(Array.from(host.querySelectorAll("button")).find( - (button) => button.textContent?.trim() === "Start sign-in again", + (button) => button.textContent?.trim() === "Restart sign-in", )).toBeUndefined(); flushSync(() => startSignInCta!.click()); diff --git a/ui/src/features/connections/ConnectionSetupFlow.tsx b/ui/src/features/connections/ConnectionSetupFlow.tsx index 4e212f7bbb0..1408c032466 100644 --- a/ui/src/features/connections/ConnectionSetupFlow.tsx +++ b/ui/src/features/connections/ConnectionSetupFlow.tsx @@ -4697,37 +4697,35 @@ export function ConnectionAccessDefaults({ return ( -
-
-

{sentence}

- {flat &&
- - {accessProps.grantKind === "organization" ? : } - {ownerLabel} - - {installChoice === "all" && Any agent} - {selected.map(agent => - - {editable && } - )} - {editable && installChoice === "specific" && accessProps.setInstallAgentIds(new Set(installAgentIds).add(id))} />} -
} -
+
+

{sentence}

+ {flat &&
+ + {accessProps.grantKind === "organization" ? : } + {ownerLabel} + + {installChoice === "all" && Any agent} + {selected.map(agent => + + {editable && } + )} + {editable && installChoice === "specific" && accessProps.setInstallAgentIds(new Set(installAgentIds).add(id))} />} +
} {(notice ?? []).map((reason) => (

{reason}

))} diff --git a/ui/storybook/stories/onboarding/onboarding-agent-arc.stories.tsx b/ui/storybook/stories/onboarding/onboarding-agent-arc.stories.tsx index 77ae7c978fa..c482a2925b4 100644 --- a/ui/storybook/stories/onboarding/onboarding-agent-arc.stories.tsx +++ b/ui/storybook/stories/onboarding/onboarding-agent-arc.stories.tsx @@ -588,7 +588,7 @@ function localSubscriptionStory( } await expect(screen.queryByRole("combobox", { name: "Saved subscription" })).not.toBeInTheDocument(); await expect(screen.queryByText(/Run this in a terminal/)).not.toBeInTheDocument(); - await expect(screen.queryByRole("button", { name: "Start sign-in again" })).not.toBeInTheDocument(); + await expect(screen.queryByRole("button", { name: "Restart sign-in" })).not.toBeInTheDocument(); }, }; }