[fenix] For https://github.com/mozilla-mobile/fenix/issues/26308 - Add feature flag for MR onboarding

pull/600/head
sarah541 2 years ago committed by mergify[bot]
parent 1868d8c41d
commit dcfcb4dcf5

@ -58,6 +58,14 @@ nimbus-validation:
settings-title: settings-title:
type: string type: string
description: The title of displayed in the Settings screen and app menu. description: The title of displayed in the Settings screen and app menu.
onboarding:
description: The onboarding features displayed on homescreen.
hasExposure: true
exposureDescription: ""
variables:
sections-enabled:
type: json
description: This property provides a lookup table of whether or not the given section should be enabled.
pocket-sponsored-stories: pocket-sponsored-stories:
description: A feature showing sponsored stories in between the other Pocket recommended stories on homescreen. description: A feature showing sponsored stories in between the other Pocket recommended stories on homescreen.
hasExposure: true hasExposure: true

@ -23,6 +23,11 @@ object FeatureFlags {
*/ */
const val syncAddressesFeature = false const val syncAddressesFeature = false
/**
* Enables the on-boarding sync cfr on the home screen.
*/
val showSynCFR = Config.channel.isDebug
/** /**
* Enables the "recent" tabs feature in the home screen. * Enables the "recent" tabs feature in the home screen.
*/ */

@ -44,6 +44,7 @@ import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.getPreferenceKey import org.mozilla.fenix.ext.getPreferenceKey
import org.mozilla.fenix.nimbus.FxNimbus import org.mozilla.fenix.nimbus.FxNimbus
import org.mozilla.fenix.nimbus.HomeScreenSection import org.mozilla.fenix.nimbus.HomeScreenSection
import org.mozilla.fenix.nimbus.OnboardingSection
import org.mozilla.fenix.settings.PhoneFeature import org.mozilla.fenix.settings.PhoneFeature
import org.mozilla.fenix.settings.deletebrowsingdata.DeleteBrowsingDataOnQuitType import org.mozilla.fenix.settings.deletebrowsingdata.DeleteBrowsingDataOnQuitType
import org.mozilla.fenix.settings.logins.SavedLoginsSortingStrategyMenu import org.mozilla.fenix.settings.logins.SavedLoginsSortingStrategyMenu
@ -1200,6 +1201,9 @@ class Settings(private val appContext: Context) : PreferencesHolder {
default = false default = false
) )
private val onboardScreenSection: Map<OnboardingSection, Boolean> get() =
FxNimbus.features.onboarding.value().sectionsEnabled
private val homescreenSections: Map<HomeScreenSection, Boolean> get() = try { private val homescreenSections: Map<HomeScreenSection, Boolean> get() = try {
FxNimbus.features.homescreen.value().sectionsEnabled FxNimbus.features.homescreen.value().sectionsEnabled
} catch (e: NimbusFeatureException) { } catch (e: NimbusFeatureException) {
@ -1212,6 +1216,16 @@ class Settings(private val appContext: Context) : PreferencesHolder {
featureFlag = FeatureFlags.historyMetadataUIFeature || isHistoryMetadataEnabled featureFlag = FeatureFlags.historyMetadataUIFeature || isHistoryMetadataEnabled
) )
/**
* Indicates if sync on-boarding CFR should be shown
* Returns true if the [FeatureFlags.showSynCFR] and [R.string.pref_key_should_show_sync_cfr] are true.
*/
var showSyncCFR by lazyFeatureFlagPreference(
appContext.getPreferenceKey(R.string.pref_key_should_show_sync_cfr),
featureFlag = FeatureFlags.showSynCFR,
default = { onboardScreenSection[OnboardingSection.SYNC_CFR] == true },
)
/** /**
* Indicates if the recent tabs functionality should be visible. * Indicates if the recent tabs functionality should be visible.
* Returns true if the [FeatureFlags.showRecentTabsFeature] and [R.string.pref_key_recent_tabs] are true. * Returns true if the [FeatureFlags.showRecentTabsFeature] and [R.string.pref_key_recent_tabs] are true.

@ -236,6 +236,8 @@
<string name="pref_key_has_inactive_tabs_auto_close_dialog_dismissed" translatable="false">pref_key_has_inactive_tabs_auto_close_dialog_dismissed</string> <string name="pref_key_has_inactive_tabs_auto_close_dialog_dismissed" translatable="false">pref_key_has_inactive_tabs_auto_close_dialog_dismissed</string>
<!-- A value of `true` means the jump back in onboarding popup has not been shown yet --> <!-- A value of `true` means the jump back in onboarding popup has not been shown yet -->
<string name="pref_key_should_show_jump_back_in_tabs_popup" translatable="false">pref_key_should_show_jump_back_in_tabs_popup</string> <string name="pref_key_should_show_jump_back_in_tabs_popup" translatable="false">pref_key_should_show_jump_back_in_tabs_popup</string>
<!-- A value of `true` means the on-boarding sync CFR have not been shown yet -->
<string name="pref_key_should_show_sync_cfr" translatable="false">pref_key_should_show_sync_cfr</string>
<string name="pref_key_debug_settings" translatable="false">pref_key_debug_settings</string> <string name="pref_key_debug_settings" translatable="false">pref_key_debug_settings</string>

@ -33,6 +33,23 @@ features:
"contile-top-sites": false, "contile-top-sites": false,
} }
} }
onboarding:
description: The homescreen that the user goes to when they press home or new tab.
variables:
sections-enabled:
description: "This property provides a lookup table of whether or not the given section should be enabled."
type: Map<OnboardingSection, Boolean>
default:
{
"sync-cfr": false
}
defaults:
- channel: nightly
value: {
"sections-enabled": {
"sync-cfr": false
}
}
nimbus-validation: nimbus-validation:
description: "A feature that does not correspond to an application feature suitable for showing description: "A feature that does not correspond to an application feature suitable for showing
that Nimbus is working. This should never be used in production." that Nimbus is working. This should never be used in production."
@ -305,4 +322,9 @@ types:
description: A setting in the settings screen. description: A setting in the settings screen.
homescreen-banner: homescreen-banner:
description: A banner in the homescreen. description: A banner in the homescreen.
OnboardingSection:
description: The identifiers for the sections of the onboarding.
variants:
sync-cfr:
description: Sync onboarding CFR.

Loading…
Cancel
Save