Repository navigation
fix(mobile): offer Copy link in the chat's MCP sign-in when the phone can't open the page - #51525
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
supportaiforall-cmd
left a comment
There was a problem hiding this comment.
Approved in CodeRabbit Change Stack
supportaiforall-cmd
left a comment
There was a problem hiding this comment.
Approved in CodeRabbit Change Stack
… can't open the page The /mcp tray opened the agent's MCP sign-in page and ignored a refusal, so a link longer than today's store shell takes left Sign in and Open again doing nothing. The row now shows Copy link for the same sign-in, reusing the tool sign-in's useSignInLinkCopy.
…and finish message
fac45a9 to
9a4602d
Compare
ELI5
In a phone chat, the MCP servers tray (/mcp) has a "Sign in" button for servers that need one. If the sign-in page's address was too long for the installed phone app, tapping Sign in or "Open again" did nothing. Now the tray shows "Copy link" instead, so you can paste the address into your browser and finish signing in.
What Changed
Mechanism: each server row reuses
useSignInLinkCopyfrom #51303. That hook knows whether this phone's app can open the link and ties the copy to the sign-in attempt.McpButtonmoved unchanged into its own file to keep the panel under the line cap.Why
#51303 fixed the tool sign-in pages but not the other places the phone opens a link and ignores a refusal. I checked each one on main:
src/main/composio/composio-api.ts:214-222). The other Composio links are fixedCOMPOSIO_PAGESconstants.cloud/packages/connector-contract/src/slack-bot-messages.ts:11-17). Its length comes from Orca's fixed scope list, not anything a user enters. The other Slack links are short constants or permalinks.Reusing the hook keeps one rule for when a sign-in has to be copied instead of opened.
Linked Issue
#48342. This follows up the merged fix, which closed it, and covers another sign-in surface.
Visual Proof
These are the real tray component and hook rendered at phone width (402 pt) in Chromium, with a scripted sign-in whose link is too long for today's store app. A real agent MCP sign-in on a phone needs a live agent turn.
Before / next store build (on today's store app, "Open again" did nothing for this link):
After, sign-in finished by pasting the address (light, then Copied in dark):
After, sign-in finished on the provider's site (light, then Copied in dark):
Testing
Rendered the real panel in light and dark for both sign-in kinds, at both today's store-app link limit and the next build's. Tapped Copy link and saw Copied.
pnpm check:changedand mobile typecheck pass.Two review rounds, plus a perf pass: no P0/P1. Both P2s from round 1 (the cut-off status line and the "page that opened" message) are fixed. After the design review, the row no longer reads "Open in browser" while the link must be copied (scoped review: no findings).
Not run on a device: simulator slots were taken. The open/copy rule is the one fix(mobile): open long sign-in links, and offer Copy link where the phone can't #51303 proved on the iOS simulator.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
No test added: this is a UI fallback reusing a hook #51303 already proved on a device, and a test would only pin UI.
Performance
None, because each tray row adds one hook that does nothing while no sign-in runs. While a sign-in runs, it parses the URL once (memoized) and writes the clipboard once per tap. There are no timers or subscriptions.
Risk
Level: Low
The change only shows up when a phone's app can't open the sign-in link; otherwise the tray is unchanged. Native screens never take this path, and desktop's tray doesn't use this component. A plain revert undoes it.
AI Disclosure
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)