Skip to content

Conversation

@0nko
Copy link
Member

@0nko 0nko commented Dec 17, 2025

Task/Issue URL: https://app.asana.com/1/137249556945/project/1207418217763355/task/1212330168162873

Description

Adds animation canceling when clicked to allow users to start using the browser more quickly.

Steps to test this PR

Regular tab

  • Load a website with trackers
  • While animation is in progress, tap on it
  • Verify the animation is canceled and you can start typing in the address bar

Custom tab

  • Go to Settings -> Developer settings -> Custom tabs)
  • Load a website with trackers
  • While animation is in progress, tap on it
  • Verify the animation is canceled

Note

Enable tapping the trackers animation or custom tab toolbar to cancel animations, with improved animator lifecycle and shield view handling for clean, immediate stops.

  • Omnibar:
    • Add click handlers to cancel animations:
      • newCustomTabToolbarContainer.customTabInnerContainer -> cancelCustomTabAnimations().
      • trackersAnimation -> cancelAddressBarAnimations().
    • New cancelCustomTabAnimations() delegating to animatorHelper.cancelAnimations(customTabViews()).
  • Animations (BrowserLottieTrackersAnimatorHelper):
    • Support cancel via container tap: set sceneRoot.setOnClickListener { cancelAnimations(omnibarViews, shieldViews) }.
    • Track currentShieldViews and reset alpha on cancel; include shieldViews in cancelAnimations(...).
    • Manage animator lifecycle with runningCookieAnimators: cancel/clear before starting; add all created AnimatorSets; robust stopCookiesAnimation() (cancel animators, end transitions, clear listeners, hide views, reset alphas).
    • Prevent glitches: guard flags (enqueueCookiesAnimation reset), avoid null filtering, skip cookies in custom tabs.
  • API:
    • BrowserTrackersAnimatorHelper.cancelAnimations now accepts shieldViews (default empty) and KDoc updated.

Written by Cursor Bugbot for commit f7ee029. This will update automatically on new commits. Configure here.

@GerardPaligot GerardPaligot self-assigned this Dec 17, 2025
@mikescamell mikescamell self-requested a review December 17, 2025 18:47
@mikescamell
Copy link
Contributor

mikescamell commented Dec 19, 2025

I think this will need more work, and might be more than a QWD attempt 😬

  • Let cookies play
  • Cancel it
  • Refresh
  • You get a glimpse of the cookies animation before the trackers animation plays
cookie-reappear.mp4

}
}

private fun cancelCustomTabAnimations() {
Copy link

Choose a reason for hiding this comment

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

Bug: Cancel methods omit shieldViews, potentially leaving icons faded

The cancelAddressBarAnimations() and cancelCustomTabAnimations() methods call cancelAnimations() without passing shieldViews() or customTabShieldViews(). The fallback mechanism in stopCookiesAnimation() that resets currentShieldViews has an early return if cookie views aren't initialized yet. If the user cancels during the trackers animation (before cookies animation starts), shield views may remain with modified alpha since neither the explicit shieldViews parameter nor the currentShieldViews fallback will reset them.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

3 participants