woocommerce-ios icon indicating copy to clipboard operation
woocommerce-ios copied to clipboard

Introduce BetaFeature and automatic UI for beta features configuration

Open koke opened this issue 3 years ago • 2 comments
trafficstars

Closes: #7013

Description

Following on the changes from #7012, this introduces a new BetaFeature where we can easily encapsulate all the details of any new experimental flag. It then replaces BetaFeaturesViewController with a new SwiftUI-based BetaFeaturesConfigurationViewController, which generates all its content automatically by iterating through all the defined beta features.

Note that the UI has changed slightly while porting this to SwiftUI, as having the descriptions on the footer felt more natural (and simpler) than adding a second row, and this is more of a proposal than a fully polished PR, but we can discuss and tweak that part.

I considered replacing the existing code that reads beta feature and deleting the relevant actions, but that would probably double the size the PR (at least), so maybe for a future one.

Testing instructions

  1. Go to Settings > Experimental features
  2. Toggle the features and check that their values persist
  3. Verify that toggling add-ons sends an analytics event

Screenshots

Before After
Screen Shot 2022-05-31 at 17 22 22 Screen Shot 2022-05-31 at 17 34 57

  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

koke avatar May 31 '22 15:05 koke

You can test the changes from this Pull Request by:

  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr7014-ae0fb46 on your iPhone
If you need access to App Center, please ask a maintainer to add you.

wpmobilebot avatar May 31 '22 15:05 wpmobilebot

Warnings
:warning: This PR is assigned to a milestone which is closing in less than 2 days Please, make sure to get it merged by then or assign it to a later expiring milestone
:warning: PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by :no_entry_sign: dangerJS

peril-woocommerce[bot] avatar Sep 05 '22 08:09 peril-woocommerce[bot]