Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab Switcher Animation: Add pixels #5802

Conversation

mikescamell
Copy link
Contributor

@mikescamell mikescamell commented Mar 20, 2025

Task/Issue URL: https://app.asana.com/0/1207908166761516/1209726015931612/f

Description

Added tracking for the tab manager info panel with three new pixels:

  • m_tab_manager_info_panel_impressions - Fired when the panel becomes visible
  • m_tab_manager_info_panel_dismissed - Fired when the panel is dismissed, includes tracker count
  • m_tab_manager_info_panel_tapped - Fired when the panel is tapped

Implemented visibility detection for the tracker animation info panel in the tab switcher to accurately track impressions.

Steps to test this PR

Pre-requisite: Enable tabSwitcherAnimation feature flag

m_tab_manager_info_panel_impressions

  • Start with no tabs
  • Open the TabSwitcher
  • Verify m_tab_manager_info_panel_impressions fires
  • Add many tabs (use developer settings to easily add 100)
  • Ensure that the active tab is one where you cannot see the animated info panel
  • Close the TabSwitcher
  • Open the TabSwitcher
  • Ensure that m_tab_manager_info_panel_impressions is not fired
  • Scroll up slowly to the animated tile until the bottom of the info panel is barely visible
  • Ensure that m_tab_manager_info_panel_impressions is not fired
  • Scroll up until ~75% of the tile is visible
  • Ensure that m_tab_manager_info_panel_impressions is fired
  • Scroll away from the InfoPanel until it is not visible
  • Scroll back to the InfoPanel
  • Ensure that m_tab_manager_info_panel_impressions is fired
  • Scroll away from the InfoPanel until it is not visible
  • Switch layouts
  • Ensure that m_tab_manager_info_panel_impressions is not fired

m_tab_manager_info_panel_tapped

  • Open the TabSwitcher
  • Tap on the panel and verify the tapped pixel is fired

m_tab_manager_info_panel_dismissed

  • Dismiss the panel and verify the dismissed pixel is fired with tracker count

UI changes

N/A

Copy link
Contributor Author

mikescamell commented Mar 20, 2025

@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/add-pixels branch from 0790f4f to c37b211 Compare March 20, 2025 13:45
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/ship-review-translations branch 2 times, most recently from 6e965af to f38c857 Compare March 20, 2025 15:09
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/add-pixels branch 2 times, most recently from 7924095 to 903e299 Compare March 20, 2025 15:27
@mikescamell mikescamell marked this pull request as ready for review March 20, 2025 15:28
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/ship-review-translations branch from ff0442f to eb5a0b1 Compare March 21, 2025 08:55
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/add-pixels branch from 903e299 to e49f8ac Compare March 21, 2025 08:55
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/add-pixels branch from e49f8ac to 40ecf02 Compare March 21, 2025 09:11
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/ship-review-translations branch from eb5a0b1 to 8d2e53e Compare March 21, 2025 09:11
Copy link
Member

@0nko 0nko left a comment

Choose a reason for hiding this comment

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

Works as expected! :shipit:

- Add an `OnScrollListener` to the tabs recycler view to detect when the tracker animation panel is sufficiently visible.
- Introduce a `isTrackerAnimationPanelVisible` flag to prevent repeated visibility notifications.
- Trigger `onTrackerAnimationInfoPanelVisible` when the panel is more than 75% visible and was not previously considered visible.
- Reset `isTrackerAnimationPanelVisible` when the panel is not sufficiently visible.
- Add `onScrollCompleted` callback to `scrollToActiveTab` and `scrollToPosition` functions to ensure `addOnScrollListener` is only called after the initial scroll is completed.
- Only add `OnScrollListener` when the we have the layout set
- Stop listening for scroll updates as soon as a user changes layout type so we don't send pixels while changing layouts
We don't allow deleting the animation unless you go via the dialog
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/add-pixels branch from 40ecf02 to fe8fa06 Compare March 21, 2025 15:49
@mikescamell mikescamell requested a review from 0nko March 21, 2025 15:49
Copy link
Member

@0nko 0nko left a comment

Choose a reason for hiding this comment

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

The new changes works as expected, nice work! 🥇

@mikescamell mikescamell merged commit c0dd08f into feature/mike/tab-switcher-tile-animation/ship-review-translations Mar 21, 2025
5 of 6 checks passed
@mikescamell mikescamell deleted the feature/mike/tab-switcher-tile-animation/add-pixels branch March 21, 2025 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants