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 real tracker count #5723

Conversation

mikescamell
Copy link
Contributor

@mikescamell mikescamell commented Mar 3, 2025

Task/Issue URL: https://app.asana.com/0/488551667048375/1209368500700765

Description

Replaced random tracker count with actual tracker data from the past 7 days in the tab switcher animation tile. The tracker count is now fetched from the WebTrackersBlockedAppRepository instead of generating random numbers.

Steps to test this PR

Tab Switcher Tracker Count

  • Open the tab switcher
  • Verify the tracker count shown matches the actual number of trackers blocked in the last 7 days
  • Verify the tracker animation tile displays correctly in both grid and list views

Demo

(Tablet omitted as only count has changed)

Screen_recording_20250303_180553.mp4

Copy link
Contributor Author

mikescamell commented Mar 3, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/add-animated-tile-placeholder branch from a4c9e80 to 6150c8f Compare March 3, 2025 16:23
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/display-real-tracker-count branch from 6dbb1d4 to 753e562 Compare March 3, 2025 16:23
@mikescamell mikescamell changed the base branch from feature/mike/tab-switcher-tile-animation/add-animated-tile-placeholder to graphite-base/5723 March 3, 2025 16:27
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/display-real-tracker-count branch from 753e562 to f4309c1 Compare March 3, 2025 17:47
@mikescamell mikescamell changed the base branch from graphite-base/5723 to feature/mike/tab-switcher-tile-animation/add-animated-tile-placeholder March 3, 2025 17:47
@mikescamell mikescamell marked this pull request as ready for review March 3, 2025 18:01
@mikescamell mikescamell changed the title Tab Switcher Tile Animation: Add real tracker count Tab Switcher Animation: Add real tracker count Mar 3, 2025
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/display-real-tracker-count branch from f4309c1 to c5263f4 Compare March 4, 2025 14:23
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/add-animated-tile-placeholder branch from e4fd0fa to 2e13d0c Compare March 4, 2025 14:23
@mikescamell mikescamell changed the base branch from feature/mike/tab-switcher-tile-animation/add-animated-tile-placeholder to graphite-base/5723 March 6, 2025 16:46
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/display-real-tracker-count branch from c5263f4 to b005223 Compare March 6, 2025 17:16
@mikescamell mikescamell changed the base branch from graphite-base/5723 to feature/mike/tab-switcher-tile-animation/add-animated-tile-placeholder March 6, 2025 17:17
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/display-real-tracker-count branch from b005223 to 4fe8ab9 Compare March 6, 2025 18:07
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/add-animated-tile-placeholder branch from f8fd101 to 0f66c87 Compare March 6, 2025 18:08
@0nko 0nko self-assigned this Mar 7, 2025
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.

Looks good, nice work! 🥇

@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/display-real-tracker-count branch from 1fcf730 to aab5219 Compare March 11, 2025 08:52
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/add-animated-tile-placeholder branch from 0f66c87 to bf31d11 Compare March 11, 2025 08:52
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/display-real-tracker-count branch from aab5219 to 8aa0824 Compare March 12, 2025 10:19
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/add-animated-tile-placeholder branch from bf31d11 to 392f190 Compare March 12, 2025 10:19
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/display-real-tracker-count branch from 8aa0824 to f2828b6 Compare March 12, 2025 15:08
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/add-animated-tile-placeholder branch from 392f190 to 3cae589 Compare March 12, 2025 15:08
… and WebTrackersBlockedDao

Not adding the public API yet as it's an experiment and there's a chance we kill it
This commit refactors the Tab Switcher to display the tracker animation tile with the actual tracker count.

*   The `TabSwitcherViewModel` now uses `liveData` instead of `map` to emit the list of `TabSwitcherItem`.
*   The `TabSwitcherViewModel` now uses a `switchMap` operator to emit the `tabSwitcherItems` live data which allows us to call the getTrackersCountBetween suspending function
*   The `TabSwitcherViewModel` now creates the tracker animation tile using the real number of trackers blocked in the last 7 days, retrieved using the `WebTrackersBlockedAppRepository`.
* The `TabSwitcherAdapter` now takes the actual tracker count from the `TabSwitcherItem.TrackerAnimationTile` to show in the view.
* Removed the random tracker count generation from the adapter.
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/add-animated-tile-placeholder branch from 3cae589 to 640be9c Compare March 17, 2025 17:28
@mikescamell mikescamell force-pushed the feature/mike/tab-switcher-tile-animation/display-real-tracker-count branch from f2828b6 to bf8dd2b Compare March 17, 2025 17:28
Task/Issue URL:
https://app.asana.com/0/1207908166761516/1209560463368002

### Description
Added localized strings for tracker blocking statistics animation in the
tab switcher across multiple languages. The strings display the number
of trackers blocked in the last 7 days.

### Steps to test this PR

_Verify translations_
- [x] Switch device language to different supported locales and verify
the tracker blocking statistics text appears correctly
- [x] Verify placeholder formatting works correctly with different
numeric values
- [x] Check that HTML formatting (bold tags) renders properly across
languages

_Verify string usage_
- [x] Open tab switcher and confirm tracker blocking statistics are
displayed
- [x] Verify the "in the last 7 days" text appears correctly below the
main statistics

---------

Co-authored-by: Dax The Translator <[email protected]>
@mikescamell mikescamell merged commit f14cf7d into feature/mike/tab-switcher-tile-animation/add-animated-tile-placeholder Mar 18, 2025
4 of 5 checks passed
@mikescamell mikescamell deleted the feature/mike/tab-switcher-tile-animation/display-real-tracker-count branch March 18, 2025 09:11
mikescamell added a commit that referenced this pull request Mar 19, 2025
Task/Issue URL: https://app.asana.com/0/488551667048375/1209368500700765

Replaced random tracker count with actual tracker data from the past 7
days in the tab switcher animation tile. The tracker count is now
fetched from the WebTrackersBlockedAppRepository instead of generating
random numbers.

_Tab Switcher Tracker Count_
- [x] Open the tab switcher
- [x] Verify the tracker count shown matches the actual number of
trackers blocked in the last 7 days
- [x] Verify the tracker animation tile displays correctly in both grid
and list views

(Tablet omitted as only count has changed)

https://github.com/user-attachments/assets/044501d7-a61f-478c-b0ea-19e59ac35049

---------

Co-authored-by: Dax The Translator <[email protected]>
mikescamell added a commit that referenced this pull request Mar 21, 2025
Task/Issue URL: https://app.asana.com/0/488551667048375/1209368500700765

Replaced random tracker count with actual tracker data from the past 7
days in the tab switcher animation tile. The tracker count is now
fetched from the WebTrackersBlockedAppRepository instead of generating
random numbers.

_Tab Switcher Tracker Count_
- [x] Open the tab switcher
- [x] Verify the tracker count shown matches the actual number of
trackers blocked in the last 7 days
- [x] Verify the tracker animation tile displays correctly in both grid
and list views

(Tablet omitted as only count has changed)

https://github.com/user-attachments/assets/044501d7-a61f-478c-b0ea-19e59ac35049

---------

Co-authored-by: Dax The Translator <[email protected]>
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