Skip to content

fix(mobile): return to Home when Back leaves a bot opened from Home - #48091

Merged
nwparker merged 1 commit into
stablyai:mainfrom
danielhopkins:fix/mobile-bot-back-to-home
Nov 24, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
danielhopkins:fix/mobile-bot-back-to-home

Conversation

@danielhopkins

@danielhopkins danielhopkins commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

On the phone, if you opened a bot from the Home screen and tapped Back, the app showed that one computer's workspace list instead of Home. You had to tap Back twice. Now one Back takes you straight to Home, the same as agents opened from Home already do.

What Changed

Before: Tap a bot on Home (Feed or Bots tab, or Home's New bot sheet), then tap Back. The app shows the paired computer's host list.

After: Tap Back. The app returns to Home.

Mechanism: useOpenBotHome opens the bot's Home Chat through useOpenMobileSession, which opens a session on top of its host's list unless the route carries the standalone param. Home's agent rows already pass standalone: true for this reason. This PR adds a { standalone } option to useOpenBotHome and forwards it to the session route (mobileSessionRouteTarget already drops a false value). Only the two Home callers opt in:

  1. Bot rows on Home's Feed and Bots tabs (MobileHomeScreen.tsx).
  2. Home's New bot sheet (HomeNewBotSheet.tsx).

The host screen's New bot sheet, bot deep links (BotLinkRouter) and group item openers pass nothing, so a bot opened from a host screen still has the host list beneath it. The comment on STANDALONE_SESSION_PARAM now mentions bot rows too.

Why

Home lists bots from every paired computer, so Back should return to that list, not to one computer's list. Reusing the existing standalone param makes bot rows behave like Home's agent rows, and it already works through both the host-document open path (isStandaloneSessionHref -> the session replaces the list) and the native fallback (navigateToHostStackRoute REPLACEs the index instead of PUSHing). The alternative, a bot-specific rule in host stack navigation, would also change bots opened from a host screen.

Linked Issue

No linked issue.

Visual Proof

N/A. This is a React Native navigation change on the phone app, and no device or simulator capture was made. The behavior was verified through a navigation-level test instead (see Testing).

Testing

  • Reproduced with a scratch vitest that renders the real HomeNewBotSheet and feeds the real useOpenBotHome -> useOpenMobileSession target into the real navigateToHostStackRoute, with the host stack mounted and its list focused. On main the target has no standalone param and the action is PUSH (list stays under the bot). On this branch it emits standalone=1 and the action is REPLACE. Callers that pass no option add no param.

  • vitest run src/navigation src/bots src/home in mobile/: 10 files, 27 tests pass.

  • pnpm -C mobile typecheck passes. oxlint, oxfmt --check, the anti-slop and code-quality oxlint configs, ast-grep, and the changed-code quality gate are clean on the 4 changed files.

  • Not run on a device or 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 was added on purpose. The change only forwards an existing route param from the two Home callers. The standalone mobile route suite was removed in 1355cc4 (#45865), so no committed test covers standalone today, and a test here would only assert a mocked hook's arguments.

Performance

None, because this only runs when the user taps to open a bot from Home. It adds one route param with no I/O, polling or subprocess work, and the standalone path does equal or less navigation work (REPLACE instead of PUSH; one spliced route instead of two).

Risk

The risky part is Back from a bot opened from Home. If wrong, Back from that bot would land somewhere unexpected. Bots opened from a host screen are unchanged. No saved data, wire protocol or desktop change; older paired desktops keep the old behavior. A plain revert backs it out.

Trade-off: Back from a Home-opened bot no longer passes through the computer's workspace list. To reach that list, open the computer from Home (wide layouts still show it in the sidebar).

Level: Low

Review

Original fix by @danielhopkins in #48091. Squashed onto current main with a small simplification of the hook option; authorship preserved.

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

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

useOpenBotHome accepts an optional standalone setting and passes it to openMobileSession. MobileHomeScreen and OpenHomeNewBotSheet now enable this setting.

Merge Risk: Minimal · up to 307d6

Opening a bot from Home now uses the existing standalone-session mechanism, so Back should no longer show the host list. No concrete defect was found. The change was not tested on a device or simulator, so the Back behavior is not confirmed on one.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Back from a bot opened from Home now returns to Home. It uses the fix(mobile) prefix and matches the changeset, which adds a standalone option to useOpenBotHome and op…
Description check Passed The description follows the template and covers ELI5, what changed (before and after), mechanism, why, testing, performance, risk, and AI disclosure. It explains the scope limit to Home callers. Gaps:…
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: Back from a bot opened from Home now returns to Home. It uses the fix(mobile) prefix and matches the changeset, which adds a standalone option to useOpenBotHome and opts Home's bot rows and New bot sheet in.

Full details: Description check

Explanation

The description follows the template and covers ELI5, what changed (before and after), mechanism, why, testing, performance, risk, and AI disclosure. It explains the scope limit to Home callers. Gaps: the Linked Issue section says 'No issue yet' and the template requires a linked issue for outside contributors. The Visual Proof section is 'Not captured' rather than a before/after or an N/A with reason. The unchecked items for manual testing and before/after visuals are not resolved. The Testing section also lists typecheck and vitest but not pnpm lint, test, or build.

Resolution

Consider adding: a linked issue (or an explicit maintainer note that none is needed), a before/after video or screenshot for this UI behavior change (or an N/A reason), and confirmation of the manual test steps or the unchecked boxes.

  • 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: ccb48f6b-8f34-4f3b-8b1c-6139dcffc072
Commits

Reviewing files that changed from the base of the PR and between fc708ff and 307d6ee.

Files selected for processing: 2

  • mobile/src/bots/use-open-bot-home.ts
  • mobile/src/navigation/host-stack-navigation.ts

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

Bots opened from mobile Home (Feed/Bots rows and Home's New bot sheet)
were pushed over the paired computer's host list, so Back showed that
list instead of Home. useOpenBotHome now takes a `standalone` option and
forwards it to the session route, the same mechanism Home's agent rows
already use. Only the two Home callers opt in; host-screen openers keep
the host list beneath the bot.

Co-authored-by: Neil <[email protected]>
@nwparker
nwparker force-pushed the fix/mobile-bot-back-to-home branch from fc708ff to 307d6ee Compare November 24, 2026 06:58
@nwparker
nwparker merged commit 1c46ba5 into stablyai:main Nov 24, 2026
28 checks passed
@danielhopkins
danielhopkins deleted the fix/mobile-bot-back-to-home branch November 24, 2026 13:20
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.

2 participants