mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-03 23:15:31 +00:00
MR2 telemetry - Inactive tabs CFR (#22301)
* For #22298 - Added telemetry to inactive tabs CFR * For #22298 - added PR issue number to metrics Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
e3b6e00331
commit
2e5555d034
@ -3110,6 +3110,45 @@ tabs_tray:
|
||||
notification_emails:
|
||||
- android-probes@mozilla.com
|
||||
expires: "2022-11-01"
|
||||
inactive_tabs_cfr_settings:
|
||||
type: event
|
||||
description: |
|
||||
A user has opened settings via the inactive tabs CFR.
|
||||
bugs:
|
||||
- https://github.com/mozilla-mobile/fenix/issues/22298
|
||||
data_reviews:
|
||||
- https://github.com/mozilla-mobile/fenix/pull/22301
|
||||
data_sensitivity:
|
||||
- interaction
|
||||
notification_emails:
|
||||
- android-probes@mozilla.com
|
||||
expires: "2022-11-01"
|
||||
inactive_tabs_cfr_dismissed:
|
||||
type: event
|
||||
description: |
|
||||
A user has dismissed the inactive tabs CFR.
|
||||
bugs:
|
||||
- https://github.com/mozilla-mobile/fenix/issues/22298
|
||||
data_reviews:
|
||||
- https://github.com/mozilla-mobile/fenix/pull/22301
|
||||
data_sensitivity:
|
||||
- interaction
|
||||
notification_emails:
|
||||
- android-probes@mozilla.com
|
||||
expires: "2022-11-01"
|
||||
inactive_tabs_cfr_visible:
|
||||
type: event
|
||||
description: |
|
||||
An indication of whether the inactive tabs CFR is visible.
|
||||
bugs:
|
||||
- https://github.com/mozilla-mobile/fenix/issues/22298
|
||||
data_reviews:
|
||||
- https://github.com/mozilla-mobile/fenix/pull/22301
|
||||
data_sensitivity:
|
||||
- interaction
|
||||
notification_emails:
|
||||
- android-probes@mozilla.com
|
||||
expires: "2022-11-01"
|
||||
|
||||
collections:
|
||||
renamed:
|
||||
|
@ -212,6 +212,9 @@ sealed class Event {
|
||||
object TabsTrayCloseAllInactiveTabs : Event()
|
||||
data class TabsTrayCloseInactiveTab(val amountClosed: Int = 1) : Event()
|
||||
object TabsTrayOpenInactiveTab : Event()
|
||||
object TabsTrayInactiveTabsCFRGotoSettings : Event()
|
||||
object TabsTrayInactiveTabsCFRDismissed : Event()
|
||||
object TabsTrayInactiveTabsCFRIsVisible : Event()
|
||||
|
||||
object InactiveTabsSurveyOpened : Event()
|
||||
data class InactiveTabsOffSurvey(val feedback: String) : Event() {
|
||||
|
@ -643,6 +643,15 @@ private val Event.wrapper: EventWrapper<*>?
|
||||
{ Preferences.turnOffInactiveTabsSurvey.record(it) },
|
||||
{ Preferences.turnOffInactiveTabsSurveyKeys.valueOf(it) }
|
||||
)
|
||||
is Event.TabsTrayInactiveTabsCFRGotoSettings -> EventWrapper<NoExtraKeys>(
|
||||
{ TabsTray.inactiveTabsCfrSettings.record(it) }
|
||||
)
|
||||
is Event.TabsTrayInactiveTabsCFRDismissed -> EventWrapper<NoExtraKeys>(
|
||||
{ TabsTray.inactiveTabsCfrDismissed.record(it) }
|
||||
)
|
||||
is Event.TabsTrayInactiveTabsCFRIsVisible -> EventWrapper<NoExtraKeys>(
|
||||
{ TabsTray.inactiveTabsCfrVisible.record(it) }
|
||||
)
|
||||
is Event.AutoPlaySettingVisited -> EventWrapper<NoExtraKeys>(
|
||||
{ Autoplay.visitedSetting.record(it) }
|
||||
)
|
||||
|
@ -27,8 +27,10 @@ import mozilla.components.support.ktx.android.util.dpToPx
|
||||
import mozilla.components.support.ktx.kotlinx.coroutines.flow.ifChanged
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.browser.infobanner.InfoBanner
|
||||
import org.mozilla.fenix.components.metrics.Event
|
||||
import org.mozilla.fenix.databinding.ComponentTabstray2Binding
|
||||
import org.mozilla.fenix.databinding.OnboardingInactiveTabsCfrBinding
|
||||
import org.mozilla.fenix.ext.components
|
||||
import org.mozilla.fenix.ext.potentialInactiveTabs
|
||||
import org.mozilla.fenix.utils.Settings
|
||||
|
||||
@ -62,6 +64,7 @@ class TabsTrayInactiveTabsOnboardingBinding(
|
||||
|
||||
private fun createInactiveCFR() {
|
||||
val context: Context = context
|
||||
val metrics = context.components.analytics.metrics
|
||||
val anchorPosition = IntArray(2)
|
||||
val popupBinding = OnboardingInactiveTabsCfrBinding.inflate(LayoutInflater.from(context))
|
||||
val popup = Dialog(context)
|
||||
@ -75,12 +78,14 @@ class TabsTrayInactiveTabsOnboardingBinding(
|
||||
popupBinding.closeInfoBanner.setOnClickListener {
|
||||
popup.dismiss()
|
||||
settings.shouldShowInactiveTabsOnboardingPopup = false
|
||||
metrics.track(Event.TabsTrayInactiveTabsCFRDismissed)
|
||||
}
|
||||
|
||||
popupBinding.bannerInfoMessage.setOnClickListener {
|
||||
popup.dismiss()
|
||||
settings.shouldShowInactiveTabsOnboardingPopup = false
|
||||
navigationInteractor.onTabSettingsClicked()
|
||||
metrics.track(Event.TabsTrayInactiveTabsCFRGotoSettings)
|
||||
}
|
||||
|
||||
val messageText = context.getString(R.string.tab_tray_inactive_onboarding_message)
|
||||
@ -110,5 +115,6 @@ class TabsTrayInactiveTabsOnboardingBinding(
|
||||
setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
}
|
||||
popup.show()
|
||||
metrics.track(Event.TabsTrayInactiveTabsCFRIsVisible)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user