Repository navigation
feat(mobile): clarify the notification opt-in screen - #20930
Conversation
Replace the generic enable-notifications prompt with copy and a looping banner preview that show background alerts when an agent finishes or is waiting, even if the app is closed.
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes
- Notification-step copy —
MobileOnboardingPage.tsxtitle/body/disclosure rewritten to explain that alerts arrive when an agent finishes or is waiting, even when the app is closed, and that delivery follows 3 minutes of desktop idle. - New
NotificationOnboardingPreview— two decorative sample banners ("Codex finished", "Claude needs input") that loop in/out viaAnimatedon the native driver, reset and skip animation when the page is off-screen, stay static under Reduce Motion, and are hidden from assistive tech. - Styles — shared
contentpadding split intopaddingTop: lg/paddingBottom: md, with anotificationContentoverride for the notification step only. - Tests — new preview suite (off-screen skip, active looping, decorative a11y) plus extended page test asserting the new copy and preview presence.
ℹ️ Nitpicks
new Animated.Value(active && reduceMotion ? 1 : 0)(lines 25-26) can never seereduceMotion === trueon the first render —usePrefersReducedMotionstarts atuseState(false), so the condition always evaluates to0. The effect corrects it on the resolved value, so this is harmless, but the ternary reads as load-bearing. Consider initializing to0directly, or noting in the effect why the reduced-motion value is reconciled after mount.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
📝 WalkthroughWalkthroughThe notification onboarding step now renders an animated preview with “Codex finished” and “Claude needs input” banners instead of a bell icon. A shared hook manages reduced-motion preferences for the preview and carousel. The step copy, disclosure text, and layout styles were updated. Tests cover rendering, accessibility, animation behavior, and notification copy. Priority: ➖ Normal Merge Risk: 🔵 Low · up to Reduce Motion users can see an unwanted initial onboarding animation. Keep transitions static until the preference is known before merging. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the main behavior changes and includes visual proof and a test plan, but it omits most required template sections. It does not provide a Linked Issue, ELI5, Why, Review, Notes, AI Disclosure, Agent skill boundary, or completed checklist details. The testing items remain unchecked. Resolution Complete the required template sections. Add the linked issue after “Fixes #”, provide ELI5 and Why sections, document review and compatibility considerations, complete the Agent skill boundary and checklist items, and record the testing performed, including platform coverage and command results.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 5ab22dfe-e542-4c0c-9e0b-59dac01c1aa4
📒 Files selected for processing (5)
mobile/src/onboarding/MobileOnboardingPage.test.tsmobile/src/onboarding/MobileOnboardingPage.tsxmobile/src/onboarding/NotificationOnboardingPreview.test.tsmobile/src/onboarding/NotificationOnboardingPreview.tsxmobile/src/onboarding/mobile-onboarding-styles.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.
Extract the duplicated onboarding reduced-motion probe and hold the banner loop until the OS preference is known, so Reduce Motion users do not see the first cycle.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 52ed76a2-54ab-44fd-8809-11f50b63caba
📒 Files selected for processing (4)
mobile/app/mobile-onboarding.tsxmobile/src/onboarding/NotificationOnboardingPreview.test.tsmobile/src/onboarding/NotificationOnboardingPreview.tsxmobile/src/onboarding/use-reduced-motion.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- mobile/src/onboarding/NotificationOnboardingPreview.test.ts
- mobile/src/onboarding/NotificationOnboardingPreview.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
| // Why: the carousel should preserve continuity without overriding the | ||
| // device's reduced-motion preference. | ||
| duration: reducedMotionEnabled ? 0 : SLIDE_DURATION_MS, | ||
| duration: reducedMotionEnabled === true ? 0 : SLIDE_DURATION_MS, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Do not animate while the reduced-motion preference is unresolved.
useReducedMotionEnabled() returns null until AccessibilityInfo.isReduceMotionEnabled() resolves. A user can select an onboarding choice during this interval. advanceOrContinue() then starts a 280 ms transition because the current condition treats null like false. The shared preview already remains static until the preference is known. Use reducedMotionEnabled === false ? SLIDE_DURATION_MS : 0.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Shared reduced-motion hook — extracted the duplicated probe into
mobile/src/onboarding/use-reduced-motion.ts;mobile/app/mobile-onboarding.tsxandNotificationOnboardingPreview.tsxnow both import it, with the local copy in the route file deleted. - Waits for the OS preference before animating — the hook now returns
boolean | null(nulluntilisReduceMotionEnabled()resolves), and the preview loops only once the preference is known, so reduced-motion devices no longer flash a frame of animation. The carousel duration comparison is tightened to=== true. - Simplified initial values — both sample banners now initialize as
new Animated.Value(0)instead of a ternary that could never be true on first render. - New regression test —
NotificationOnboardingPreview.test.tsgains a case that resolves the preference after mount and asserts the loop does not start until then; it fails if the guard is removed.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
* feat(mobile): clarify the notification opt-in screen Replace the generic enable-notifications prompt with copy and a looping banner preview that show background alerts when an agent finishes or is waiting, even if the app is closed. * fix(mobile): share reduced-motion hook and wait before animating Extract the duplicated onboarding reduced-motion probe and hold the banner loop until the OS preference is known, so Reduce Motion users do not see the first cycle.

Summary
The opt-in gate is unchanged. People who already granted OS notifications still see this once, because the old in-app banners did not cover this path.
Test plan
pnpm test src/onboarding/inmobile/