commit a3565941a5eee04c452674570e64ab55274ab869
parent b7751b7668f93a3f66fe84632779182f48e3308a
Author: Gabriel Luong <gabriel.luong@gmail.com>
Date: Fri, 21 Nov 2025 20:32:05 +0000
Bug 1996435 - Part 2: Enable the new Private Browsing Mode redesign r=android-reviewers,devota
- Removes the feature flag and secret settings for the PBM redesign
- Removes the unused PBM composables
Differential Revision: https://phabricator.services.mozilla.com/D270080
Diffstat:
10 files changed, 25 insertions(+), 145 deletions(-)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt
@@ -54,11 +54,6 @@ object FeatureFlags {
const val DISCOVER_MORE_STORIES = true
/**
- * Enables the private browsing mode redesign on the homepage.
- */
- const val PRIVATE_BROWSING_MODE_REDESIGN = false
-
- /**
* Enables the Mozilla Ads Client.
*/
const val MOZILLA_ADS_CLIENT_ENABLED = false
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/store/HomepageState.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/store/HomepageState.kt
@@ -57,13 +57,11 @@ internal sealed class HomepageState {
* @property headerState State related to the header of the homepage.
* @property firstFrameDrawn Flag indicating whether the first frame of the homescreen has been drawn.
* @property isSearchInProgress Whether search is currently active on the homepage.
- * @property privateModeRedesignEnabled Whether private browsing mode redesign is enabled.
*/
internal data class Private(
override val headerState: HeaderState,
override val firstFrameDrawn: Boolean = false,
override val isSearchInProgress: Boolean,
- val privateModeRedesignEnabled: Boolean,
) : HomepageState()
/**
@@ -160,19 +158,17 @@ internal sealed class HomepageState {
browsingModeManager: BrowsingModeManager,
settings: Settings,
): HomepageState {
- return with(appState) {
- if (browsingModeManager.mode.isPrivate) {
- buildPrivateState(
- appState = appState,
- settings = settings,
- )
- } else {
- buildNormalState(
- appState = appState,
- browsingModeManager = browsingModeManager,
- settings = settings,
- )
- }
+ return if (browsingModeManager.mode.isPrivate) {
+ buildPrivateState(
+ appState = appState,
+ settings = settings,
+ )
+ } else {
+ buildNormalState(
+ appState = appState,
+ browsingModeManager = browsingModeManager,
+ settings = settings,
+ )
}
}
@@ -199,7 +195,6 @@ internal sealed class HomepageState {
),
firstFrameDrawn = firstFrameDrawn,
isSearchInProgress = searchState.isSearchActive,
- privateModeRedesignEnabled = settings.enablePrivateBrowsingModeRedesign,
)
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/ui/Homepage.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/ui/Homepage.kt
@@ -132,17 +132,9 @@ internal fun Homepage(
with(state) {
when (this) {
is HomepageState.Private -> {
- if (privateModeRedesignEnabled) {
- PrivateBrowsingDescription2(
- onLearnMoreClick = interactor::onLearnMoreClicked,
- )
- } else {
- Box(modifier = Modifier.padding(horizontal = horizontalMargin)) {
- PrivateBrowsingDescription(
- onLearnMoreClick = interactor::onLearnMoreClicked,
- )
- }
- }
+ PrivateBrowsingDescription(
+ onLearnMoreClick = interactor::onLearnMoreClicked,
+ )
}
is HomepageState.Normal -> {
@@ -630,7 +622,6 @@ private fun PrivateHomepagePreview() {
),
firstFrameDrawn = true,
isSearchInProgress = false,
- privateModeRedesignEnabled = false,
),
interactor = FakeHomepagePreview.homepageInteractor,
onTopSitesItemBound = {},
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/ui/PrivateBrowsingDescription.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/ui/PrivateBrowsingDescription.kt
@@ -8,23 +8,16 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
-import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.layout.wrapContentHeight
-import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
-import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
-import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
-import androidx.compose.ui.draw.clip
-import androidx.compose.ui.draw.shadow
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
@@ -44,80 +37,22 @@ import org.mozilla.fenix.theme.Theme
import mozilla.components.ui.icons.R as iconsR
/**
- * Total Private Browsing Mode homepage informational card.
+ * Private Browsing Mode description.
*
- * @param onLearnMoreClick Invoked when the user clicks on the who can see my activity link.
+ * @param onLearnMoreClick Invoked when the user clicks on the learn more link.
*/
@Composable
fun PrivateBrowsingDescription(
onLearnMoreClick: () -> Unit,
) {
- Box(
- modifier = Modifier
- .shadow(elevation = 5.dp, shape = RoundedCornerShape(8.dp), clip = true)
- .clip(shape = RoundedCornerShape(8.dp))
- .fillMaxWidth()
- .wrapContentHeight()
- .background(FirefoxTheme.colors.layer2),
- ) {
+ Surface {
Column(
- modifier = Modifier.padding(16.dp),
+ modifier = Modifier
+ .fillMaxWidth()
+ .padding(horizontal = 24.dp),
+ verticalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterVertically),
+ horizontalAlignment = Alignment.CenterHorizontally,
) {
- Text(
- text = stringResource(id = R.string.felt_privacy_desc_card_title),
- style = FirefoxTheme.typography.headline7,
- color = FirefoxTheme.colors.textPrimary,
- )
-
- Spacer(modifier = Modifier.height(8.dp))
-
- Box(
- modifier = Modifier.semantics {
- testTagsAsResourceId = true
- testTag = HOMEPAGE_PRIVATE_BROWSING_LEARN_MORE_LINK
- },
- ) {
- LinkText(
- text = stringResource(
- id = R.string.felt_privacy_info_card_subtitle_2,
- stringResource(id = R.string.app_name),
- stringResource(id = R.string.felt_privacy_info_card_subtitle_link_text),
- ),
- linkTextStates = listOf(
- LinkTextState(
- text = stringResource(id = R.string.felt_privacy_info_card_subtitle_link_text),
- url = "",
- onClick = { onLearnMoreClick() },
- ),
- ),
- style = FirefoxTheme.typography.body2.copy(
- color = FirefoxTheme.colors.textPrimary,
- ),
- linkTextColor = FirefoxTheme.colors.textPrimary,
- linkTextDecoration = TextDecoration.Underline,
- )
- }
- }
- }
-}
-
-/**
- * Private Browsing Mode description.
- *
- * @param onLearnMoreClick Invoked when the user clicks on the learn more link.
- */
-@Composable
-fun PrivateBrowsingDescription2(
- onLearnMoreClick: () -> Unit,
-) {
- Column(
- modifier = Modifier
- .fillMaxWidth()
- .padding(horizontal = 24.dp),
- verticalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterVertically),
- horizontalAlignment = Alignment.CenterHorizontally,
- ) {
- CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onSurface) {
Icon(
painter = painterResource(id = iconsR.drawable.mozac_ic_private_mode_72),
contentDescription = null,
@@ -169,25 +104,11 @@ fun PrivateBrowsingDescription2(
private fun PrivacyBrowsingDescriptionPreview() {
FirefoxTheme(theme = Theme.Private) {
Column(
- modifier = Modifier.padding(horizontal = horizontalMargin),
- ) {
- PrivateBrowsingDescription(
- onLearnMoreClick = {},
- )
- }
- }
-}
-
-@Composable
-@Preview
-private fun PrivacyBrowsingDescription2Preview() {
- FirefoxTheme(theme = Theme.Private) {
- Column(
modifier = Modifier
.background(MaterialTheme.colorScheme.surface)
.fillMaxSize(),
) {
- PrivateBrowsingDescription2(
+ PrivateBrowsingDescription(
onLearnMoreClick = {},
)
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SecretSettingsFragment.kt
@@ -186,12 +186,6 @@ class SecretSettingsFragment : PreferenceFragmentCompat() {
onPreferenceChangeListener = SharedPreferenceUpdater()
}
- requirePreference<SwitchPreference>(R.string.pref_key_enable_private_browsing_mode_redesign).apply {
- isVisible = Config.channel.isNightlyOrDebug
- isChecked = context.settings().enablePrivateBrowsingModeRedesign
- onPreferenceChangeListener = SharedPreferenceUpdater()
- }
-
requirePreference<SwitchPreference>(R.string.pref_key_enable_unified_trust_panel).apply {
isChecked = context.settings().enableUnifiedTrustPanel
onPreferenceChangeListener = SharedPreferenceUpdater()
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -2308,14 +2308,6 @@ class Settings(
)
/**
- * Indicates if the private browsing mode redesign is enabled.
- */
- var enablePrivateBrowsingModeRedesign by booleanPreference(
- key = appContext.getPreferenceKey(R.string.pref_key_enable_private_browsing_mode_redesign),
- default = FeatureFlags.PRIVATE_BROWSING_MODE_REDESIGN,
- )
-
- /**
* Indicates if the Mozilla Ads Client is enabled.
*/
var enableMozillaAdsClient by booleanPreference(
diff --git a/mobile/android/fenix/app/src/main/res/values/preference_keys.xml b/mobile/android/fenix/app/src/main/res/values/preference_keys.xml
@@ -438,7 +438,6 @@
<string name="pref_key_enable_menu_redesign" translatable="false">pref_key_enable_menu_redesign</string>
<string name="pref_key_enable_homepage_as_new_tab" translatable="false">pref_key_enable_homepage_as_new_tab</string>
<string name="pref_key_enable_discover_more_stories" translatable="false">pref_key_enable_discover_more_stories</string>
- <string name="pref_key_enable_private_browsing_mode_redesign" translatable="false">pref_key_enable_private_browsing_mode_redesign</string>
<string name="pref_key_enable_mozilla_ads_client" translatable="false">pref_key_enable_mozilla_ads_client</string>
<string name="pref_key_enable_unified_trust_panel" translatable="false">pref_key_enable_unified_trust_panel</string>
<string name="pref_key_enable_composable_toolbar" translatable="false">pref_key_enable_composable_toolbar</string>"
diff --git a/mobile/android/fenix/app/src/main/res/values/static_strings.xml b/mobile/android/fenix/app/src/main/res/values/static_strings.xml
@@ -77,8 +77,6 @@
<string name="preferences_debug_settings_mozilla_ads_client" translatable="false">Enable Mozilla Ads Client</string>
<!-- Label for enabling Discover more stories -->
<string name="preferences_debug_settings_discover_more_stories" translatable="false">Enable Discover More Stories</string>
- <!-- Label for enabling Private Browsing Mode redesign -->
- <string name="preferences_debug_settings_private_browsing_mode_redesign" translatable="false">Enable Private Browsing Mode redesign</string>
<!-- Label for enabling the menu redesign -->
<string name="preferences_debug_settings_menu_redesign" translatable="false">Enable Menu Redesign</string>
<!-- Label for enabling Firefox Suggest -->
diff --git a/mobile/android/fenix/app/src/main/res/values/strings.xml b/mobile/android/fenix/app/src/main/res/values/strings.xml
@@ -80,7 +80,7 @@
private mode in our new Total Private Browsing mode.
%1$s is the name of the app (for example "Firefox").
%2$s is a link using felt_privacy_info_card_subtitle_link_text as text -->
- <string name="felt_privacy_info_card_subtitle_2">%1$s deletes your cookies, history, and site data when you close all your private tabs. %2$s</string>
+ <string name="felt_privacy_info_card_subtitle_2" tools:ignore="UnusedResources" moz:removedIn="147">%1$s deletes your cookies, history, and site data when you close all your private tabs. %2$s</string>
<!-- Description of private browsing mode displayed to users on the homepage when they enable private mode.
%1$s is the name of the app (for example "Firefox"). -->
<string name="felt_privacy_info_card_subtitle_3">%1$s deletes your cookies, history, and site data when you close all your private tabs.</string>
diff --git a/mobile/android/fenix/app/src/main/res/xml/secret_settings_preferences.xml b/mobile/android/fenix/app/src/main/res/xml/secret_settings_preferences.xml
@@ -47,11 +47,6 @@
app:iconSpaceReserved="false" />
<SwitchPreference
android:defaultValue="false"
- android:key="@string/pref_key_enable_private_browsing_mode_redesign"
- android:title="@string/preferences_debug_settings_private_browsing_mode_redesign"
- app:iconSpaceReserved="false" />
- <SwitchPreference
- android:defaultValue="false"
android:key="@string/pref_key_enable_menu_redesign"
android:title="@string/preferences_debug_settings_menu_redesign"
app:iconSpaceReserved="false" />