Skip to content

Add WinBackPromptEvaluator to re-engage users who were previously default browser#8319

Open
catalinradoiu wants to merge 2 commits intodevelopfrom
feature/cradoiu/show-winback-prompt-after-default-change
Open

Add WinBackPromptEvaluator to re-engage users who were previously default browser#8319
catalinradoiu wants to merge 2 commits intodevelopfrom
feature/cradoiu/show-winback-prompt-after-default-change

Conversation

@catalinradoiu
Copy link
Copy Markdown
Contributor

@catalinradoiu catalinradoiu commented Apr 17, 2026

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

Description

Introduces a "win back" prompt for users who previously set DuckDuckGo as their default browser but no longer have it set as default. Key changes include:

  • Added a new WinBackPromptEvaluator that shows the browser comparison screen to eligible users (those who were once the default browser but no longer are, and haven't seen the browser comparison prompt before). This evaluator is registered as a ModalEvaluator with the highest priority (1).
  • Bumped RemoteMessageModalSurfaceEvaluator priority from 1 to 2 and AdditionalDefaultBrowserPromptsImpl priority from 2 to 3 to accommodate the new evaluator's priority slot.
  • Consolidated wasEverDefaultBrowser tracking logic into the defaultBrowser setter in AppInstallSharedPreferences. Setting defaultBrowser = true now automatically and permanently flips wasEverDefaultBrowser to true, removing the need for callers to set it manually. wasEverDefaultBrowser is now a read-only val.
  • Exposed wasEverDefaultBrowser through the UserBrowserProperties interface and its Android implementation.

Steps to test this PR

Win Back Prompt

  • Clean install the app and enable the reactivateUsers and defaultBrowserWinBackPrompt feature toggles
  • From the settings set the app as default browser and resume the app
  • Set another app as default browser and then resume the app
  • The re-engagement prompt should be displayed

UI changes

Show the browser comparison prompt when the user unsets the app as the default browser and then resumes the app:

Screenshot 2026-04-17 at 19.09.12.png


Note

Medium Risk
Adds a new high-priority ModalEvaluator that can launch an activity after a delay and changes default-browser state tracking behavior; issues here could cause unexpected modal ordering or incorrect eligibility decisions but are gated by feature toggles and covered by unit tests.

Overview
Adds a new WinBackPromptEvaluator modal (priority 1) that, when feature-toggled on, shows the browser comparison screen for users who were ever the default browser, are not currently default, and haven’t previously seen the comparison prompt.

Refactors wasEverDefaultBrowser tracking to be set implicitly when AppInstallStore.defaultBrowser is set to true (making wasEverDefaultBrowser read-only), exposes it via UserBrowserProperties, and adjusts existing onboarding/default-browser flows and modal priorities (RemoteMessageModalSurfaceEvaluator to 2, AdditionalDefaultBrowserPromptsImpl to 3) plus tests accordingly.

Reviewed by Cursor Bugbot for commit 45e8a27. Bugbot is set up for automated code reviews on this repo. Configure here.

…omatically when defaultBrowser becomes true

This is to avoid having to explicitly set that flag in the code wherever we set defaultBrowser as true. If we introduce a new entry point for this then we would need to update both flags, which could lead to an inconsistent state if not done.
…the user unsets the app as their default browser

Shows the browser comparison prompt as a modal when a returning user is no longer the default browser. Gated behind the reactivateUsers.defaultBrowserWinBackPrompt toggle.
Copy link
Copy Markdown
Contributor Author

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

@catalinradoiu catalinradoiu changed the title Update AppInstallStore and set wasEverDefaultBrowser flag to true automatically when defaultBrowser becomes true Add WinBackPromptEvaluator to re-engage users who were previously default browser Apr 17, 2026
@catalinradoiu catalinradoiu marked this pull request as ready for review April 17, 2026 16:10
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 45e8a27. Configure here.

private val globalActivityStarter: GlobalActivityStarter,
private val dispatchers: DispatcherProvider,
private val reactivateUsersToggles: ReactivateUsersToggles,
) : ModalEvaluator, WinBackPromptEvaluator {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing @SingleInstanceIn annotation unlike other evaluators

Low Severity

WinBackPromptEvaluatorImpl is missing @SingleInstanceIn(scope = AppScope::class) which both RemoteMessageModalSurfaceEvaluatorImpl and AdditionalDefaultBrowserPromptsImpl use. Without it, the @ContributesMultibinding and @ContributesBinding annotations can produce separate unscoped instances. While the class currently has no mutable state, this deviates from the established pattern for ModalEvaluator implementations and could cause subtle issues if state is added later.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 45e8a27. Configure here.

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.

1 participant