Skip to content

Commit

Permalink
Rearranging tabs: Remove temporary pixels (#4975)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1207418217763355/1207724966190088/f

### Description

This PR just removes temp pixels.
  • Loading branch information
0nko authored Sep 3, 2024
1 parent 70b723d commit 97e1b2c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 18 deletions.
4 changes: 0 additions & 4 deletions app/src/main/java/com/duckduckgo/app/pixels/AppPixelName.kt
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,7 @@ enum class AppPixelName(override val pixelName: String) : Pixel.PixelName {
TAB_MANAGER_MENU_CLOSE_ALL_TABS_CONFIRMED("m_tab_manager_menu_close_all_tabs_confirm"),
TAB_MANAGER_MENU_DOWNLOADS_PRESSED("m_tab_manager_menu_downloads"),
TAB_MANAGER_MENU_SETTINGS_PRESSED("m_tab_manager_menu_settings"),
TAB_MANAGER_REARRANGE_TABS("m_tab_manager_rearrange_tabs"),
TAB_MANAGER_REARRANGE_TABS_DAILY("m_tab_manager_rearrange_tabs_daily"),
TAB_MANAGER_REARRANGE_BANNER_MANUAL_CLOSED("m_tab_manager_rearrange_banner_manual_closed"),
TAB_MANAGER_REARRANGE_BANNER_AUTODISMISSED("m_tab_manager_rearrange_banner_autodismissed"),
TAB_MANAGER_REARRANGE_BANNER_DISPLAYED("m_tab_manager_rearrange_banner_displayed"),
TAB_MANAGER_GRID_VIEW_BUTTON_CLICKED("m_tab_manager_grid_view_button_clicked"),
TAB_MANAGER_LIST_VIEW_BUTTON_CLICKED("m_tab_manager_list_view_button_clicked"),
TAB_MANAGER_VIEW_MODE_TOGGLED_DAILY("m_tab_manager_view_mode_toggled_daily"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,26 +178,19 @@ class TabSwitcherViewModel @Inject constructor(
val data = tabRepository.tabSwitcherData.first()
tabRepository.setAnnouncementDisplayCount(data.announcementDisplayCount + 1)
}

pixel.fire(AppPixelName.TAB_MANAGER_REARRANGE_BANNER_DISPLAYED)
}

fun onFeatureAnnouncementCloseButtonTapped() {
dismissFeatureAnnouncementBanner()

pixel.fire(AppPixelName.TAB_MANAGER_REARRANGE_BANNER_MANUAL_CLOSED)
}

fun onTabDraggingStarted() {
if (isBannerAlreadyVisible) {
dismissFeatureAnnouncementBanner()

pixel.fire(AppPixelName.TAB_MANAGER_REARRANGE_BANNER_AUTODISMISSED)
}

viewModelScope.launch(dispatcherProvider.io()) {
val params = mapOf("userState" to tabRepository.tabSwitcherData.first().userState.name)
pixel.fire(AppPixelName.TAB_MANAGER_REARRANGE_TABS, params)
pixel.fire(AppPixelName.TAB_MANAGER_REARRANGE_TABS_DAILY, parameters = params, encodedParameters = emptyMap(), DAILY)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import com.duckduckgo.adclick.api.AdClickManager
import com.duckduckgo.app.browser.session.WebViewSessionStorage
import com.duckduckgo.app.pixels.AppPixelName
import com.duckduckgo.app.statistics.pixels.Pixel
import com.duckduckgo.app.statistics.pixels.Pixel.PixelType.COUNT
import com.duckduckgo.app.statistics.pixels.Pixel.PixelType.DAILY
import com.duckduckgo.app.statistics.store.StatisticsDataStore
import com.duckduckgo.app.tabs.model.TabEntity
Expand Down Expand Up @@ -313,21 +312,16 @@ class TabSwitcherViewModelTest {
testee.onTabDraggingStarted()

verify(mockTabRepository).setWasAnnouncementDismissed(true)
verify(mockPixel).fire(AppPixelName.TAB_MANAGER_REARRANGE_BANNER_AUTODISMISSED)
}

@Test
fun whenAnnouncementDisplayedThePixelSent() = runTest {
testee.onTabFeatureAnnouncementDisplayed()

verify(mockPixel).fire(AppPixelName.TAB_MANAGER_REARRANGE_BANNER_DISPLAYED)
}

@Test
fun whenAnnouncementDismissedThePixelIsSent() = runTest {
testee.onFeatureAnnouncementCloseButtonTapped()

verify(mockPixel).fire(AppPixelName.TAB_MANAGER_REARRANGE_BANNER_MANUAL_CLOSED)
}

@OptIn(ExperimentalCoroutinesApi::class)
Expand All @@ -338,7 +332,6 @@ class TabSwitcherViewModelTest {
advanceUntilIdle()

val params = mapOf("userState" to NEW.name)
verify(mockPixel).fire(AppPixelName.TAB_MANAGER_REARRANGE_TABS, params, emptyMap(), COUNT)
verify(mockPixel).fire(AppPixelName.TAB_MANAGER_REARRANGE_TABS_DAILY, params, emptyMap(), DAILY)
}

Expand Down

0 comments on commit 97e1b2c

Please sign in to comment.