-
Notifications
You must be signed in to change notification settings - Fork 952
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 show/hide behaviour #5729
Tab Switcher Animation: Add show/hide behaviour #5729
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
c08e5e9
to
684efba
Compare
6b63d29
to
a5c2d0d
Compare
6f1378c
to
cf82097
Compare
a5c2d0d
to
faeee79
Compare
cf82097
to
2603460
Compare
8f336a1
to
47f8a30
Compare
faeee79
to
0bca9d3
Compare
0bca9d3
to
a584d32
Compare
47f8a30
to
42edf95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected, nice job! 🎖️
Left a comment in the code but I'll let you decide what to do.
@@ -77,6 +77,7 @@ class TabSwitcherAdapter( | |||
private val list = mutableListOf<TabSwitcherItem>() | |||
private var isDragging: Boolean = false | |||
private var layoutType: LayoutType = LayoutType.GRID | |||
private var onAnimationTileCloseClickListener: (() -> Unit)? = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's already a TabSwitcherListener
supplied in the constructor that contains a couple of callbacks, WDYT about moving it there?
private const val MINIMUM_TRACKER_COUNT = 10 | ||
private const val MINIMUM_TAB_COUNT = 2 | ||
|
||
class TabSwitcherTileAnimationMonitor @Inject constructor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
42edf95
to
438730e
Compare
ee7bb0e
to
a66cf46
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.
Allows to reshow the animation without having to uninstall and reinstall
We only show if you have 10 trackers or more Next we'll check the tab count
…de based on tab count Only show if we have 2 or more tabs open Next we'll extract this logic out
The logic for determining the visibility of the Tracker Animation Tile has been moved to a new `TabSwitcherTileAnimationMonitor` class. This includes: - Determining the tracker count in the last 7 days. - Determining the number of open tabs. - Checking if the animation tile is dismissed. - Defining the minimum requirements for displaying the tile (minimum tracker count and minimum tab count). The `WebTrackersBlockedAppRepository` has been updated to have a new public method to retrieve the number of tracker count for last 7 days. The `TabSwitcherViewModel` was refactored to use the new `TabSwitcherTileAnimationMonitor` and the `observeAnimationTileVisibility` function. The `createTrackerAnimationTile` and `getTrackerCountForLast7Days` were deleted.
- Adds a new state to track if the animation tile has been seen. - Modifies the logic for displaying the animation tile to include the new state. - The animation tile will show if NOT dismissed but already seen, even if we have less than 2 tabs
We want the text in the Animation tile to match the text in the tabs.
If the user presses close all tabs we reset the tile and it will show again if 2 tabs are visible and more than 10 trackers
We've decided to reset the tile if a user clears data as it's done so often that they might not see the tile much. We do not permanently dismiss the tile unless the user clicks the close button themselves
Makes it much easier to test. Renamed the text to make it clear we're resetting as the new logic for showing/hiding determines whether you will see it.
In dark mode we end up with a white button
Something wen wrong with the previous Lottie export for the animation and we were missing the shield gradient. This new animation now has that missing gradient.
…ackerAnimationTile This prevents a race condition when close all tabs is called and stops the animated tile staying visible due to the reactive changes that stem from setting the tab as seen/unseen. We need this as a result of recent behaviour changes to close all tabs/fire button scenarios where we do NOT want the animated tile permanently dismissed. Only if a user presses the close button.
While lower and upper thresholds are now the same I'm leaving them as separate as there might be changes come ship review
52a92a5
to
406b808
Compare
438730e
to
4d29f15
Compare
0b63a80
into
feature/mike/tab-switcher-tile-animation/translations
Task/Issue URL: https://app.asana.com/0/1207908166761516/1209368500700767
Description
Added show/hide logic for the animated tile. The tile appears when users have blocked at least 10 trackers and have 2 or more tabs open.
Once visible the tile does not get removed unless:
Once dismissed, the tile will not reappear until explicitly re-enabled or reset through dev settings.
Steps to test this PR
Pre-requisites:
tabSwitcherAnimation
feature toggle is turned onTab Switcher Animated Tile Showing
Tab Switcher Animated Tile Stays Visible Once Seen
Tab Switcher Animated Tile Dismissal
Tab Switcher Animated Tile Clearing Data
Tab Switcher Animated Tile Show Again After Clearing Data
Tab Switcher Animated Tile Close All Tabs
Tab Switcher Animated Tile Show Again After Close Tabs
Demo
Screen_recording_20250307_190356.mp4