From 9968708352cfe6586710d7cfbc4c97d6a727804a Mon Sep 17 00:00:00 2001 From: Noah Bond Date: Wed, 3 Aug 2022 17:26:26 -0700 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/26289 - Remove search term tab groups metrics and setting --- app/metrics.yaml | 92 ------------------- .../ui/robots/SettingsSubMenuTabsRobot.kt | 8 -- .../java/org/mozilla/fenix/FeatureFlags.kt | 5 - .../org/mozilla/fenix/FenixApplication.kt | 1 - .../fenix/settings/TabsSettingsFragment.kt | 6 -- .../java/org/mozilla/fenix/utils/Settings.kt | 9 -- app/src/main/res/values/preference_keys.xml | 1 - app/src/main/res/values/strings.xml | 4 +- app/src/main/res/xml/tabs_preferences.xml | 7 -- .../org/mozilla/fenix/FenixApplicationTest.kt | 2 - .../fenix/tabstray/browser/TabSorterTest.kt | 2 - 11 files changed, 2 insertions(+), 135 deletions(-) diff --git a/app/metrics.yaml b/app/metrics.yaml index ced736aa7..6c2e9afbd 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -2123,19 +2123,6 @@ preferences: notification_emails: - android-probes@mozilla.com expires: 107 - search_term_groups_enabled: - type: boolean - description: | - Is search term group in tabs tray on? - bugs: - - https://github.com/mozilla-mobile/fenix/issues/22057 - data_reviews: - - https://github.com/mozilla-mobile/fenix/pull/22058 - data_sensitivity: - - interaction - notification_emails: - - android-probes@mozilla.com - expires: 107 search.default_engine: code: @@ -7747,85 +7734,6 @@ addresses: tags: - Autofill -search_terms: - number_of_search_term_group: - type: event - description: | - Number of search term group when tabs tray is opened. - extra_keys: - count: - type: string - description: | - The number of tabs per search group - bugs: - - https://github.com/mozilla-mobile/fenix/issues/22057 - data_reviews: - - https://github.com/mozilla-mobile/fenix/pull/22058 - data_sensitivity: - - interaction - notification_emails: - - android-probes@mozilla.com - expires: 107 - average_tabs_per_group: - type: event - description: | - Number of search term tabs per group when tabs tray is opened. - extra_keys: - count: - type: string - description: | - The average number of tabs per search group - bugs: - - https://github.com/mozilla-mobile/fenix/issues/22057 - data_reviews: - - https://github.com/mozilla-mobile/fenix/pull/22058 - data_sensitivity: - - interaction - notification_emails: - - android-probes@mozilla.com - expires: 107 - jump_back_in_group_tapped: - type: event - description: | - User tapped on the jump back in search term group. - bugs: - - https://github.com/mozilla-mobile/fenix/issues/22057 - data_reviews: - - https://github.com/mozilla-mobile/fenix/pull/22058 - data_sensitivity: - - interaction - notification_emails: - - android-probes@mozilla.com - expires: 107 - group_size_distribution: - type: custom_distribution - description: | - The distribution of search term tab group sizes. Rather than reporting - individual sizes directly as integers, it is currently desired to - report the sizes according to certain size ranges. - The "buckets" for reporting group sizes will be mapped as follows: - * 2 tabs -> 1 - * 3-5 tabs -> 2 - * 6-10 tabs -> 3 - * 11+ tabs -> 4 - Where the reported number will be 1, 2, 3, or 4, accordingly. - As an example, say a user has three groups of sizes 3, 6, and 15. The - app will report 2, 3, and 4 when this metric is tracked. - range_min: 1 - range_max: 4 - bucket_count: 5 - histogram_type: linear - unit: tab_group_size_code - bugs: - - https://github.com/mozilla-mobile/fenix/issues/22410 - data_reviews: - - https://github.com/mozilla-mobile/fenix/pull/22479 - data_sensitivity: - - interaction - notification_emails: - - android-probes@mozilla.com - expires: 108 - messaging: message_shown: type: event diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuTabsRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuTabsRobot.kt index 765c997e5..95fee80a8 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuTabsRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuTabsRobot.kt @@ -46,10 +46,6 @@ private fun assertTabViewOptions() { .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))) gridToggle() .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))) - searchTermTabGroupsToggle() - .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))) - searchGroupsDescription() - .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))) } private fun assertCloseTabsOptions() { @@ -78,10 +74,6 @@ private fun listToggle() = onView(withText("List")) private fun gridToggle() = onView(withText("Grid")) -private fun searchTermTabGroupsToggle() = onView(withText("Search groups")) - -private fun searchGroupsDescription() = onView(withText("Group related sites together")) - private fun closeTabsHeading() = onView(withText("Close tabs")) private fun manuallyToggle() = onView(withText("Manually")) diff --git a/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt b/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt index 2cc74ea26..fec76af57 100644 --- a/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt +++ b/app/src/main/java/org/mozilla/fenix/FeatureFlags.kt @@ -43,11 +43,6 @@ object FeatureFlags { */ const val inactiveTabs = true - /** - * Identifies and separates the tabs list with a group containing search term tabs. - */ - val tabGroupFeature = Config.channel.isNightlyOrDebug - /** * Allows tabs to be dragged around as long as tab groups are disabled */ diff --git a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt index a1bc2d77e..3a6c31d27 100644 --- a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +++ b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt @@ -728,7 +728,6 @@ open class FenixApplication : LocaleAwareApplication(), Provider { voiceSearchEnabled.set(settings.shouldShowVoiceSearch) openLinksInAppEnabled.set(settings.openLinksInExternalApp) signedInSync.set(settings.signedInFxaAccount) - searchTermGroupsEnabled.set(settings.searchTermTabGroupsAreEnabled) val syncedItems = SyncEnginesStorage(applicationContext).getStatus().entries.filter { it.value diff --git a/app/src/main/java/org/mozilla/fenix/settings/TabsSettingsFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/TabsSettingsFragment.kt index 4db9c5309..bd63ea593 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/TabsSettingsFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/TabsSettingsFragment.kt @@ -30,7 +30,6 @@ class TabsSettingsFragment : PreferenceFragmentCompat() { private lateinit var radioOneMonth: RadioButtonPreference private lateinit var inactiveTabsCategory: PreferenceCategory private lateinit var inactiveTabs: SwitchPreference - private lateinit var searchTermTabGroups: SwitchPreference override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { setPreferencesFromResource(R.xml.tabs_preferences, rootKey) @@ -56,11 +55,6 @@ class TabsSettingsFragment : PreferenceFragmentCompat() { // pref_key_tab_view_grid and look into using the native RadioGroup in the future. listRadioButton = requirePreference(R.string.pref_key_tab_view_list_do_not_use) gridRadioButton = requirePreference(R.string.pref_key_tab_view_grid) - searchTermTabGroups = requirePreference(R.string.pref_key_search_term_tab_groups).also { - it.isVisible = FeatureFlags.tabGroupFeature - it.isChecked = it.context.settings().searchTermTabGroupsAreEnabled - it.onPreferenceChangeListener = SharedPreferenceUpdater() - } radioManual = requirePreference(R.string.pref_key_close_tabs_manually) radioOneMonth = requirePreference(R.string.pref_key_close_tabs_after_one_month) diff --git a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt index caae13a2f..156ce0c35 100644 --- a/app/src/main/java/org/mozilla/fenix/utils/Settings.kt +++ b/app/src/main/java/org/mozilla/fenix/utils/Settings.kt @@ -426,15 +426,6 @@ class Settings(private val appContext: Context) : PreferencesHolder { default = true, ) - /** - * Indicates if the user has enabled the search term tab groups feature. - */ - var searchTermTabGroupsAreEnabled by lazyFeatureFlagPreference( - appContext.getPreferenceKey(R.string.pref_key_search_term_tab_groups), - default = { FxNimbus.features.searchTermGroups.value().enabled }, - featureFlag = FeatureFlags.tabGroupFeature - ) - @VisibleForTesting internal fun timeNowInMillis(): Long = System.currentTimeMillis() diff --git a/app/src/main/res/values/preference_keys.xml b/app/src/main/res/values/preference_keys.xml index 7f197c22e..599b989de 100644 --- a/app/src/main/res/values/preference_keys.xml +++ b/app/src/main/res/values/preference_keys.xml @@ -275,7 +275,6 @@ pref_key_camera_permissions_needed pref_key_inactive_tabs_category pref_key_inactive_tabs - pref_key_search_term_tab_groups pref_key_return_to_browser diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 529658ab9..a4bdc4190 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -601,9 +601,9 @@ Grid - Search groups + Search groups - Group related sites together + Group related sites together Close tabs diff --git a/app/src/main/res/xml/tabs_preferences.xml b/app/src/main/res/xml/tabs_preferences.xml index 51823b823..42fa1b901 100644 --- a/app/src/main/res/xml/tabs_preferences.xml +++ b/app/src/main/res/xml/tabs_preferences.xml @@ -18,13 +18,6 @@ android:defaultValue="true" android:key="@string/pref_key_tab_view_grid" android:title="@string/tab_view_grid" /> - - (), Preferences.syncItems.testGetValue()) assertEquals("fixed_top", Preferences.toolbarPositionSetting.testGetValue()) assertEquals("standard", Preferences.enhancedTrackingProtection.testGetValue()) diff --git a/app/src/test/java/org/mozilla/fenix/tabstray/browser/TabSorterTest.kt b/app/src/test/java/org/mozilla/fenix/tabstray/browser/TabSorterTest.kt index 62024832b..7d28174ef 100644 --- a/app/src/test/java/org/mozilla/fenix/tabstray/browser/TabSorterTest.kt +++ b/app/src/test/java/org/mozilla/fenix/tabstray/browser/TabSorterTest.kt @@ -22,7 +22,6 @@ class TabSorterTest { @Before fun setUp() { every { settings.inactiveTabsAreEnabled }.answers { true } - every { settings.searchTermTabGroupsAreEnabled }.answers { true } } @Test @@ -90,7 +89,6 @@ class TabSorterTest { @Test fun `WHEN inactive tabs are disabled THEN adapter have only normal tabs`() { every { settings.inactiveTabsAreEnabled }.answers { false } - every { settings.searchTermTabGroupsAreEnabled }.answers { false } val tabSorter = TabSorter(settings, tabsTrayStore) tabSorter.updateTabs(