Add WinBackPromptEvaluator to re-engage users who were previously default browser#8319
Add WinBackPromptEvaluator to re-engage users who were previously default browser#8319catalinradoiu wants to merge 2 commits intodevelopfrom
Conversation
…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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 { |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 45e8a27. Configure here.



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:
WinBackPromptEvaluatorthat 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 aModalEvaluatorwith the highest priority (1).RemoteMessageModalSurfaceEvaluatorpriority from1to2andAdditionalDefaultBrowserPromptsImplpriority from2to3to accommodate the new evaluator's priority slot.wasEverDefaultBrowsertracking logic into thedefaultBrowsersetter inAppInstallSharedPreferences. SettingdefaultBrowser = truenow automatically and permanently flipswasEverDefaultBrowsertotrue, removing the need for callers to set it manually.wasEverDefaultBrowseris now a read-onlyval.wasEverDefaultBrowserthrough theUserBrowserPropertiesinterface and its Android implementation.Steps to test this PR
Win Back Prompt
reactivateUsersanddefaultBrowserWinBackPromptfeature togglesUI changes
Show the browser comparison prompt when the user unsets the app as the default browser and then resumes the app:
Note
Medium Risk
Adds a new high-priority
ModalEvaluatorthat 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
WinBackPromptEvaluatormodal (priority1) 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
wasEverDefaultBrowsertracking to be set implicitly whenAppInstallStore.defaultBrowseris set totrue(makingwasEverDefaultBrowserread-only), exposes it viaUserBrowserProperties, and adjusts existing onboarding/default-browser flows and modal priorities (RemoteMessageModalSurfaceEvaluatorto2,AdditionalDefaultBrowserPromptsImplto3) plus tests accordingly.Reviewed by Cursor Bugbot for commit 45e8a27. Bugbot is set up for automated code reviews on this repo. Configure here.