[Push Notifications] Remove WPCom login flow from push notifications setup#15408
Conversation
3d0b59e to
e586d33
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes the WordPress.com login flow from the push notifications setup process. Push notifications only require Jetpack site connection (site registration), not a WordPress.com account connection. The changes simplify the flow by allowing users to go directly from the introduction screen to the connection steps, skipping the WPCom login entirely.
Changes:
- Modified the introduction screen to navigate directly to connection steps instead of routing through WPCom login
- Updated connection steps to use site registration only (not account connection), and skip registration when the site is already connected to Jetpack
- Made WPCom login PushNotificationsSetup mode a no-op (with cleanup planned for a separate PR)
- Extracted
registerSite()as a public method inJetpackActivationRepositoryfor reuse - Updated strings to remove "account" references, emphasizing site connection rather than account connection
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/pushnotifications/introduction/WooPushNotificationsIntroductionViewModel.kt | Replaced StartWPComLogin event with NavigateToConnectionSteps, passing site connection status |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/pushnotifications/introduction/WooPushNotificationsIntroductionDialog.kt | Updated navigation handling to go directly to connection steps |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/pushnotifications/connection/WooPushNotificationsConnectionStepsViewModel.kt | Simplified connection flow to use registerSite() instead of connectJetpackAccount(), skip registration when already connected |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/wpcom/WPComLoginPostLoginViewModel.kt | Made PushNotificationsSetup a no-op with TODO for cleanup |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/wpcom/WPComLoginPasswordFragment.kt | Removed push notifications connection steps navigation handler |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/wpcom/WPComLoginMagicLinkHandlerFragment.kt | Removed push notifications connection steps navigation handler |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/wpcom/WPComLogin2FAFragment.kt | Removed push notifications connection steps navigation handler |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/login/jetpack/JetpackActivationRepository.kt | Extracted registerSite() as public method, refactored connectJetpackAccount() to reuse it |
| WooCommerce/src/main/res/navigation/nav_graph_push_notifications.xml | Removed WPCom login navigation graph inclusion and actions, added isSiteConnectedToJetpack argument |
| WooCommerce/src/main/res/values/strings.xml | Updated push notification strings to remove "account" references |
| fastlane/resources/values/strings.xml | Updated push notification description to remove "account" reference |
| WooCommerce/src/test/kotlin/com/woocommerce/android/ui/pushnotifications/introduction/WooPushNotificationsIntroductionViewModelTest.kt | Updated tests to reflect NavigateToConnectionSteps with site connection status |
| WooCommerce/src/test/kotlin/com/woocommerce/android/ui/pushnotifications/connection/WooPushNotificationsConnectionStepsViewModelTest.kt | Updated tests to use registerSite() instead of connectJetpackAccount() |
| WooCommerce/src/test/kotlin/com/woocommerce/android/ui/login/wpcom/WPComLoginPostLoginViewModelTest.kt | Removed test for push notifications post-login navigation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assertThat(viewState).isEqualTo(ViewState.GenericError) | ||
| val event = viewModel.event.value | ||
| assertThat(event).isEqualTo( | ||
| WooPushNotificationsIntroductionViewModel.NavigateToConnectionSteps(isSiteConnectedToJetpack = false) |
There was a problem hiding this comment.
The test expects isSiteConnectedToJetpack = false, but the test setup uses JetpackConnectionStatus.AccountConnected which means isSiteConnected will be true (based on the logic in JetpackStatus.kt). The expected value should be isSiteConnectedToJetpack = true to match the test setup.
| WooPushNotificationsIntroductionViewModel.NavigateToConnectionSteps(isSiteConnectedToJetpack = false) | |
| WooPushNotificationsIntroductionViewModel.NavigateToConnectionSteps(isSiteConnectedToJetpack = true) |
| if (wcVersion.isVersionAtLeast(PUSH_NOTIFICATIONS_MIN_WC_VERSION)) { | ||
| _viewState.value = ViewState.GenericError |
There was a problem hiding this comment.
The test expects that when the site is connected and WC version is compatible, the NavigateToConnectionSteps event should be automatically triggered when the screen opens. However, the current implementation only sets the view state to GenericError and does not trigger the navigation event. The checkWCVersion() method should trigger the NavigateToConnectionSteps event when the version is at least the minimum required version, instead of setting the state to GenericError.
...merce/android/ui/pushnotifications/introduction/WooPushNotificationsIntroductionViewModel.kt
Show resolved
Hide resolved
|
|
e586d33 to
6c3b3c5
Compare
Generated by 🚫 Danger |
| if (navArgs.isSiteConnectedToJetpack) { | ||
| markCurrentStepAsCompleted() | ||
| advanceToNextStep() | ||
| return | ||
| } |
There was a problem hiding this comment.
For now, if the site is connected, we'll skip the task.
We can discuss with iOS team whether removing the task completely is better and update accordingly.

Closes: WOOMOB-2287
Note
I will handle code cleanup (removing the login changes) in a separate PR.
Description
Woo Push Notifications only requires a Jetpack site connection (site registration), not a WordPress.com account connection. The current flow unnecessarily routes users through a WPCom login before connecting the store, adding friction and complexity.
This PR removes the login flow and simplifies the connection step to only register the site.
Changes
Introduction screen:
StartWPComLoginevent withNavigateToConnectionSteps— tapping "Continue" now goes directly to the connection steps, skipping WPCom login entirelyisSiteConnectedToJetpackto the connection steps so they can skip registration when the site is already connectedConnection steps:
connectJetpackAccount()(site registration + account connection) withregisterSite()(site registration only)ConnectStoreStageflow andconnectStoreStageStateFlowNavigation:
ShowPushNotificationsConnectionStepsevent and handlers from WPCom login fragments (2FA, magic link, password)PushNotificationsSetuplogin mode a no-op inWPComLoginPostLoginViewModelRepository:
registerSite()as a new public method inJetpackActivationRepository, reused by the existingconnectJetpackAccount()Strings:
Testing instructions
Site not connected to Jetpack
Site connected to Jetpack
PUSH_NOTIFICATIONS_MIN_WC_VERSIONImages/gif
Screen_recording_20260220_175613.mp4
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.