Skip to content

Update subscription flow welcome page #6260

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

Open
wants to merge 1 commit into
base: feature/cristian/subscriptions/show_duck_ai_pro_settings
Choose a base branch
from

Conversation

cmonfortep
Copy link
Contributor

@cmonfortep cmonfortep commented Jun 19, 2025

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

Description

Updates JS messaging in subscription flows welcome pages.

Touched methods:

  • Adds getAuthAccessToken
  • Adds getFeatureConfig
  • Adds Duck.ai support in featureSelected

Feature flagging:

  • privacyProFeature.subscriptionMessaging() -> enables getFeatureConfig
  • privacyProFeature.duckAiPlus() -> signales FE Duck.ai is enabled
  • Token is not affected by FF

Steps to test this PR

Feature 1

  • apply patch attached in the Asana task (that will target staging and specific FE sandbox)
  • install the branch
  • Ensure you don't have a subscription
  • Start purchase a subscription
  • In the landing page, scroll to the bottom.
  • Ensure Duck.ai appears in the comparison chart.
  • Purchase a subscription
  • After purchase, welcome page should list Duck.ai as a card
  • Click on the Card
  • Ensure pixel m_privacy-pro_welcome_paid-ai-chat_click emits
  • Ensure you navigate to Duck chat (this branch doesn't have the code to signal the token so you won't see the subscriber mode)

Feature 2

  • Go to feature flags and disable privacypro - duckAiPlus
  • Cancel and delete your subscription
  • Repeat the process again
  • Ensure in Landing page comparison chart, Duck.ai doesn't show.
  • Ensure when subscription is purchased, there's no Duck.ai card

Feature 3

UI changes

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

@cmonfortep
Copy link
Contributor Author

cmonfortep commented Jun 19, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/support_navigate_duckai_post_subscription_FE branch from 5b661fe to 5c2085c Compare June 19, 2025 15:34
@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/update_feedback_flow branch from 51200d7 to 3d70b4e Compare June 19, 2025 15:54
@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/support_navigate_duckai_post_subscription_FE branch from 5c2085c to e67d09d Compare June 19, 2025 15:54
@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/support_navigate_duckai_post_subscription_FE branch from e67d09d to f4f1ba0 Compare July 2, 2025 15:02
@cmonfortep cmonfortep changed the base branch from feature/cristian/subscriptions/update_feedback_flow to feature/cristian/subscriptions/show_duck_ai_pro_settings July 2, 2025 15:02
@cmonfortep cmonfortep requested a review from Copilot July 2, 2025 15:06
@cmonfortep cmonfortep changed the title Capture feature selected on subscription flow welcome page Update subscription flow welcome page Jul 2, 2025
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

Adds support for capturing and acting on a new “Duck AI” feature selection during the subscription welcome flow, including pixel reporting, ViewModel/Activity handling, and JS messaging extensions.

  • Introduces a DUCK_AI constant and corresponding pixel event for onboarding clicks.
  • Extends SubscriptionWebViewViewModel and SubscriptionsWebViewActivity to emit and handle a new GoToDuckAI command using DuckChat.
  • Adds two new JS message handlers (getAuthAccessToken and getFeatureConfig) and feature toggles (duckAiPlus, subscriptionMessagingV2).

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
subscriptions-impl/src/test/java/com/duckduckgo/subscriptions/impl/ui/SubscriptionWebViewViewModelTest.kt Tests for GoToDuckAI command emission and pixel reporting
subscriptions-impl/src/main/java/com/duckduckgo/subscriptions/impl/ui/SubscriptionsWebViewActivity.kt Injects DuckChat, handles GoToDuckAI by calling openDuckChat()
subscriptions-impl/src/main/java/com/duckduckgo/subscriptions/impl/ui/SubscriptionWebViewViewModel.kt Maps DUCK_AI to GoToDuckAI and dispatches onboarding Duck AI pixel
subscriptions-impl/src/main/java/com/duckduckgo/subscriptions/impl/pixels/SubscriptionPixelSender.kt Adds reportOnboardingDuckAiClick() to interface and implementation
subscriptions-impl/src/main/java/com/duckduckgo/subscriptions/impl/pixels/SubscriptionPixel.kt Defines ONBOARDING_DUCK_AI_CLICK pixel entry
subscriptions-impl/src/main/java/com/duckduckgo/subscriptions/impl/messaging/SubscriptionMessagingInterface.kt Adds GetAuthAccessTokenMessage & GetFeatureConfigMessage handlers and imports PrivacyProFeature
subscriptions-impl/src/main/java/com/duckduckgo/subscriptions/impl/SubscriptionsConstants.kt Defines DUCK_AI constant
subscriptions-impl/src/main/java/com/duckduckgo/subscriptions/impl/RealSubscriptions.kt Introduces duckAiPlus() and subscriptionMessagingV2() toggles
subscriptions-impl/build.gradle Adds dependency on :duckchat-api
Comments suppressed due to low confidence (1)

subscriptions/subscriptions-impl/src/main/java/com/duckduckgo/subscriptions/impl/messaging/SubscriptionMessagingInterface.kt:319

  • No unit tests cover the new GetAuthAccessTokenMessage and GetFeatureConfigMessage handlers. Consider adding tests to verify both the success and failure JSON responses for these methods.
    private inner class GetAuthAccessTokenMessage(

@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/support_navigate_duckai_post_subscription_FE branch from f4f1ba0 to ce12760 Compare July 2, 2025 15:17
@cmonfortep cmonfortep marked this pull request as ready for review July 2, 2025 15:26
@cmonfortep cmonfortep requested a review from lmac012 July 2, 2025 15:26
@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/support_navigate_duckai_post_subscription_FE branch from ce12760 to e2d9848 Compare July 2, 2025 15:57
@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/show_duck_ai_pro_settings branch from 1a42fd5 to 9a53001 Compare July 4, 2025 09:42
@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/support_navigate_duckai_post_subscription_FE branch from e2d9848 to bb2959d Compare July 4, 2025 09:42
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