Skip to content

feat(mobile): manage Google, GitHub and Linear accounts from the phone's connector pages - #47671

Merged
AmoabaKelvin merged 3 commits into
mainfrom
mobile-connector-account-actions
Nov 23, 2026
Merged

AmoabaKelvin merged 3 commits into
mainfrom
mobile-connector-account-actions

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

The phone's Google, GitHub and Linear pages for an agent could only show things for most account changes and told you to go to the computer. Now you can pick the default Google account, share the Google setup with teammates, disconnect a Google account, add or refresh GitHub accounts, and reconnect a wrong GitHub or Linear link from the phone.

Files Added Deleted Net
Test 0 0 0 0
Prod 18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​485 $\color{#cf222e}{\Huge{\mathbf{−}}}$​135 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​350

What Changed

  • Google page (MobileBotGooglePage, new phone-google-accounts.tsx), as the desktop's GoogleAccountRow / GoogleAccountSettings:
    • With several accounts on a host that keeps a default, each account's group has a checked Default row or a Set as default row (google.default.set).
    • Share setup exports the team's app file (google.client.export) and opens the share sheet. The page's web view on Android (and any web view without navigator.share) copies it instead and says "Copied. Send it to your teammates."
    • A ⋯ menu offers Remove from (host) and Remove and revoke at Google for each account. Both go through a confirm that uses the desktop's words, including "(email) becomes the default." (google.disconnect).
    • The note under the accounts now says only what still needs the computer: "Add a service or another account in Orca on (host)." Those are Google sign-ins, which aren't on the phone's allowlist.
  • GitHub page ⋯: Add another GitHub account and Refresh (shown when the cloud lists several logins, as on desktop), and Reconnect. Each opens the existing Connect GitHub setup page with the sign-in already started with the account picker (bots.connect.start with switchAccount). Reconnect unlinks first, as the desktop's connectAnotherAccount does.
  • Linear page ⋯: Reconnect, the same unlink then sign-in.
  • These sign-in-only trips go back to the page once linked. They never turn the agent on in another workspace. A failed one shows its error on the Connect step, with a retry that keeps the account picker.
  • The phone's "already linked" error no longer points to a Settings path that only exists on the desktop. It says "Unlink it from ⋯ on the Linear page first." (GitHub likewise). The stale Chinese strings for that and for the old note were removed so English shows until they're translated.

Patterns followed: the ⋯ PullDownMenu and in-drawer ConfirmContent from MobileBotGitHubPage.tsx:150-185 (remove confirm) and MobileBotLinearPage.tsx:262-290 (menu). The sign-in reuses usePhoneConnectTrip and the ConnectorHandoff waiting step from MobileBotGitHubSetup.tsx.

Why

Every method used here was already on the phone's allowlist (runtime-rpc-mobile-bot-methods.ts), but nothing on the phone called it, so these account actions only worked on the computer. Reusing the existing setup page and connect trip keeps one sign-in flow on the phone, not a second one in the menus. Without a new app build the page's shell has no file-share verb, so Share setup shares the file's text where the web view can and otherwise copies it.

Page size fence

Main had 724 bytes left under the phone page's eager fence and this PR needs ~4.2 KB, so it raises MOBILE_WEB_APP_BUNDLE_MAX_EAGER_BYTES from 10.90625 MiB to 10.9375 MiB (+32 KiB).

Linked Issue

None. This is phone parity with the desktop's Google default account (#47192) and GitHub Refresh (#47467).

Visual Proof

Real phone components in the mobile web page at 402 pt wide, with a stand-in host.

Google page, two accounts: Default / Set as default

Before After
dark (screenshot removed: contained real product data) (screenshot removed: contained real product data)
light (screenshot removed: contained real product data) (screenshot removed: contained real product data)

Google page, lower: Share setup, and the note now says what's still on the computer

Before After
dark (screenshot removed: contained real product data) (screenshot removed: contained real product data)
light (screenshot removed: contained real product data) (screenshot removed: contained real product data)

Google ⋯ menu: Remove from (host) / Remove and revoke at Google per account

Before After
dark (not on the phone) (screenshot removed: contained real product data)
light (not on the phone) (screenshot removed: contained real product data)

Disconnect confirm (desktop copy)

Before After
dark (not on the phone) (screenshot removed: contained real product data)
light (not on the phone) (screenshot removed: contained real product data)

GitHub ⋯ menu: Add another GitHub account, Refresh, Reconnect

Before After
dark (screenshot removed: contained real product data) (screenshot removed: contained real product data)
light (screenshot removed: contained real product data) (screenshot removed: contained real product data)

Linear ⋯ menu: Reconnect

Before After
dark (screenshot removed: contained real product data) (screenshot removed: contained real product data)
light (screenshot removed: contained real product data) (screenshot removed: contained real product data)

Reconnect unlinks, then opens GitHub's sign-in on the computer

Before After
dark (not on the phone) (screenshot removed: contained real product data)
light (not on the phone) (screenshot removed: contained real product data)

Testing

  • Rendered every state in the real mobile web page bundle (Chromium, 402×874, light and dark) against a stand-in host. Checked the requests each tap sends:

    • Set as default → google.default.set {account}
    • Share setup → google.client.export, then the copy fallback (headless Chromium has no navigator.share)
    • GitHub Reconnect → bots.github.unlink {userId}, bots.connect.start {source: github, switchAccount: true}, browser.tabCreate, and one trip only
    • Linear Reconnect → the same, with bots.linear.unlink {workspaceId}
    • A refused bots.connect.start after Add another GitHub account shows "Orca Cloud could not be reached…" on the Connect step.
    • A finished Reconnect returns to the GitHub page, not Try it.
  • pnpm --dir mobile typecheck and pnpm check:changed pass.

  • 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 tests added. The change wires existing host methods into phone UI. The rendered checks above cover it better than a component test would.

Performance

None, because every new call runs only on a tap. The Google status read gains two optional fields it already returned.

Risk

Level: Low

The riskiest part is Reconnect. It unlinks the host's GitHub or Linear account before the sign-in, as the desktop does, so if the sign-in is abandoned the account stays unlinked until you connect again. Older hosts that don't report a default Google account don't show the Default rows, and they behave as before. Back out with a plain revert.

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

  • Security: no new host methods. All of them were already allowed for the paired phone. Google sign-in (Add a service, another account, Allow again) still finishes on the computer.
  • Mixed versions: the new status fields are optional, and Set as default hides on hosts without them.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Linear and GitHub setup flows now support sign-in and reconnect actions. Google account management adds disconnect and revocation choices, default-account selection, and setup sharing. The changes also add operation schemas and update account status handling and localization strings. The mobile web app eager-byte ceiling increases.

Merge Risk: Low · up to 42fa5

The phone connector pages gain account management for Google, GitHub and Linear. A few edge cases remain open: a failed Google revocation is not reported, an automatic sign-in can be skipped when no client is ready, Chinese users see English for one error, and a Linear reconnect may stay open for an uninstalled workspace. These are bounded and can be followed up.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: account management actions (set default, share setup, remove, reconnect) for Google, GitHub and Linear accounts on the phone's connector pages. The changeset matches t…
Description check Passed The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, N…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: account management actions (set default, share setup, remove, reconnect) for Google, GitHub and Linear accounts on the phone's connector pages. The changeset matches this scope. It uses a conventional feat(mobile) prefix and is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections. The before/after visuals, testing steps, performance reasoning, and risk level with a rollback method are all present. Gaps: the Linked Issue section says 'None' and cites related issues (#47192, #47467) instead of a 'Fixes #' link. The template says outside contributors must link an issue, but the author may be a maintainer, so this is a minor gap. The Risk section also names the riskiest part and the revert method. The AI Disclosure section is empty. The Review section is empty. The Testing checkbox for automated tests is checked, but the explanation says no tests were added, so the checklist is internally inconsistent. The 'Every added test fails' box is unchecked, which is consistent with no tests.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ac5a290b-5d7f-4fe6-997a-0227e8f745da
Commits

Reviewing files that changed from the base of the PR and between 202537a and 42fa56a.

Files selected for processing: 1

  • config/scripts/build/mobile-web-app/verify-mobile-web-app-bundle.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Pass the expected refresh token to the readiness save. · google-connect.ts:186

src/main/google/google-connect.ts:186
Minor · Data Integrity & Integration · Quick win

Pass the expected refresh token to the readiness save.

checkAccounts reads the account record, awaits checkGoogleServices, then saves the stale record with no condition. If disconnect removes the account during that await, the save recreates the account file with its stored credentials. The removal and the save both take the .mutation lock. The lock orders the two writes, but it does not stop the stale save from running after the removal.

The conditional write in saveGoogleAccount rejects a save when the stored refresh token differs from the expected value, including when the file is gone. Passing record.refreshToken limits the save to the case where the same account still exists.

This race is in code that this PR does not change. The new phone remove action reaches it through the existing google.disconnect method. The desktop path can reach it through the same handler.

Records without a refreshToken skip this check, so the change above does not cover them. The save must also reject a write for those records when the account file no longer exists. The required behavior is clear. The implementation is left to the author.

Suggested fix

-          await saveGoogleAccount({ ...record, services, checkedAt: this.deps.now() })
+          await saveGoogleAccount(
+            { ...record, services, checkedAt: this.deps.now() },
+            record.refreshToken
+          )
Additional comments: 2

mobile/src/bots/connectors/MobileBotLinearSetup.tsx-152-153: 1

152-153: Minor · Functional Correctness · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Close account-only reconnects after linking, without requiring installation.

If Reconnect successfully links a workspace where Orca is not installed, step becomes needs-admin. linkedTurnOn remains null, so this branch never closes the page. The user instead receives an installation request.

Handle successful signIn completion independently of linkedTurnOn. Keep the installation requirement for normal connector setup. The PR objectives specify that reconnect only links the account again.

mobile/src/bots/connectors/MobileBotGitHubSetup.tsx-107-108: 1

107-108: Minor · Functional Correctness · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Complete account-only sign-in without requiring an Orca installation.

If the last account reconnects successfully but has no accessible Orca installations, step becomes install. The enclosing step === 'turn-on' condition prevents this branch from closing the page. The user receives an installation request instead of returning after sign-in.

Handle successful signIn completion before the installation-dependent condition. Keep that condition for normal connector setup. The PR objectives specify that these account actions only link again.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ca326811-3b8a-4661-bee1-67099becf836
Commits

Reviewing files that changed from the base of the PR and between 0aeafa4 and da56a18.

Files selected for processing: 17

  • mobile/src/bots/connectors/MobileBotConnectorAccountPages.tsx
  • mobile/src/bots/connectors/MobileBotConnectors.tsx
  • mobile/src/bots/connectors/MobileBotGitHubPage.tsx
  • mobile/src/bots/connectors/MobileBotGitHubSetup.tsx
  • mobile/src/bots/connectors/MobileBotGoogleConnect.tsx
  • mobile/src/bots/connectors/MobileBotGooglePage.tsx
  • mobile/src/bots/connectors/MobileBotLinearPage.tsx
  • mobile/src/bots/connectors/MobileBotLinearSetup.tsx
  • mobile/src/bots/connectors/bot-connector-account-operations.ts
  • mobile/src/bots/connectors/connector-pages.ts
  • mobile/src/bots/connectors/mobile-connector-account-copy.ts
  • mobile/src/bots/connectors/phone-connector-needs.ts
  • mobile/src/bots/connectors/phone-google-accounts.tsx
  • mobile/src/bots/connectors/use-phone-connect-trip.ts
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/zh.json
  • mobile/src/session/native-chat/transcript/bot-cards/mobile-bot-card-operations.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

void googleDisconnect
.request(props.client, { account: email, revoke }, { failWhenDisconnected: true })
.then((reply) => googleDisconnect.interpret(reply))
.then(() => google.refresh(), props.failed)

@coderabbitai coderabbitai Bot Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Security & Privacy · Quick win

Report revocation failure after local removal.

If Google revocation fails, the host still removes the local account and returns revoked: false. This callback discards that result and shows no warning. Access elsewhere can remain active despite the confirmation text. (raw.githubusercontent.com)

Decode revoked in googleDisconnect. Always refresh after local removal. If revoke is true and revocation is not confirmed, tell the user to revoke access in Google account settings. A normal retry cannot revoke the removed account.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping this as is for this PR. The desktop's Disconnect (disconnectGoogle in google-connect-client.ts, used by GoogleAccountRow) also ignores revoked and shows the same confirm text, and this PR brings that action to the phone unchanged. Reporting a failed revoke needs new copy on both surfaces, so it belongs in its own change.

Comment on lines +163 to +164
started.current = true
start(true)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Keep the automatic sign-in attempt until a client is available.

useSignInOnOpen sets its one-time marker before start(true) runs. When client is null, start returns without a request, so the automatic attempt is lost. A later non-null client re-runs the effect, but the marker blocks the call. The page then stays idle until the user starts sign-in manually.

Mark the attempt as used only after a non-null client starts it. Pass client readiness into the hook, or gate the call in both the GitHub and Linear setups, so that start(true) runs once a client is present.

"replaced": "Linear 连接未完成,可能已被之后发起的 Linear 或 GitHub 连接取代。请重新开始",
"wrongAccount": "此登录是从另一个 Orca 账户发起的。请从当前账户重新连接 Linear",
"alreadyLinked": "此 Orca 账户已关联到该工作区中的另一个 Linear 用户。请先在“设置 › Bots › Linear”中取消关联",
"notAMember": "只有该 Linear 工作区的正式成员才能从中选择人员",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Add Chinese translations for the already_linked error keys.

The already_linked branch still uses bots.linear.errors.alreadyLinked and bots.github.errors.alreadyLinked. Both keys were removed from mobile/src/i18n/locales/zh.json. For Chinese users, the lookup falls back to the English inline text, so this error appears in English.

Add zh entries for both keys. Each entry must name the current unlink location in the mobile connector UI, which the English fallback describes as "⋯" on the connector page.

@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-connector-account-actions branch from da56a18 to 202537a Compare November 23, 2026 16:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5e6d6ace-28a9-44df-b696-7682aabcb8cd
Commits

Reviewing files that changed from the base of the PR and between da56a18 and 202537a.

Files selected for processing: 9

  • mobile/src/bots/connectors/MobileBotConnectorAccountPages.tsx
  • mobile/src/bots/connectors/MobileBotGitHubSetup.tsx
  • mobile/src/bots/connectors/MobileBotGooglePage.tsx
  • mobile/src/bots/connectors/MobileBotLinearSetup.tsx
  • mobile/src/bots/connectors/phone-connector-needs.ts
  • mobile/src/bots/connectors/phone-google-accounts.tsx
  • mobile/src/bots/connectors/use-phone-connect-trip.ts
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/zh.json
Files skipped from review as they are similar to previous changes: 2

  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/zh.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Comment on lines +150 to +151
if (props.signIn) {
props.onClose()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Close the Linear reconnect page when the linked workspace needs an administrator install.

A reconnect that links a Linear workspace without installing Orca in it stays on the setup page. The step becomes needs-admin, so linkedTurnOn is null and the signIn branch never calls props.onClose(). The reconnect is meant to return to the connector page and must not enable the bot. The completion effect should close the page for any linked reconnect. It should turn the workspace on only for an installed workspace in ordinary setup, and it should keep the installation requirement there.

@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-connector-account-actions branch from 202537a to 42fa56a Compare November 23, 2026 16:54
@AmoabaKelvin
AmoabaKelvin merged commit 9b664bf into main Nov 23, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant