Skip to content

feat(mobile): Connect Slack asks which workspace and explains what went wrong, as on desktop - #47684

Merged
AmoabaKelvin merged 4 commits into
mainfrom
mobile-slack-setup-problems
Nov 23, 2026
Merged

AmoabaKelvin merged 4 commits into
mainfrom
mobile-slack-setup-problems

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

When connecting Slack from the phone went wrong, the phone said less than the computer does, and with several Slack workspaces on the computer it quietly picked one for you. Now the phone asks which workspace, says plainly what went wrong and what to do next, and has the same Details lines you can read out to support.

Files Added Deleted Net
Test 0 0 0 0
Prod 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​299 $\color{#cf222e}{\Huge{\mathbf{−}}}$​103 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​196

What Changed

The phone's Connect Slack page (use-phone-slack-setup.ts, MobileBotSlackSetup.tsx, new MobileSlackSetupSteps.tsx) now follows the desktop's recent Connect Slack fixes (#47302, #47336, #47505):

  • Which workspace. If the computer's other agents are in more than one Slack workspace, or this agent is already in Slack and you add another, you get Choose a Slack workspace. with each workspace by name, plus Connect another workspace. Before, the phone always used the most recent one. Names come from one Slack read per agent in that workspace, read again when the phone comes back online.
  • No token saved vs expired. When Slack refuses a workspace that this agent's app was never made in, the page says "Orca has no working Slack token for this workspace. Paste a token to continue." and the button reads Continue. It no longer claims a token expired. A token that really lapsed names the computer: "Each computer keeps its own Slack token. Slack stopped accepting the one (host) uses. Paste a new token to reconnect."
  • Failed approval. An expired link or another Slack user's approval shows the desktop's headline and next step ("Slack sign-in didn't finish." / "A different Slack account approved the connection."), Get a new link, and the Details lines (code, computer, agent, workspace) through the phone's existing Details toggle.
  • otherSlackTeams and slackSetupProblemDetails moved from the desktop's Slack folder to src/shared/bots/, so the desktop and the phone use one copy. The phone's agent list schema now keeps updatedAt, so the workspace order matches.

Left out on purpose: "Use (computer)'s sign-in" (hand-off). It redeems a code under the desktop's own Orca account, and the phone has no account of its own to redeem it with. The reconnecting/offline problems are already covered by the phone's offline banner.

Patterns followed: the pick list copies the Linear setup's workspace picker (MobileBotLinearSetup.tsx:276-298). The failure step uses MobileStateView with its details prop, like the other phone error states.

Why

The desktop's failure states only lived in the desktop dialog, so on the phone a second workspace was set up in whichever one was newest, and a missing token was reported as an expired one. Sharing the desktop's workspace and Details helpers keeps the two from drifting apart again.

Linked Issue

None. This is phone parity with the desktop's #47302, #47336 and #47505.

Visual Proof

Real phone components in the mobile web page at 402 pt wide, with a stand-in host. Each pair is the same host answers before and after.

Two workspaces are known on the computer: before, the phone took the latest and went on (here the cloud then refused); after, you pick, or connect another

Before After
dark
light

The approval link expired: the desktop's headline, next step and Details

Before After
dark
light

Slack refused a workspace this agent's app was never made in: no longer says the token expired

Before After
dark
light

A lapsed token now names the computer whose token Slack stopped accepting

Before After
dark
light

Testing

  • Rendered each state in the real mobile web page bundle (Chromium, 402×874, light and dark) against a stand-in host: the picker with two named workspaces, an expired approval link with Details open, a refused workspace this agent was never in, and a lapsed token.

  • pnpm --dir mobile typecheck and pnpm check:changed pass (desktop Slack setup tests included).

  • 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 moved helpers keep their desktop coverage, and the phone states are shown above.

Performance

None, because the only new reads are one Slack state read per agent the picker takes a workspace name from, and one more read after Slack refuses a token. Both run only on those steps.

Risk

Level: Low

The riskiest part is the picker. An agent added to a second workspace now stops to ask instead of reusing the newest one. Older hosts that don't send updatedAt still list the workspaces, just unordered, and a workspace whose name can't be read shows its id. The desktop change is only an import move. 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. The phone only calls bots.slack.state, setUpApp and saveGrant, which it already used.

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 →

Walkthrough

Slack setup now receives all known workspaces from other bots on the host. Mobile setup can ask users to choose a workspace, connect another workspace, or provide a token. Token recovery distinguishes uncertain token availability from a rejected token. Mobile screens display workspace names when available and show problem details for expired links and approvals by another account. Shared workspace-selection and problem-detail helpers are used by the renderer and mobile code.

Merge Risk: Low · up to e0117

Chinese-language users will see English text on the new Slack workspace picker, recovery and problem screens. Some of this was previously translated. The rest of the change looks sound, so adding the Chinese strings before or soon after merge is enough.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the phone's Connect Slack flow now asks which workspace to use and explains failures, matching the desktop behavior. The changeset covers the workspace picker, the pro…
Description check Passed The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk with a level, Review, and Checklist sections. It explain…
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: the phone's Connect Slack flow now asks which workspace to use and explains failures, matching the desktop behavior. The changeset covers the workspace picker, the problem/expired-link states, and the shared helper moves, so the title fits the change. It is long at 92 characters, and it does not mention the shared-helper refactor, which is acceptable because the title need not cover every detail.

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 with a level, Review, and Checklist sections. It explains the before and after behavior, the mechanism, the alternatives left out, and the rollback path. The Linked Issue section says None and cites desktop PRs as parity references, which the template does not accept for outside contributors. The AI Disclosure section is empty. The Testing section checks the manual-test box but lists no test added, which the author explains. The Performance section is filled in.

  • 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

@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: d37c1d7c-271a-45b8-bb38-854dccb2b242
Commits

Reviewing files that changed from the base of the PR and between a105d99 and e0117ca.

Files selected for processing: 13

  • mobile/src/bots/connectors/MobileBotConnectors.tsx
  • mobile/src/bots/connectors/MobileBotSlackSetup.tsx
  • mobile/src/bots/connectors/MobileSlackSetupSteps.tsx
  • mobile/src/bots/connectors/use-phone-bot-slack.ts
  • mobile/src/bots/connectors/use-phone-slack-setup.ts
  • mobile/src/bots/host-bots-operations.ts
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/zh.json
  • src/renderer/src/components/bots/slack/SlackSetupProblem.tsx
  • src/renderer/src/components/bots/slack/slack-setup-teams.ts
  • src/renderer/src/components/bots/slack/use-bot-slack-setup.ts
  • src/shared/bots/bot-slack-setup-teams.ts
  • src/shared/bots/slack-setup-problem-details.ts
Files with no reviewable changes: 1

  • 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; 4 remain after this review.

Comment on lines +110 to +111
? t('bots.slack.problem.otherUser', 'A different Slack account approved the connection.')
: t('bots.slack.problem.expired', 'Slack sign-in didn’t finish.')

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 values for the new bots.slack.* keys in zh.json.

mobile/src/i18n/locales/zh.json has no entries for the new bots.slack.problem.* keys. It also lacks the bots.slack.setup.* and bots.slack.reconnect.* keys this PR adds. A Chinese user therefore sees English text on the Slack recovery screens. Add Chinese values for every new key, including bots.slack.problem.otherUser, bots.slack.problem.otherUserNext, bots.slack.problem.expired, and bots.slack.problem.expiredNext.

@AmoabaKelvin
AmoabaKelvin merged commit 50e0185 into main Nov 23, 2026
99 of 101 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