You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(mobile): Connect Slack asks which workspace and explains what went wrong, as on desktop - #47684
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)
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: 4
Check name
Status
Explanation
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
What Changed
The phone's Connect Slack page (
use-phone-slack-setup.ts,MobileBotSlackSetup.tsx, newMobileSlackSetupSteps.tsx) now follows the desktop's recent Connect Slack fixes (#47302, #47336, #47505):otherSlackTeamsandslackSetupProblemDetailsmoved from the desktop's Slack folder tosrc/shared/bots/, so the desktop and the phone use one copy. The phone's agent list schema now keepsupdatedAt, 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 usesMobileStateViewwith itsdetailsprop, 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
The approval link expired: the desktop's headline, next step and Details
Slack refused a workspace this agent's app was never made in: no longer says the token expired
A lapsed token now names the computer whose token Slack stopped accepting
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 typecheckandpnpm check:changedpass (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
updatedAtstill 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
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
bots.slack.state,setUpAppandsaveGrant, which it already used.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)