Skip to content

Commit e31c380

Browse files
Implement Tab Switcher Trackers Animation Tile (#6705)
Task/Issue URL: https://app.asana.com/1/137249556945/project/1207908166761516/task/1211090750035704 ### Description Adds the Tab Switcher trackers animation tile that was tested in the recent Sense of Protection experiment. There have been a few design and copy tweaks since but retains the same behaviour and a new additional toggle to switch on/off in Appearance sub-settings screen. ### Steps to test this PR [Designs](https://www.figma.com/design/SngBHcIJci2HusCWGJuz0a/O-10--Tab-Switcher?node-id=1430-12417&m=dev) **Start with a fresh install.** ## Tab Switcher Animated Tile Showing - [x] Open the TabSwitcher - [x] The animated tile should be visible with a count of 0 - [x] Open a website in the new tab (bbc.com for example) - [x] Add another tab and open another website (cnn.com for example) - [x] Open the TabSwitcher - [x] The Animation Tile should be visible and should have a number of trackers greater than 0 ## Tab Switcher Animated Tile Stays Visible Once Seen - [x] Delete one of the tabs - [x] The animated tile should still be visible - [x] Leave the Tab Switcher - [x] Re-enter - [x] The animated tile should still be visible ## Tab Switcher Animated Tile Dismissal - [x] Tap the animated tile - [x] A dialog should appear with copy asking you if you'd like to hide the tile - [x] Check copy against designs - [x] Click the "Keep" button - [x] The dialog should dismiss and the animated tile should still be visible - [x] Tap the animated tile again - [x] Click the "Hide" button - [x] The dialog should close and the animated tile should not be visible - [x] Leave the Tab Switcher - [x] Open the Tab Switcher - [x] The animated tile should still not be visible ## Tab Switcher Appearance settings toggle - [x] Open the Appearance settings screen - [x] A new toggle should be visible at the bottom "Show Tracker count in Tab Switcher" - [x] Check copy against designs - [x] The toggle should be off (based on last test case) - [x] Switch the toggle on - [x] Navigate to the Tab Switcher - [x] The animated tile should now be visible - [x] Navigate back to the Appearance settings screen - [x] The "Show Tracker count in Tab Switcher" switch should be on - [x] Switch it off - [x] Navigate to the Tab Switcher - [x] The animated tile should now be hidden - [x] Navigate back to the Appearance settings screen - [x] Switch the "Show Tracker count in Tab Switcher" on - [x] Navigate to the Tab Switcher - [x] The animated tile should now be visible ## Tab Switcher Animated Tile Clear Data Button (Fire button) - [x] Ensure the animated tile has a tracker count > 0. Open a website if not e.g. cnn.com - [x] Press the fire button - [x] Clear data - [x] When the app restarts re-open the Tab Switcher screen - [x] The animated tile should be visible and the tracker count should be 0 ## Tab Switcher Animated Tile Automatic Clearing Data - [x] Ensure the animated tile has a tracker count > 0. Open a website if not e.g. cnn.com - [x] Open Settings - [x] Open Data Clearing - [x] Click "Automatically Clear Data" -> "Tabs and data" - [x] Select "App exit only" - [x] Leave Settings - [x] Exit the app - [x] Swipe the app away from recents - [x] Open the app - [x] Open the Tab Switcher - [x] The animated tile should be visible with a count of 0 ## Tab Switcher Animated Tile Close All Tabs - [x] Go to Developer Settings -> Tabs and Saved sites and add tabs - [x] Open the TabSwitcher - [x] Scroll to the top - [x] The animated tile should be visible - [x] Press the overflow menu button - [x] Click "Close All Tabs" - [x] Click "Close" in the dialog - [x] Open the TabSwitcher - [x] The animated tile should still be visible ## Drag and drop - [x] Long press the new tab - [x] The animated tile should be faded - [x] Try to drag and drop the new tab before the animated tile - [x] It should not be possible ## Impression pixel - [x] Open the TabSwitcher screen - [x] Check `m_tab_manager_info_panel_impressions` is fired from logs - [x] Add enough tabs so that you can no longer see the animated tile when opening the tab switcher screen (use dev settings) - [x] Select the last tab - [x] Close Tab Switcher screen - [x] Open Tab Switcher screen - [x] Scroll to the top to see the animated tile - [x] Check `m_tab_manager_info_panel_impressions` is fired from logs ## Tapped pixel - [x] Tap the animated tile - [x] Check `m_tab_manager_info_panel_tapped` is fired from logs ## Dismissed pixel - [x] Note the tracker count in the animated tile - [x] Tap the animated tile - [x] Tap "Hide" button - [x] Check `m_tab_manager_info_panel_dismissed` with trackerCount as a parameter. Match your tracker count to the bucketing system in `TrackersAnimationInfoPanelPixelsImpl` and make sure it matches ### UI changes See [Ship Review](https://app.asana.com/1/137249556945/project/1207908166761516/task/1211199510603009?focus=true) --------- Co-authored-by: Dax The Translator <[email protected]>
1 parent 2aff58d commit e31c380

File tree

72 files changed

+4539
-1552
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+4539
-1552
lines changed

.maestro/tabs/open_multiple_tabs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ tags:
1717
- inputText: "https://privacy-test-pages.site"
1818
- pressKey: Enter
1919
- runFlow: ../shared/browser_screen/click_on_tabs_button.yaml
20+
- assertVisible:
21+
text: "0 trackers blocked in the last 7 days"
2022
- assertVisible:
2123
text: "Privacy Test Pages - Home"
2224
- tapOn: "New Tab"

app/src/androidTest/java/com/duckduckgo/app/browser/BrowserTabViewModelTest.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ import com.duckduckgo.app.browser.omnibar.model.OmnibarPosition.TOP
119119
import com.duckduckgo.app.browser.refreshpixels.RefreshPixelSender
120120
import com.duckduckgo.app.browser.remotemessage.RemoteMessagingModel
121121
import com.duckduckgo.app.browser.santize.NonHttpAppLinkChecker
122-
import com.duckduckgo.app.browser.senseofprotection.SenseOfProtectionExperiment
123122
import com.duckduckgo.app.browser.session.WebViewSessionStorage
124123
import com.duckduckgo.app.browser.tabs.TabManager
125124
import com.duckduckgo.app.browser.trafficquality.AndroidFeaturesHeaderPlugin.Companion.X_DUCKDUCKGO_ANDROID_HEADER
@@ -551,7 +550,6 @@ class BrowserTabViewModelTest {
551550
private val mockDuckChatJSHelper: DuckChatJSHelper = mock()
552551
private val swipingTabsFeature = FakeFeatureToggleFactory.create(SwipingTabsFeature::class.java)
553552
private val swipingTabsFeatureProvider = SwipingTabsFeatureProvider(swipingTabsFeature)
554-
private val mockSenseOfProtectionExperiment: SenseOfProtectionExperiment = mock()
555553
private val mockDuckChat: DuckChat = mock()
556554

557555
private val defaultBrowserPromptsExperimentShowPopupMenuItemFlow = MutableStateFlow(false)
@@ -674,7 +672,6 @@ class BrowserTabViewModelTest {
674672
subscriptions = subscriptions,
675673
duckPlayer = mockDuckPlayer,
676674
brokenSitePrompt = mockBrokenSitePrompt,
677-
senseOfProtectionExperiment = mockSenseOfProtectionExperiment,
678675
onboardingHomeScreenWidgetExperiment = mockOnboardingHomeScreenWidgetExperiment,
679676
onboardingDesignExperimentManager = mockOnboardingDesignExperimentManager,
680677
rebrandingFeatureToggle = mockRebrandingFeatureToggle,
@@ -794,7 +791,6 @@ class BrowserTabViewModelTest {
794791
siteErrorHandlerKillSwitch = mockSiteErrorHandlerKillSwitch,
795792
siteErrorHandler = mockSiteErrorHandler,
796793
siteHttpErrorHandler = mockSiteHttpErrorHandler,
797-
senseOfProtectionExperiment = mockSenseOfProtectionExperiment,
798794
subscriptionsJSHelper = mockSubscriptionsJSHelper,
799795
onboardingDesignExperimentManager = mockOnboardingDesignExperimentManager,
800796
tabManager = tabManager,

app/src/androidTest/java/com/duckduckgo/app/cta/ui/CtaViewModelTest.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import androidx.test.platform.app.InstrumentationRegistry
2626
import com.duckduckgo.app.browser.DuckDuckGoUrlDetectorImpl
2727
import com.duckduckgo.app.browser.R
2828
import com.duckduckgo.app.browser.defaultbrowsing.prompts.ui.experiment.OnboardingHomeScreenWidgetExperiment
29-
import com.duckduckgo.app.browser.senseofprotection.SenseOfProtectionExperiment
3029
import com.duckduckgo.app.cta.db.DismissedCtaDao
3130
import com.duckduckgo.app.cta.model.CtaId
3231
import com.duckduckgo.app.cta.model.DismissedCta
@@ -122,7 +121,6 @@ class CtaViewModelTest {
122121

123122
private val mockBrokenSitePrompt: BrokenSitePrompt = mock()
124123

125-
private val mockSenseOfProtectionExperiment: SenseOfProtectionExperiment = mock()
126124
private val mockOnboardingHomeScreenWidgetExperiment: OnboardingHomeScreenWidgetExperiment = mock()
127125

128126
private val mockOnboardingDesignExperimentManager: OnboardingDesignExperimentManager = mock()
@@ -185,7 +183,6 @@ class CtaViewModelTest {
185183
subscriptions = mockSubscriptions,
186184
duckPlayer = mockDuckPlayer,
187185
brokenSitePrompt = mockBrokenSitePrompt,
188-
senseOfProtectionExperiment = mockSenseOfProtectionExperiment,
189186
onboardingHomeScreenWidgetExperiment = mockOnboardingHomeScreenWidgetExperiment,
190187
onboardingDesignExperimentManager = mockOnboardingDesignExperimentManager,
191188
rebrandingFeatureToggle = mockRebrandingFeatureToggle,

app/src/internal/java/com/duckduckgo/app/dev/settings/DevSettingsActivity.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ class DevSettingsActivity : DuckDuckGoActivity() {
105105
binding.customTabs.setOnClickListener { viewModel.customTabsClicked() }
106106
binding.notifications.setOnClickListener { viewModel.notificationsClicked() }
107107
binding.tabs.setOnClickListener { viewModel.tabsClicked() }
108-
binding.showTabSwitcherAnimatedTile.setOnClickListener { viewModel.showAnimatedTileClicked() }
109108
}
110109

111110
private fun observeViewModel() {

app/src/internal/java/com/duckduckgo/app/dev/settings/DevSettingsViewModel.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import com.duckduckgo.anvil.annotations.ContributesViewModel
2222
import com.duckduckgo.app.dev.settings.db.DevSettingsDataStore
2323
import com.duckduckgo.app.dev.settings.db.UAOverride
2424
import com.duckduckgo.app.survey.api.SurveyEndpointDataStore
25-
import com.duckduckgo.app.tabs.store.TabSwitcherPrefsDataStore
26-
import com.duckduckgo.common.utils.DispatcherProvider
2725
import com.duckduckgo.di.scopes.ActivityScope
2826
import com.duckduckgo.traces.api.StartupTraces
2927
import com.duckduckgo.user.agent.api.UserAgentProvider
@@ -43,9 +41,7 @@ class DevSettingsViewModel @Inject constructor(
4341
private val devSettingsDataStore: DevSettingsDataStore,
4442
private val startupTraces: StartupTraces,
4543
private val userAgentProvider: UserAgentProvider,
46-
private val dispatcherProvider: DispatcherProvider,
4744
private val surveyEndpointDataStore: SurveyEndpointDataStore,
48-
private val tabSwitcherPrefsDataStore: TabSwitcherPrefsDataStore,
4945
) : ViewModel() {
5046

5147
data class ViewState(
@@ -141,11 +137,4 @@ class DevSettingsViewModel @Inject constructor(
141137
fun tabsClicked() {
142138
viewModelScope.launch { command.send(Command.Tabs) }
143139
}
144-
145-
fun showAnimatedTileClicked() {
146-
viewModelScope.launch {
147-
tabSwitcherPrefsDataStore.setIsAnimationTileDismissed(isDismissed = false)
148-
command.send(Command.Toast("Animated tile dismissal has been reset"))
149-
}
150-
}
151140
}

app/src/internal/java/experiments/trackersblocking/TrackersBlockingExperimentPlugin.kt

Lines changed: 0 additions & 32 deletions
This file was deleted.

app/src/internal/java/experiments/trackersblocking/TrackersBlockingExperimentView.kt

Lines changed: 0 additions & 111 deletions
This file was deleted.

0 commit comments

Comments
 (0)