Skip to content

Integrate NTP promos into modal coordinator - #9290

Draft
aibrahim- wants to merge 1 commit into
developfrom
feature/aibrahim/modal-coordinator-ntp-promos
Draft

Integrate NTP promos into modal coordinator#9290
aibrahim- wants to merge 1 commit into
developfrom
feature/aibrahim/modal-coordinator-ntp-promos

Conversation

@aibrahim-

Copy link
Copy Markdown
Contributor

Collapse the New Tab Page's app-originated prompt systems from four to two by absorbing the Privacy Pro foreground promo and the Add Widget promo into the modal coordinator, so they now share its priority ordering and 24-hour cooldown instead of racing each other.

  • ModalEvaluator gains a declared ModalTrigger (APP_RESUME default so the existing four evaluators are unchanged; NTP_RENDER is new).
  • Coordinator filters evaluators by trigger: process onResume drives APP_RESUME; the new NewTabPageModalTrigger.onNewTabPageShown() drives NTP_RENDER.
  • Privacy Pro (APP_RESUME) and Add Widget (NTP_RENDER) become ModalEvaluators that render via NewTabPageModalPresenter, which the visible tab's BrowserTabViewModel implements and registers while visible, reusing the existing CTA bottom-sheet path (pixels and dismiss handling unchanged).
  • Eligibility for the Privacy Pro promo is extracted into a shared SubscriptionPromoModalDecider; the old checkSubscriptionPromoOnForeground path and the Add Widget branch of getHomeCta are removed, closing the double-prompt window.

Task:

Task/Issue URL:
Tech Design URL (if applicable):

Description

Steps to test this PR

Feature 1

  • [ ]
  • [ ]

UI changes

Before After
!(Upload before screenshot) (Upload after screenshot)

Collapse the New Tab Page's app-originated prompt systems from four to two
by absorbing the Privacy Pro foreground promo and the Add Widget promo into
the modal coordinator, so they now share its priority ordering and 24-hour
cooldown instead of racing each other.

- ModalEvaluator gains a declared ModalTrigger (APP_RESUME default so the
  existing four evaluators are unchanged; NTP_RENDER is new).
- Coordinator filters evaluators by trigger: process onResume drives
  APP_RESUME; the new NewTabPageModalTrigger.onNewTabPageShown() drives
  NTP_RENDER.
- Privacy Pro (APP_RESUME) and Add Widget (NTP_RENDER) become ModalEvaluators
  that render via NewTabPageModalPresenter, which the visible tab's
  BrowserTabViewModel implements and registers while visible, reusing the
  existing CTA bottom-sheet path (pixels and dismiss handling unchanged).
- Eligibility for the Privacy Pro promo is extracted into a shared
  SubscriptionPromoModalDecider; the old checkSubscriptionPromoOnForeground
  path and the Add Widget branch of getHomeCta are removed, closing the
  double-prompt window.

Task: https://app.asana.com/1/137249556945/task/1214300205792364

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ API Proposal reminder

This PR changes the public surface of one or more -api modules, but the API Proposals field of the PR description is empty. This is a non-blocking reminder — please double-check whether a proposal is needed.

Changed -api source files:

  • modal-coordinator/modal-coordinator-api/src/main/java/com/duckduckgo/modalcoordinator/api/ModalEvaluator.kt
  • modal-coordinator/modal-coordinator-api/src/main/java/com/duckduckgo/modalcoordinator/api/ModalTrigger.kt
  • modal-coordinator/modal-coordinator-api/src/main/java/com/duckduckgo/modalcoordinator/api/NewTabPageModalTrigger.kt

To clear this reminder, edit the PR description and either:

  • add the approved API Proposal link(s) in the API Proposals field (one per line), or
  • write None there if this PR does not change the public API (e.g. KDoc, comments, tests).

See the API Proposals section in .cursor/rules/contributions.mdc for details.

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