Skip to content

Include Duck ai in subscription settings #6200

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

Merged

Conversation

cmonfortep
Copy link
Contributor

@cmonfortep cmonfortep commented Jun 10, 2025

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

Description

Includes information about Duck.ai inside subscriptions (for subscribers and not subscribers)

Steps to test this PR

Feature 1

  • Apply staging patch
  • Install version
  • Go to settings
  • Ensure duck ai listed in subscription information

Feature 2

  • purchase subscription
  • when back into settings
  • Ensure duck ai listed as product

Feature 3

  • Go to feature flags, disable duckAiPlus (both)
  • Go back to settings
  • Ensure duck ai is not listed as product
  • remove subscription
  • Ensure duck ai not listed subscription information

Feature 4

  • remove staging patch
  • fresh install (resets feature flags)
  • repeat test case 1 and 2, ensure duck ai never listed

UI changes

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

@cmonfortep
Copy link
Contributor Author

cmonfortep commented Jun 10, 2025

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

@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/show_duck_ai_pro_settings branch from 5a4c8f7 to b6d08dd Compare June 10, 2025 08:53
@cmonfortep cmonfortep requested a review from lmac012 June 10, 2025 08:55
@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/show_duck_ai_pro_settings branch 2 times, most recently from 7f7e46f to 64d6881 Compare June 12, 2025 14:14
@cmonfortep cmonfortep mentioned this pull request Jun 12, 2025
32 tasks
Copy link
Contributor

@lmac012 lmac012 left a comment

Choose a reason for hiding this comment

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

I left a few nits, but this looks good overall and works as expected 👍

val subscriptionStatus = subscriptions.getSubscriptionStatus()
val state = getDuckAiProState(hasValidEntitlement, subscriptionStatus)
_viewState.update { it.copy(settingState = state) }
}.launchIn(viewModelScope)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is already running inside a coroutine tied to the viewModelScope, so we could avoid launching another coroutine and just call .collect {} instead of .onEach {}.launchIn(viewModelScope)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With .collect {} the coroutine will suspend and any code added after that will not run. I think that's something people can miss. You are right with launchIn it launches another coroutine, while the parent one completes after that. I don't think that's something bad or we need that optimization. Unless I miss something else, I prefer to keep it like this.

@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/show_duck_ai_pro_settings branch from 64d6881 to b8b75f2 Compare June 19, 2025 09:49
@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/show_duck_ai_pro_settings branch from b8b75f2 to d412f95 Compare June 19, 2025 15:54
@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/show_duck_ai_pro_settings branch 2 times, most recently from 1a42fd5 to 9a53001 Compare July 4, 2025 09:42
@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/show_duck_ai_pro_settings branch 2 times, most recently from f3f9d77 to 2c15ec1 Compare July 9, 2025 13:35
@cmonfortep cmonfortep mentioned this pull request Jul 9, 2025
16 tasks
@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/show_duck_ai_pro_settings branch 2 times, most recently from ac3bffa to 030ec23 Compare July 14, 2025 07:13
@cmonfortep cmonfortep requested a review from malmstein as a code owner July 14, 2025 07:28
@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/show_duck_ai_pro_settings branch from 7b6d60a to 941067a Compare July 14, 2025 16:22
@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/show_duck_ai_pro_settings branch from 1b3df67 to 8af6f45 Compare July 15, 2025 10:38
Task/Issue URL:
https://app.asana.com/1/137249556945/task/1210461583262416?focus=true

Adds integration between duck.ai and subscriptions.
Includes:
- messaging for Feature Flags in FE
- share token
- navigational events

_Feature 1_
- [x] Apply patch from
https://app.asana.com/1/137249556945/project/1149059203486286/task/1210461583262416?focus=true
- [x] Fresh install
- [x] Install branch
- [x] Open Duck.ai, if onboarding shows, skip it
- [x] After onboarding, Duck.ai should be displayed as Free (Background
logo just says "Duck.ai Free", models selector only display free models
and no upsells)
- [ ] ~Go to models selector, you should see the advance models~
- [ ] ~If you select one, the upsell appears "Unlock with a
DuckDuckGo...."~
- [ ] ~Clicking on the upsell takes you to subscription flow~
- [ ] ~Ensure it does, and go back to chat~
- [ ] ~Click on Duck.ai settings (top right)~
- [ ] ~The options "Subscribe to DuckDuckGo" and "I have a subscription"
appear~
- [ ] ~Click on "I have a Subscription"~
- [ ] ~Ensure it navigate to activation flow~
- [ ] ~Go back to Duck.ai~
- [x] go to settings, and purchase a subscription (or go there using any
upsell link)
(after subscription restart the app, this is to avoid Duck.ai chat being
restored, something we need to fix in
https://app.asana.com/1/137249556945/project/1149059203486286/task/1210671370392466?focus=true)
- [x] Open Duck.ai again (from any entry point)
- [x] An Duck.ai paid onboarding appears (depending if this is your
first visit as subscriber)
- [x] Duck.ai is in subscriber mode (background logo has changed
"Subscriber" and model selector includes advanced models)
- [x] Inside Duck.ai settings now it shows "manage", and if you click
there you can navigate to subscription settings

| Before  | After |
| ------ | ----- |
!(Upload before screenshot)|(Upload after screenshot)|
Task/Issue URL:
https://app.asana.com/1/137249556945/task/1210461583262423?focus=true

### Description
We are adding new categories and subcategories to feedback flows to
subscribers.
From settings -> feedback / settings -> subscriptions -> feedback: user
is able to select new duck.ai category and subcategories.
Pixels and BE request are triggered at the end of the flow.

### Steps to test this PR

First apply subscription staging patch.

_No subscription_
- [x] Go to settings -> send feedback
- [x]  Ensure no subscription categories are shown

_Settings feedback with Subscription_
- [x] Purchase a subscription
- [x] Go to settings -> send feedback
- [x] Select privacy pro
- [x] Select Report a problem
- [x] Ensure duck.ai appears as category, select it (ensure pixel
triggers with category duck.ai)
- [x] Ensure 3 sub-categories appear
- [x] Select any (and ensure pixel triggers with subcategory selected)
- [x] Ensure feedback form screen appears
- [x] Fill the form and send feedback
- [x] Ensure pixel triggers
- [x] Ensure BE triggers (and Toast message success)

_Subscription Settings feedback with Subscription_
- [x] Purchase a subscription (if you don't have it)
- [x] Go to settings -> Subscription Settings -> send feedback
- [x] Select Report a problem
- [x] Ensure duck.ai appears as category, select it (ensure pixel
triggers with category duck.ai)
- [x] Ensure 3 sub-categories appear
- [x] Select any (and ensure pixel triggers with subcategory selected)
- [x] Ensure feedback form screen appears
- [x] Fill the form and send feedback
- [x] Ensure pixel triggers
- [x] Ensure BE triggers (and Toast message success)

_Feedback with Subscription (feature flag disabled)_
- [x] Go to FF inventory, disable "Privacy Pro -> duckAiPlus"
- [x] Purchase a subscription (if you don't have it)
- [x] Go to settings -> send feedback
- [x] Select Report a problem
- [x] Ensure duck.ai DOES NOT appear as category
- [x] Go to settings -> send feedback
- [x] Select privacy pro
- [x] Select Report a problem
- [x] Ensure duck.ai DOES NOT appear as category



### UI changes
| Before  | After |
| ------ | ----- |
!(Upload before screenshot)|(Upload after screenshot)|
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_
- [x] apply patch attached in the Asana task (that will target staging
and specific FE sandbox)
- [x] install the branch
- [x] Ensure you don't have a subscription
- [x] Start purchase a subscription
- [x] In the landing page, scroll to the bottom.
- [x] Ensure Duck.ai appears in the comparison chart.
- [x] Purchase a subscription
- [x] After purchase, welcome page should list Duck.ai as a card
- [x] Click on the Card
- [x] Ensure pixel `m_privacy-pro_welcome_paid-ai-chat_click` emits
- [x] 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_
- [x] Go to feature flags and disable privacypro - duckAiPlus
- [x] Cancel and delete your subscription
- [x] Repeat the process again
- [x] Ensure in Landing page comparison chart, Duck.ai doesn't show.
- [x] Ensure when subscription is purchased, there's no Duck.ai card

_Feature 3_
- [x] Remove all files changed in previous patch
- [x] Apply standard patch from
https://app.asana.com/1/137249556945/project/1209991789468715/task/1210448620621729?focus=true
(no FE sandbox)
- [x] install the branch
- [x] Ensure you don't have a subscription
- [x] Purchase a subscription
- [x] ensure purchase succeeds
- [x] ensure no duck.ai is present


### UI changes
| Before  | After |
| ------ | ----- |
!(Upload before screenshot)|(Upload after screenshot)|
cmonfortep and others added 3 commits July 21, 2025 16:11
Task/Issue URL:
https://app.asana.com/1/137249556945/project/72649045549333/task/1210450968200755?focus=true

### Description
Adds duck.ai subscriber settings

### Steps to test this PR

_Feature 1_
- [x] Apply staging patch (any patch)
- [x] Purchase a subscription
- [x] In settings, subscription section, Duck.ai is listed
- [x] Click on duck.ai
- [x] Ensure you navigate to duck.ai setting screen
- [x] Ensure pixel `m_privacy-pro_settings_paid-ai-chat_impression` sent
- [x] click on learn more
- [x] Ensure it navigates (url will fix later)
- [x] go back
- [x] Click on Open Duck.ai
- [x] Ensure opens Duck.ai
- [x] ensure pixel `m_privacy-pro_settings_paid-ai-chat_click` sent
- [x] Go to settings and cancel your subscription
- [x] Wait until expires
- [x] When expired, ensure is listed in disabled state
- [x] Clicking on the option does not open the screen

### UI changes
| Before  | After |
| ------ | ----- |
!(Upload before screenshot)|(Upload after screenshot)|
Task/Issue URL:
https://app.asana.com/1/137249556945/project/1149059203486286/task/1210704593867822?focus=true

### Description
Updates copies/icons/visuals to integrate with duck.ai changes

### Steps to test this PR

_Feature 1_
- [x] Apply latest staging patch from this task
https://app.asana.com/1/137249556945/project/1209991789468715/task/1210448620621729?focus=true
- [x] Fresh install
- [x] Go to settings
- [x] In the subscription section validate the copies are the ones in
"NEW" column in
https://app.asana.com/1/137249556945/project/1149059203486286/task/1210704593867822?focus=true
- [x] Purchase the subscription
- [x] Ensure "New" pill appears in Duck.ai
- [x] Go to settings -> send feedback
- [x] Ensure we say "subscription" according to
https://app.asana.com/1/137249556945/project/1149059203486286/task/1210704593867822?focus=true
(last table)

_Feature 2_
- [x] Cancel and remove your subscription
- [x] Go to Feature flags inventory
- [x] Disable privacypro - duckaiplus
- [x] Go to the browser
- [x] Access settings again (you need to enter so it re-evaluates the
FF)
- [x] Ensure you don't see ai models in the subscription section
(description field)
- [x] The title mentions privacy pro

_Feature 3_
- [x] Cancel and remove your subscription (if any)
- [x] Go to Feature flags inventory
- [x] Disable privacypro - subscriptionRebranding
- [x] Restart the browser (we need to restart the process since value is
cached)
- [x] Navigate to settings
- [x] Ensure you see privacy pro copies

### UI changes
| Before  | After |
| ------ | ----- |
!(Upload before screenshot)|(Upload after screenshot)|
Task/Issue URL:
https://app.asana.com/1/137249556945/project/72649045549333/task/1210792264853564?focus=true

### Description
Translations for subscriptions copy changes

### Steps to test this PR
N/a

### UI changes
| Before  | After |
| ------ | ----- |
!(Upload before screenshot)|(Upload after screenshot)|

---------

Co-authored-by: Dax The Translator <[email protected]>
@cmonfortep cmonfortep force-pushed the feature/cristian/subscriptions/show_duck_ai_pro_settings branch from 8af6f45 to 99866d2 Compare July 21, 2025 14:14
Task/Issue URL:
https://app.asana.com/1/137249556945/project/1149059203486286/task/1210671370392466?focus=true

### Description
Signals FE to refresh Duck.ai when subscription state changes

### Steps to test this PR

_Feature 1_
- [x] apply patch attached into task
- [x] Fresh install
- [x] Visit https://euw-serp-dev-testing10.duck.co/ on a normal tab and
log in
- [x] Now open duck.ai (you shouldn't be asked to login now)
- [x] Ensure you are in free mode 
- [x] From there, find a subscription upsell (e.g: open models selector
and pick an advanced model, or inside duck.ai settings -> purchase)
- [x] Finish the purchase
- [x] Go back to duck.ai, it should be "subscriber mode" now

### UI changes
| Before  | After |
| ------ | ----- |
!(Upload before screenshot)|(Upload after screenshot)|
@cmonfortep cmonfortep merged commit 3eb86e7 into develop Jul 22, 2025
8 checks passed
@cmonfortep cmonfortep deleted the feature/cristian/subscriptions/show_duck_ai_pro_settings branch July 22, 2025 11:27
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.

3 participants