Skip to content

Conversation

anikiki
Copy link
Contributor

@anikiki anikiki commented Sep 10, 2025

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

Description

Refactored the widget-related experiment implementation by replacing the experiment-based approach with feature toggles.

  1. Removing OnboardingHomeScreenWidgetExperiment and PostCtaExperienceExperiment classes and their implementations
  2. Updating the OnboardingHomeScreenWidgetToggles and PostCtaExperienceToggles interfaces to use simple feature toggles
  3. Removing experiment-related pixel tracking and metrics collection
  4. Updating the widget-related functionality to use the new toggle-based approach
  5. Renaming and moving files for clarity

The PR removes complex experiment tracking code and replaces it with a more straightforward feature toggle implementation, making the codebase more maintainable and easier to understand.

Steps to test this PR

  • Fresh install from this branch.
  • Don't skip onboarding. Go through the pre-onboarding and once you can access the Settings, override the privacy config with this one: https://www.jsonblob.com/api/1415374897584201728
  • Continue with onboarding until you see the last Dax dialog (the one with the wings). Close it.
  • Open a new tab and confirm you see the widget prompt as in the left screenshot (Onboarding widget prompt).
  • Go to Settings.
  • Tap on the "Home Screen Widget", last option in the "Protections" section at the top. Confirm you see the widget prompt as in the right screenshot (Settings widget prompt).

NO UI changes, reference screenshots

Onboarding widget prompt Settings widget prompt
Screenshot_20250910_173903 Screenshot_20250910_174312

Copy link
Contributor Author

anikiki commented Sep 10, 2025

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

@anikiki anikiki changed the title Refactor post CTA experience toggles and remove unneeded experiment references. Cleanup the code to remove the experiment and keep the code for the winning variant Sep 10, 2025
@anikiki anikiki changed the title Cleanup the code to remove the experiment and keep the code for the winning variant Cleanup the code to remove the experiments and use new feature flags Sep 10, 2025
@anikiki anikiki marked this pull request as ready for review September 10, 2025 17:01
@anikiki anikiki requested a review from Copilot September 10, 2025 17:01
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

Refactored the widget experiment infrastructure by replacing experiment-based approach with feature toggles. This cleanup removes complex experiment tracking code and introduces simpler toggle-based implementations.

  • Removed experiment classes and their tracking infrastructure
  • Migrated to feature toggle-based widget control
  • Updated all dependencies to use new toggle interfaces

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
SystemSearchViewModel.kt Removed widget experiment tracking calls and constructor dependencies
SettingsViewModel.kt Replaced experiment with toggle-based widget prompt detection
CtaViewModel.kt Updated to use toggle interface instead of experiment class
SearchWidgetLifecycleDelegate.kt Removed experiment tracking from widget lifecycle methods
BrowserTabFragment.kt Updated import and dialog class name references
PostCtaExperienceToggles.kt New toggle interface for post-CTA experience features
OnboardingHomeScreenWidgetToggles.kt New toggle interface for onboarding widget features
AlternativeHomeScreenWidgetBottomSheetDialog.kt Moved and renamed dialog class with corrected imports
Test files Updated all test files to use new toggle interfaces instead of mock experiments

@landomen landomen self-assigned this Sep 11, 2025
Copy link
Contributor

@landomen landomen left a comment

Choose a reason for hiding this comment

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

Great cleanup and works as expected 🙌

@anikiki anikiki merged commit 6ee01f5 into develop Sep 11, 2025
15 checks passed
@anikiki anikiki deleted the feature/ana/cleanup_the_code_to_remove_the_experiment_and_keep_the_code_for_the_winning_variant branch September 11, 2025 16:56
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