Skip to content

Add unified mobile onboarding for session view and notifications - #9478

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/mobile-native-chat-mode
Jul 20, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/mobile-native-chat-mode

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

What

Combines the mobile native-chat and notification opt-ins into one controlled onboarding flow.

New users with both decisions outstanding see a two-step carousel:

  1. How should sessions open? — choose native chat or terminal.
  2. Stay updated while away — enable notifications or choose Not now.

Existing users see only the decision they have not already made, without progress dots. Completing the flow opens Home or returns to the newly paired host.

Why

Native chat already had a per-tab long-press toggle and a Settings → Native chat default-view switch (#9084), but new users had no clear place to discover the choice. Notifications had a related one-time prompt. Presenting the outstanding decisions as one short onboarding sequence makes both choices understandable without stacking separate modal screens.

How

  • A shared onboarding plan loads the independent session-view and notification gates concurrently, then returns the canonical session-first order.
  • Home and both pairing paths route through one mobile-onboarding modal while preserving the paired host destination.
  • The route carries the serialized plan, so users who already made one choice see only the missing step and reopening the same route with a different plan resets its state correctly.
  • Buttons advance the carousel; swipe-to-skip, modal gestures, and Android hardware Back remain disabled so every planned choice is explicit.
  • Preference and permission failures stay on the current step with a retryable inline error.
  • Off-screen pages are hidden from assistive technology, progress is announced as Step n of 2, and the transition honors Reduce Motion.
  • The slide uses the native animation driver and a memoized derived transform; an interrupted cosmetic transition cannot leave the next choice disabled.
  • The existing tri-state session preference remains the one-time decision signal, so anyone who already chose in Settings is not prompted again.

Tests

  • Planning coverage for all four outstanding-step combinations, canonical route parsing, and host-preserving destinations.
  • Screen coverage for the two-step flow, single-step completion, persistence retry, route-plan resets, Reduce Motion, and interrupted transitions.
  • Page coverage for choice callbacks, pending-state disabling, and hiding inactive pages from accessibility.
  • Full mobile suite: 2,072 passed, 2 skipped across 290 files.
  • tsc --noEmit, oxlint, and formatting checks pass for the PR files.

Manual QA — iPhone 17 Pro simulator

Drove the real native flow end-to-end and verified that only the active page appears in the accessibility tree.

1. Session-view choice

Session-view onboarding

2. Notifications choice

Notification onboarding

Mirror the notifications one-time opt-in for the native-chat default view.

After pairing, a full-screen modal (modeled on notification-opt-in) lets the
user choose whether supported agent sessions open in the terminal or in native
chat, then persists the choice to the existing orca:defaultSessionView key.

- Expose readDefaultSessionViewPreference() (tri-state; absent key = undecided)
  so the gate can prompt exactly once; loadDefaultSessionView() is unchanged.
- shouldPresentSessionViewOptIn() gates the screen; the home focus effect shows
  it after the notification opt-in.
- Settings -> Native chat toggle (already shipped) remains the recovery path.
@coderabbitai

coderabbitai Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a unified mobile onboarding flow for session-view and notification preferences. Structured preference reads distinguish missing, invalid, and unreadable storage. A step planner evaluates eligible prompts and builds routes. New onboarding pages and a carousel persist choices, handle permissions, support reduced motion, and block back navigation. Startup, notification completion, and pairing flows now route through the onboarding destination. Tests cover planning, rendering, persistence failures, accessibility, animation, and navigation.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.77% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description covers summary, testing, and QA, but it omits required AI Review Report, Security Audit, and Notes sections. Add the missing template sections: AI Review Report, Security Audit, and Notes, and rename/align headings to match the required template.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title is concise and accurately summarizes the main change: unified mobile onboarding for session view and notifications.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

Comment @coderabbitai help to get the list of available commands.

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

⚠️ Outside diff range comments (1)
mobile/app/notification-opt-in.tsx (1)

53-61: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Await continueToApp() to handle potential promise rejections.

Since continueToApp was refactored into an asynchronous function, it must be awaited here. If it throws (for example, if a storage error bubbles up while evaluating shouldPresentSessionViewOptIn()), calling it without await will result in an unhandled promise rejection. The catch block will not execute, leaving choiceInFlightRef.current stuck as true and the UI permanently locked with a disabled spinner state.

🐛 Proposed fix to await the async routing function
       try {
         const enabled = choice === 'enable' ? await ensureNotificationPermissions() : false
         await savePushNotificationsEnabled(enabled)
-        continueToApp()
+        await continueToApp()
       } catch {
         setError('Notification settings could not be updated. Try again.')
         setBusyChoice(null)
         choiceInFlightRef.current = false
       }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7b9b0cb5-220d-4b23-bab1-5cca052a2e02

📥 Commits

Reviewing files that changed from the base of the PR and between b133130 and 225b8d2.

📒 Files selected for processing (11)
  • mobile/app/index.tsx
  • mobile/app/notification-opt-in.tsx
  • mobile/app/pair-confirm.tsx
  • mobile/app/pair-scan.tsx
  • mobile/app/session-view-opt-in.tsx
  • mobile/src/onboarding/mobile-onboarding-prompt.test.ts
  • mobile/src/onboarding/mobile-onboarding-prompt.ts
  • mobile/src/session/session-view-opt-in-gate.test.ts
  • mobile/src/session/session-view-opt-in-gate.ts
  • mobile/src/storage/preferences.test.ts
  • mobile/src/storage/session-view-preferences.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • mobile/src/session/session-view-opt-in-gate.ts
  • mobile/src/session/session-view-opt-in-gate.test.ts
  • mobile/src/storage/preferences.test.ts
  • mobile/app/session-view-opt-in.tsx
  • mobile/src/storage/session-view-preferences.ts
  • mobile/app/index.tsx

@brennanb2025 brennanb2025 changed the title Add a mobile native-chat opt-in so users pick terminal vs chat once Add unified mobile onboarding for session view and notifications Jul 20, 2026

@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

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 15a71b0b-f738-4557-a0d8-5359fd523789

📥 Commits

Reviewing files that changed from the base of the PR and between b94215b and 6f33f7f.

📒 Files selected for processing (12)
  • mobile/app/_layout.tsx
  • mobile/app/index.tsx
  • mobile/app/mobile-onboarding.tsx
  • mobile/app/notification-opt-in.tsx
  • mobile/app/pair-confirm.tsx
  • mobile/app/pair-scan.tsx
  • mobile/src/onboarding/MobileOnboardingPage.test.ts
  • mobile/src/onboarding/MobileOnboardingPage.tsx
  • mobile/src/onboarding/mobile-onboarding-plan.test.ts
  • mobile/src/onboarding/mobile-onboarding-plan.ts
  • mobile/src/onboarding/mobile-onboarding-screen.test.ts
  • mobile/src/onboarding/mobile-onboarding-styles.ts
💤 Files with no reviewable changes (1)
  • mobile/app/notification-opt-in.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • mobile/app/pair-scan.tsx
  • mobile/app/pair-confirm.tsx

Comment thread mobile/app/_layout.tsx Resolved
@brennanb2025
brennanb2025 merged commit ccd72f5 into main Jul 20, 2026
2 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…blyai#9478)

* Add a mobile native-chat opt-in so users pick terminal vs chat once

Mirror the notifications one-time opt-in for the native-chat default view.

After pairing, a full-screen modal (modeled on notification-opt-in) lets the
user choose whether supported agent sessions open in the terminal or in native
chat, then persists the choice to the existing orca:defaultSessionView key.

- Expose readDefaultSessionViewPreference() (tri-state; absent key = undecided)
  so the gate can prompt exactly once; loadDefaultSessionView() is unchanged.
- shouldPresentSessionViewOptIn() gates the screen; the home focus effect shows
  it after the notification opt-in.
- Settings -> Native chat toggle (already shipped) remains the recovery path.

* fix(mobile): preserve onboarding flow after pairing

* refine mobile session view opt-in copy

* Unify mobile onboarding prompts
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