Skip to content

Conversation

mikescamell
Copy link
Contributor

@mikescamell mikescamell commented Oct 8, 2025

Task/Issue URL: https://app.asana.com/1/137249556945/project/1207908166761516/task/1211429464967835?focus=true

Description

This PR introduces the address bar trackers animation from the sense of protection experiment. The difference from the experiment is that we now match the cookies animation slide out/in style.

Steps to test this PR

Do a fresh install. Start in light mode.

Ensure the addressBarTrackersAnimationfeature​ toggle is on (it's on by default for internal builds)

Address Bar Trackers Animation

  • Visit a site with trackers and cookies e.g. ign.com
  • Verify the new trackers animation plays in the cookies animation slide style and the trackers count up. Look for any ui oddities.
  • After the slide in has finished the shield should animate (a pop)
  • After the animation is finished wait 1.5 seconds
  • The cookies animation should play
  • Switch to dark mode
  • Pull to refresh the site
  • Verify the new trackers animation plays in the cookies animation slide style and the trackers count up.
  • After the slide in has finished the shield should animate (a pop) and should be the same colour/style as light mode (we're using the same asset for both light and dark)
  • Open bbc.com or another website with less than 5 trackers
  • Verify the new trackers animation plays in the cookies animation slide style but the trackers count up animation should not play. We do not animate the number for less than 5 trackers.

Animation Cancellation

  • Visit a site e.g. ign.com
  • When the new trackers animation starts to play click into the empty space between the end of the sliding in background and the end of the address bar. Look for any ui oddities.
  • The address bar should be in focus and you should no longer see the animation
  • There should be no ui oddities
  • Don't enter any new text
  • Click up or back button
  • The address bar should lose focus and the shield should be showing with the url
  • Pull down to refresh
  • The trackers animation should play again and no ui oddities

Misc tests

  • Increase font size to max
  • Ensure Duck.ai is on and icon is in the address bar
  • Refresh website or go to new one with trackers and cookies (remember clearing data make it easier to reuse the same website)
  • Trackers animation should play and the sliding background should not slide under the duck.ai button
  • Wait for the cookies animation
  • Cookies animation should play and the sliding background should not slide under the duck.ai button
  • Reset font size
  • Switch to short url bar: Settings -> Appearance -> Turn off "Show full site address"
  • Refresh website or go to new one with trackers
  • Trackers animation should play with no issue

_Fla_g off behaviour

  • Ensure the addressBarTrackersAnimationfeature​ toggle is off
  • Refresh website or go to new one with trackers and cookies (remember clearing data make it easier to reuse the same website)
  • The old trackers animation should play
  • Wait for the cookies animation
  • Cookies animation should play
  • Increase font size to max
  • Ensure Duck.ai is on and icon is in the address bar
  • Refresh website or go to new one with cookies (remember clearing data make it easier to reuse the same website)
  • Cookies animation should play and the sliding background should not slide under the duck.ai button (I fixed this for both the experiment and live as they are all tied to the same UI)

UI changes

Screen.Recording.2025-10-08.at.06.58.01.mov

These were deleted in the omnibar cleanup so adding them back with a new name
…stency

We no longer use the startExperimentVariant1Animation and we can rename the function we will be using so it's clearer it's not an experiment
The text is now moved to scenes which we'll utilise in a later commit. These will added to the OmnibarLayout just as the Cookies animation is
We don't need this anymore, we can do what we need in the VM
…ogic

This moves the former experimental trackers animation to it's new state where it mimics the Cookies animation by sliding out but retains it's count up behaviour from the original. We moved to this style to maintain consistency with the animations here

We added some new behaviour in the TrackerCountAnimator which means we only animate the count up if we have greater than 4 trackers, otherwise we wait and the end the animation.

We need to expose getTrackerAnimationStartCount so that it's possible to set the correct widths for the trackers count TextViews

We'll tidy up the BrowserLottieTrackersAnimatorHelper in a later commit but I wanted to leave this as is so you can see the previous experiment behaviour
If we're happy with how this rolls out we'll be able to remove protected and dark shield
Matches the behaviour we had in the commented section before that we deleted in a previous commit, but now accounts for the newly added `if(!currentBrowserViewState().maliciousSiteBlocked` by moving the logic to the VM
- Extract AddressBarTrackersAnimator from BrowserLottieTrackersAnimatorHelper
- Create CommonAddressBarAnimationHelper for shared animation utilities
- Consolidate duplicate fade in/out animation methods
- Move classes to an addressbar package
- Remove redundant experiment code
I found the name of this function confusing as it does more than just the trackers animation, it cancels the cookies animation too
This will also fix the same issue that happens with the current cookies animation
@mikescamell mikescamell marked this pull request as ready for review October 8, 2025 06:00
Update trackersCount method to use siteLiveData for tracker count retrieval

Makes testing easier and is no different from calling the site property
@mikescamell mikescamell requested a review from Copilot October 8, 2025 10:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new address bar trackers animation feature that replaces the previous trackers animation with a slide-in/slide-out style animation similar to the cookies animation. The animation displays tracker count with a counting effect and shows a shield icon pop animation when enabled through a feature toggle.

Key Changes

  • Added new address bar trackers animation components with sliding text and count animations
  • Implemented feature toggle system to control when the new animation is used
  • Updated existing animation infrastructure to support the new address bar animation style

Reviewed Changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
TrackerCountAnimatorTest.kt Added comprehensive test coverage for tracker count animation logic
OmnibarLayoutViewModelTest.kt Updated test method name for animation cancellation
address_bar_trackers_animation_shield.json New Lottie animation asset for shield pop effect
view_single_omnibar.xml Added new shield animation view and updated layout constraints
address_bar_trackers_animation_scene_*.xml New layout files for animation scenes with tracker text and count views
TrackersRenderer.kt Moved to addressbar package for better organization
TrackerCountAnimator.kt New component implementing tracker count animation with threshold-based logic
AddressBarTrackersAnimator.kt Main animator class orchestrating the complete address bar trackers animation
BrowserLottieTrackersAnimatorHelper.kt Updated to integrate new address bar animation system
LottiePrivacyShieldAnimationHelper.kt Added feature toggle integration for shield animation selection
OmnibarLayout.kt Updated to use new animation system when feature toggle is enabled
AddressBarTrackersAnimationFeatureToggle.kt Added internal always enabled flag for feature toggle
BrowserTabViewModel.kt Added logic to enqueue cookies animation when new feature is enabled

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