Skip to content

Adapt Activity & Privacy Stats widgets for ads and trackers #1621

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

Merged
merged 8 commits into from
Apr 15, 2025

Conversation

noisysocks
Copy link
Contributor

@noisysocks noisysocks commented Apr 9, 2025

Asana Task/Github Issue: https://app.asana.com/0/1209121419454298/1209865676528005/f

Description

adBlocking.enabled = false adBlocking.enabled = true
none-noAdBlocking none-adBlocking
some-noAdBlocking some-adBlocking
many-noAdBlocking many-adBlocking

Updates the Activity and Privacy Stats widgets to support a variation where browser protections include ad blocking as well as tracker protection.

  • Updates UI text, icons, and styles based on whether the browser blocks just trackers or ads and trackers.
  • Introduces a adBlocking feature flag to NewTabPageSettings to control display.
  • Updates tests and mock data accordingly.

Testing Steps

Navigate to:

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

@noisysocks noisysocks added enhancement New feature or request minor Increment the minor version when merged labels Apr 9, 2025
@noisysocks noisysocks requested review from shakyShane, mgurgel and a team as code owners April 9, 2025 04:36
Copy link

github-actions bot commented Apr 9, 2025

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

github-actions bot commented Apr 9, 2025

[Beta] Generated file diff

Time updated: Tue, 15 Apr 2025 22:43:06 GMT

Integration
    - integration/pages/new-tab/dist/index.css
  • integration/pages/new-tab/dist/index.js
  • integration/pages/new-tab/locales/en/new-tab.json

File has changed

Windows
    - windows/pages/new-tab/dist/index.css
  • windows/pages/new-tab/dist/index.js
  • windows/pages/new-tab/locales/en/new-tab.json

File has changed

Apple
    - dist/pages/new-tab/dist/index.css
  • dist/pages/new-tab/dist/index.js
  • dist/pages/new-tab/locales/en/new-tab.json

File has changed

New Files
    - integration/pages/new-tab/icons/shield-green.svg
  • windows/pages/new-tab/icons/shield-green.svg
  • dist/pages/new-tab/icons/shield-green.svg

❌ File only exists in new changeset

Copy link

netlify bot commented Apr 9, 2025

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit 135b3f0
🔍 Latest deploy log https://app.netlify.com/sites/content-scope-scripts/deploys/67fee0d31decac0008840d1e
😎 Deploy Preview https://deploy-preview-1621--content-scope-scripts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@noisysocks noisysocks force-pushed the randerson/ads-and-trackers-copy branch 2 times, most recently from 0049864 to f1e8724 Compare April 9, 2025 04:51
Copy link
Contributor

@mgurgel mgurgel left a comment

Choose a reason for hiding this comment

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

Looks excellent to me. The useTrackerType hook makes it easier to roll back the changes if the experiment is not successful. In fact, I wonder if it's worth creating separate components (e.g. ActivityHeadingAds and TrackerStatusAds) to make it easier to commit to one or the other once the experiment is done. We've been doing something similar in Duck Player to good results. Not a request, just a thought.

I agree with the choice of storing trackerType in activity config, but I'd still like to get Shane's sign-off on it when he's back.

@noisysocks
Copy link
Contributor Author

I agree with the choice of storing trackerType in activity config, but I'd still like to get Shane's sign-off on it when he's back.

I may end up using a initResponse feature flag after all depending on outcome of https://app.asana.com/1/137249556945/project/0/task/1209958041601248.

@noisysocks noisysocks force-pushed the randerson/ads-and-trackers-copy branch from 935fd1c to 80596e8 Compare April 14, 2025 01:25
@noisysocks noisysocks changed the title Adapt Activity widget for ads and trackers Adapt Activity & Privacy Stats widgets for ads and trackers Apr 14, 2025
@noisysocks
Copy link
Contributor Author

I’ve made some significant changes here.

The PR now updates both the Activity and Privacy Stats widgets to support the variation where the browser blocks ads as well as trackers. (Before, only the Activity widget was updated.) This addresses an oversight in the original design, see https://app.asana.com/1/137249556945/project/0/task/1209958041601248.

Because more than one type of widget is now affected by this feature flag I think it makes sense to do the flagging in NewTabPageSettings instead of the per-widget config object.

I’ve made those changes, updated tests, and updated the PR description.

@noisysocks noisysocks requested a review from mgurgel April 14, 2025 01:49
@mgurgel mgurgel force-pushed the randerson/ads-and-trackers-copy branch from 593ae56 to b12de7d Compare April 14, 2025 16:04
mgurgel
mgurgel previously approved these changes Apr 14, 2025
Copy link
Contributor

@mgurgel mgurgel 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 👍 Over to @shakyShane for an architecture review

@noisysocks
Copy link
Contributor Author

I tested this in the Windows app and it worked well but noticed that the subtitle line height and letter spacing was inconsistent with the Next Steps widget. I’ve tweaked it to be consistent:

127 0 0 1_8000__platform=windows feed=both activity=empty stats=none adBlocking=enabled next-steps=bringStuff next-steps=defaultApp(iPad Air)

Copy link
Contributor

@shakyShane shakyShane left a comment

Choose a reason for hiding this comment

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

Very nice work - my only points are the same as the other PR:

  • 1: what's the plan with translations?
  • 2: the PR should go green once my other fix is merged.

@noisysocks noisysocks force-pushed the randerson/ads-and-trackers-copy branch from 1822ae6 to 97dde26 Compare April 15, 2025 09:55
- Updates UI text, icons, and styles based on whether the browser blocks just trackers or ads and trackers.
- Introduces a `trackerType` config option ('trackersOnly' or 'adsAndTrackers') to control the display.
- Adds new translation strings and a green shield icon for the ads and trackers variant.
- Updates tests and mock data accordingly.
@noisysocks noisysocks force-pushed the randerson/ads-and-trackers-copy branch from cabe589 to 135b3f0 Compare April 15, 2025 22:42
@noisysocks noisysocks merged commit c8a9f21 into main Apr 15, 2025
13 checks passed
@noisysocks noisysocks deleted the randerson/ads-and-trackers-copy branch April 15, 2025 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor Increment the minor version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants