Skip to content

[WOOMOB-2413] Hide push notifications benefit behind flag#15498

Merged
hichamboushaba merged 1 commit intotrunkfrom
issue/woomob-2413-skip-jetpack-benefits-from-settings
Mar 9, 2026
Merged

[WOOMOB-2413] Hide push notifications benefit behind flag#15498
hichamboushaba merged 1 commit intotrunkfrom
issue/woomob-2413-skip-jetpack-benefits-from-settings

Conversation

@hichamboushaba
Copy link
Copy Markdown
Member

@hichamboushaba hichamboushaba commented Mar 6, 2026

Fixes WOOMOB-2413

Description

Hides the Push Notifications benefit from the Jetpack installation dialog when the WOO_PUSH_NOTIFICATIONS_SYSTEM_M2 feature flag is enabled. This ensures users do not see the benefit if the new push notification system is active.

Note

I didn't add a unit test for the new behavior because it'll require creating a new use case wrapping the WOO_PUSH_NOTIFICATIONS_SYSTEM_M2 feature flag logic, and given there is already some pending work to make feature flags testable without the use cases (#15299), I decided it's not worth to cause more divergence.

Test Steps

  1. Sign in using a Jetpack CP site or using Site credentials.
  2. Open the app and navigate to Settings > Developer Options.
  3. Enable the WOO_PUSH_NOTIFICATIONS_SYSTEM_M2 flag.
  4. Go to Jetpack installation dialog (from Settings > Install Jetpack).
  5. Verify that the Push Notifications benefit is hidden.
  6. Disable the flag and verify the benefit reappears.

Images/gif

Before After
jetpack-benefits-after-settings jetpack-benefits-flag-enabled
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the [Internal] label for non-user-facing changes.

@hichamboushaba hichamboushaba force-pushed the issue/woomob-2413-skip-jetpack-benefits-from-settings branch from 654e118 to 20c35c5 Compare March 6, 2026 16:59
@hichamboushaba hichamboushaba requested a review from Copilot March 6, 2026 17:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hides the “Push Notifications” benefit entry in the Jetpack installation benefits dialog when the WOO_PUSH_NOTIFICATIONS_SYSTEM_M2 feature flag is enabled, so users don’t see the legacy benefit messaging while the new push system is active.

Changes:

  • Add a new ViewState boolean to control whether the Push Notifications benefit is shown.
  • Conditionally render the Push Notifications benefit entry in the Compose UI based on that state.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/jetpack/benefits/JetpackBenefitsViewModel.kt Introduces isPushNotificationsBenefitVisible into the screen state and initializes it from the feature flag.
WooCommerce/src/main/kotlin/com/woocommerce/android/ui/jetpack/benefits/JetpackBenefitsScreen.kt Wraps the Push Notifications benefit UI in a conditional check and updates previews to include the new state.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wpmobilebot
Copy link
Copy Markdown
Collaborator

wpmobilebot commented Mar 6, 2026

App Icon📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Build Number730
Version24.2
Application IDcom.woocommerce.android.prealpha
Commit9f50342
Installation URL0frf04i9umb5g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@hichamboushaba hichamboushaba force-pushed the issue/woomob-2413-skip-jetpack-benefits-from-settings branch from 20c35c5 to 9f50342 Compare March 6, 2026 17:27
@woocommerce woocommerce deleted a comment from Copilot AI Mar 6, 2026
@hichamboushaba hichamboushaba added feature: notifications Related to notifications or notifs. feature: jetpack cp Related to Jetpack Connection Package support type: task An internally driven task. labels Mar 6, 2026
@hichamboushaba hichamboushaba marked this pull request as ready for review March 6, 2026 17:28
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 39.41%. Comparing base (aa20f0e) to head (9f50342).
⚠️ Report is 533 commits behind head on trunk.

Files with missing lines Patch % Lines
...id/ui/jetpack/benefits/JetpackBenefitsViewModel.kt 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #15498      +/-   ##
============================================
- Coverage     39.42%   39.41%   -0.01%     
+ Complexity    11149    11148       -1     
============================================
  Files          2247     2247              
  Lines        128805   128807       +2     
  Branches      17993    17994       +1     
============================================
- Hits          50775    50772       -3     
- Misses        72853    72856       +3     
- Partials       5177     5179       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AdamGrzybkowski AdamGrzybkowski self-assigned this Mar 9, 2026
Base automatically changed from issue/WOOMOB-2405-pn-setup-jetpack-cp to trunk March 9, 2026 10:46
Copy link
Copy Markdown
Contributor

@AdamGrzybkowski AdamGrzybkowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as described :shipit:

@hichamboushaba hichamboushaba added this to the 24.4 milestone Mar 9, 2026
@hichamboushaba hichamboushaba enabled auto-merge March 9, 2026 11:25
@hichamboushaba hichamboushaba merged commit 1c81201 into trunk Mar 9, 2026
22 checks passed
@hichamboushaba hichamboushaba deleted the issue/woomob-2413-skip-jetpack-benefits-from-settings branch March 9, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: jetpack cp Related to Jetpack Connection Package support feature: notifications Related to notifications or notifs. type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants