Skip to content

feat(mobile): show desktop account providers on mobile - #36755

Closed
gsxdsm wants to merge 5 commits into
stablyai:mainfrom
gsxdsm:feat/mobile-desktop-accounts
Closed

gsxdsm wants to merge 5 commits into
stablyai:mainfrom
gsxdsm:feat/mobile-desktop-accounts

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

The phone Accounts screen now lists the same account types as the desktop app. You can switch Claude, Codex, OpenCode, and Devin on the phone. The other providers show how much usage is left. Adding or signing in still happens on the desktop.

What Changed

Before, mobile Accounts showed Claude, Codex, and a Grok usage bar. It now also shows OpenCode, Devin, Gemini, Antigravity, OpenCode Go, MiniMax, Cursor, and GLM Coding Plan when the connected desktop reports them.

OpenCode and Devin rows switch the active profile. Antigravity lists saved Google accounts only when the host supports native Antigravity accounts, and selecting one switches that saved account. The other new sections are read-only usage, with the same windows and pool names as desktop. Providers with nothing to show stay hidden. OpenCode Go shows all available session, weekly, and monthly windows; late snapshots from a previously viewed host are ignored. A desktop that does not send these fields still shows the previous screen.

Why

The phone was missing account types desktop Settings already supports. The phone reads the snapshot and account-switch calls the desktop already has, instead of keeping a second account store. Sign-in, key entry, and removal stay on the desktop, where those credentials are created.

Linked Issue

Fixes #36908

Visual Proof

No device screenshot in this PR. Render tests cover OpenCode selection, Gemini and GLM usage, Grok weekly and monthly copy, and Antigravity staying hidden until the host advertises native accounts.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

pnpm exec vitest run on the accounts snapshot, usage selectors, and Accounts screen tests: 5 files, 56 tests passed. Not exercised on a device. Desktop macOS, Linux, Windows, and SSH behavior is unchanged. The phone reads the existing accounts snapshot, and it calls accounts.selectData plus the capability-gated Antigravity list and select.

Review

Cross-platform: this is the React Native Accounts screen, including the web accounts route that mounts it. No new platform paths or shortcuts.

Remote and SSH: the phone talks to the connected host. Older hosts omit the new snapshot fields. Antigravity listing runs only when the host advertises accounts.antigravity-native.v1.

Agents: each desktop Accounts provider is represented. Kimi stays off this screen because desktop shows it in the status bar only.

Performance: one extra capability probe, and one Antigravity list when the host supports it. Usage sections render from the snapshot the screen already receives.

Security: the phone cannot add, edit, or remove credentials. Switching uses the existing accounts-admin calls.

UI: the new sections reuse the Accounts cards, usage bars, and theme tokens. Long pool names sit above the bar.

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

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)
  • 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 Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review
Walkthrough

The mobile accounts screen now uses dedicated sections for Claude, Codex, managed-data accounts, Antigravity, and provider usage. Snapshot validation and usage helpers support additional providers, account data, and usage windows. Account selections call host RPCs, report failures through notices, and refresh account data after success. Host-scoped checks prevent stale snapshot and refresh results from updating the screen. Tests cover provider visibility, usage rendering, account selection, and Antigravity capability gating.

Merge Risk: Low · previous review e21b5

Switching hosts during a selection can show accounts from the previous host. Guarding the response would prevent this limited issue.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 28.13% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: showing desktop account providers on mobile.
Description check Passed The description is mostly complete and covers the user-facing changes, rationale, linked issue, testing, compatibility, security, performance, and rollback-related considerations. It does not include …
Linked Issues check Passed Issue #36908 is the only directly linked issue. Its coding requirements are: (1) show available desktop provider accounts and usage on mobile; (2) allow profile switching where the host supports it; (…
Out of Scope Changes check Passed All changed files relate to the mobile Accounts screen and its data path: the screen, account section components, snapshot schema, usage selectors, usage bar label width, provider icons (OpenCode Go, …
Full details: Description check

Explanation

The description is mostly complete and covers the user-facing changes, rationale, linked issue, testing, compatibility, security, performance, and rollback-related considerations. It does not include the required Risk section with an explicit level, and it does not provide the required visual proof or state N/A exactly as requested. These are documentation gaps, but the description remains sufficiently complete and on-topic.

Full details: Linked Issues check

Explanation

Issue #36908 is the only directly linked issue. Its coding requirements are: (1) show available desktop provider accounts and usage on mobile; (2) allow profile switching where the host supports it; (3) stay compatible with older hosts that omit these fields; (4) keep credential management on desktop. The whole-PR summary (merge base to head) covers each requirement. (1) mobile/src/components/accounts-snapshot.ts adds optional OpenCode and Devin managed-data states and optional usage fields for Gemini, OpenCode Go, Antigravity, MiniMax, Grok, Cursor, and Zcode. account-usage-state.ts and provider-usage-section.tsx render these usage meters. Providers without data stay hidden. (2) managed-data-account-section.tsx switches OpenCode and Devin profiles through accounts.selectData. antigravity-account-section.tsx lists and selects saved Antigravity accounts only when the host advertises accounts.antigravity-native.v1. (3) New snapshot fields are optional. The summary states that older hosts keep the previous screen. (4) The summary states that add, sign-in, key entry, and removal remain desktop-only. Tests cover OpenCode selection, Gemini and GLM usage, Grok windows, Antigravity capability gating, late-snapshot rejection, and snapshot decoding (mobile-accounts-screen-provider-accounts.test.tsx, accounts-snapshot.test.ts, account-usage-state.test.ts). The PR reports 5 files and 56 passing tests, not run on a device. Compliance is supported by the code summary and tests. Limitation: source diffs for these files were not read in this assessment.

Full details: Out of Scope Changes check

Explanation

All changed files relate to the mobile Accounts screen and its data path: the screen, account section components, snapshot schema, usage selectors, usage bar label width, provider icons (OpenCode Go, MiniMax), styles, RPC port inventory entry for the new Antigravity RPC calls, and tests. These support issue #36908. Kimi is excluded by design, which matches the issue scope. The en.json change adds labels for Antigravity, Grok, plan totals, MCP monthly usage, and "fable" under accounts.screen. The "fable" key is not tied to a described provider in the summary. It is a display label in the Accounts namespace, not a behavior change, so it is not a demonstrated unrelated change. No unrelated product behavior was found in the summary. Source diffs were unavailable for en.json in this check (changed blobs missing from checkout), so this is judged from the summary and a partial file read.

Full details: Docstring Coverage

Explanation

Docstring coverage is 28.13% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 32 functions across 17 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

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

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

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

@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: 2


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: 40b79cc6-85da-46e9-a188-86e262a5b828
Commits

Reviewing files that changed from the base of the PR and between 474e48a and 7d1718e.

Files selected for processing: 17
  • mobile/src/accounts/MobileAccountsScreen.tsx
  • mobile/src/accounts/antigravity-account-section.tsx
  • mobile/src/accounts/antigravity-account-state.ts
  • mobile/src/accounts/claude-codex-account-section.tsx
  • mobile/src/accounts/managed-data-account-section.tsx
  • mobile/src/accounts/mobile-accounts-screen-grok-usage.test.tsx
  • mobile/src/accounts/mobile-accounts-screen-provider-accounts.test.tsx
  • mobile/src/accounts/mobile-accounts-screen-reset-credit.test.ts
  • mobile/src/accounts/mobile-accounts-screen-styles.ts
  • mobile/src/accounts/provider-usage-section.tsx
  • mobile/src/components/AccountUsage.tsx
  • mobile/src/components/AgentIcons.tsx
  • mobile/src/components/account-usage-state.test.ts
  • mobile/src/components/account-usage-state.ts
  • mobile/src/components/accounts-snapshot.test.ts
  • mobile/src/components/accounts-snapshot.ts
  • mobile/src/transport/unvalidated-rpc-request-port-inventory.ts

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

@gsxdsm
gsxdsm force-pushed the feat/mobile-desktop-accounts branch from 7d1718e to 39ab3da Compare November 1, 2026 06:00
@nwparker

nwparker commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

@gsxdsm mind attaching some iamges? Will be easier to review!

@gsxdsm

gsxdsm commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I will follow up with images.

@gsxdsm
gsxdsm force-pushed the feat/mobile-desktop-accounts branch 4 times, most recently from 9cbe973 to e21b538 Compare November 2, 2026 03:41

@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.

Caution

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

⚠️ Outside diff range comments (1)

Minor · Ignore Antigravity selection results from an inactive… · antigravity-account-section.tsx:108-131

mobile/src/accounts/antigravity-account-section.tsx:108-131
Minor · Functional Correctness · Quick win

Ignore Antigravity selection results from an inactive client.

The host-change reset clears the section, but selectAccount has no client or host identity check. A late response from host A can restore A’s accounts after the section switches to host B. Those rows remain selectable and use host B’s current client. Track the active client or host and ignore the response before updating accounts or calling onChanged().

Suggested fix
-import { useEffect, useState } from 'react'
+import { useEffect, useRef, useState } from 'react'
...
   const [supported, setSupported] = useState(false)
   const [accounts, setAccounts] = useState<AntigravityAccountState | null>(null)
   const [selectingId, setSelectingId] = useState<string | null>(null)
+  const activeClientRef = useRef<RpcClient | null>(client)
+  activeClientRef.current = client
...
         const response = await client.sendRequest('accounts.antigravitySelect', {
           target: HOST_TARGET,
           accountId
         })
+        if (activeClientRef.current !== client) {
+          return
+        }
         if (!response.ok) {
           onNotice({ title, message: response.error.message })
           return

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: 1923c8dd-61ff-47a9-a424-fd9654e7b0b5
Commits

Reviewing files that changed from the base of the PR and between 9cbe973 and e21b538.

Files selected for processing: 2
  • mobile/src/accounts/mobile-accounts-screen-grok-usage.test.tsx
  • mobile/src/accounts/mobile-accounts-screen-provider-accounts.test.tsx

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

@gsxdsm
gsxdsm force-pushed the feat/mobile-desktop-accounts branch 2 times, most recently from 6d82437 to 3666d66 Compare November 3, 2026 02:07
@gsxdsm

gsxdsm commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Visual proof

Real iOS Simulator screenshots (iPhone 17 Pro Max). Personal info is covered with black boxes.

Desktop account providers with usage on the phone

Claude and Codex stay switchable. OpenCode and Devin profiles can be selected when the host lists them. Gemini, Antigravity, OpenCode Go, MiniMax, Grok, Cursor, and GLM Coding Plan show the usage desktop already reports. Hosts that omit those fields keep the previous screen.
ConfirmModal imports bottom-drawer/BottomDrawer. The old mock path no longer intercepts it, so these suites loaded reanimated.
@AmoabaKelvin

Copy link
Copy Markdown
Collaborator

Thanks for working on this! #38187 just merged and shows usage on mobile for every provider the desktop tracks, so I'm closing this in favour of it. Your work here helped shape that change.

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.

Show desktop account providers and usage on mobile

3 participants