Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

For #21360 - Added toggle for search term tab groups #21615

Merged
merged 17 commits into from Oct 2, 2021

Conversation

MozillaNoah
Copy link
Contributor

@MozillaNoah MozillaNoah commented Sep 30, 2021

#21360

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

@MozillaNoah MozillaNoah requested review from a team as code owners September 30, 2021 22:50
@MozillaNoah MozillaNoah linked an issue Sep 30, 2021 that may be closed by this pull request
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, thanks for adding this.

Copy link
Member

Choose a reason for hiding this comment

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

Please also include the license

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch. I don't think my original icon have it either. Since we need this change in, @MozillaNoah can you please create another PR to add license on both ic_all_tabs? Thanks

Copy link
Contributor

@rocketsroger rocketsroger left a comment

Choose a reason for hiding this comment

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

🚢 Thanks!

@MozillaNoah MozillaNoah added the Feature:SearchTermTabs Tabs in the tabs tray that have the same search term. label Sep 30, 2021
@MozillaNoah MozillaNoah added the pr:needs-landing-squashed PRs that are ready to land (squashed) [Will be merged by Mergify] label Sep 30, 2021
@csadilek csadilek closed this Oct 1, 2021
@csadilek csadilek reopened this Oct 1, 2021
@csadilek csadilek closed this Oct 1, 2021
@csadilek csadilek reopened this Oct 1, 2021
@rocketsroger rocketsroger reopened this Oct 1, 2021
@pocmo pocmo closed this Oct 1, 2021
@pocmo pocmo reopened this Oct 1, 2021
@jonalmeida
Copy link
Contributor

The UI test failures say:

org.mozilla.fenix.ui.SmokeTest.alwaysStartOnHomeTest
 androidx.test.espresso.PerformException: Error performing 'single click' on view 'with text: is "Always"'. 

There is no video since the test ends too soon, so my suspicion is that since we've added new items to this screen, we now need to scroll down in the test. Something like this patch:

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 405af4bcf..4c8ec5359 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
@@ -16,6 +16,7 @@ import androidx.test.espresso.matcher.ViewMatchers.withText
 import androidx.test.platform.app.InstrumentationRegistry
 import androidx.test.uiautomator.UiDevice
 import org.hamcrest.CoreMatchers.allOf
+import org.mozilla.fenix.helpers.TestHelper.scrollToElementByText
 import org.mozilla.fenix.helpers.click

 /**
@@ -67,6 +68,8 @@ private fun assertCloseTabsOptions() {
 }

 private fun assertStartOnHomeOptions() {
+    // Scroll to ensure all the items are visible.
+    scrollToElementByText("Never")
     startOnHomeHeading()
         .check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
     afterFourHoursToggle()

@MozillaNoah
Copy link
Contributor Author

@jonalmeida giving this a try, thank you!

@eliserichards
Copy link
Contributor

If you can't easily figure this test failure out you can add an @ignore and land this, reach out to @rpappalax in slack and his team can help 👍

@@ -58,6 +59,10 @@ 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<SwitchPreference>(R.string.pref_key_search_term_tab_groups).also {
Copy link
Contributor

@csadilek csadilek Oct 1, 2021

Choose a reason for hiding this comment

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

@MozillaNoah We have to make sure we only show this preference when the feature flag is turned on. Did you verify this? I think this needs a it.visible = FeatureFlags.tabGroupFeature?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this. I did it for the inactive tabs toggle but not here. Will update shortly.

@csadilek csadilek removed the pr:needs-landing-squashed PRs that are ready to land (squashed) [Will be merged by Mergify] label Oct 1, 2021
@MozillaNoah MozillaNoah added the pr:needs-landing-squashed PRs that are ready to land (squashed) [Will be merged by Mergify] label Oct 1, 2021
@mergify mergify bot merged commit aa28b6f into mozilla-mobile:main Oct 2, 2021
pkirakosyan pushed a commit to gexsi/user-agent-android that referenced this pull request Mar 7, 2022
…ozilla-mobile#21615)

* For mozilla-mobile#21360  - Added toggle for search term tab groups

* For mozilla-mobile#21360 - Lint cleanup

* PR: Added missing licenses and possibly fixed UI test

* PR: Added a "scrollTo" to potentially fix a UI test

* PR: Added potential fix for alwaysStartOnHomeTest

* PR: Added temporary ignore to alwaysStartOnHomeTest

* PR: added missing ignore comment

* For mozilla-mobile#21360 - Added missing feature flag driven visibility logic

Co-authored-by: Sebastian Kaspari <s.kaspari@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature:SearchTermTabs Tabs in the tabs tray that have the same search term. pr:needs-landing-squashed PRs that are ready to land (squashed) [Will be merged by Mergify]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add setting for disabling (auto) tab grouping
7 participants