Skip to content

Enable Toggle by default if user skips onboarding#7863

Merged
malmstein merged 2 commits intodevelopfrom
feature/david/03-04-enable_toggle_by_default_if_user_skips_onboarding
Mar 6, 2026
Merged

Enable Toggle by default if user skips onboarding#7863
malmstein merged 2 commits intodevelopfrom
feature/david/03-04-enable_toggle_by_default_if_user_skips_onboarding

Conversation

@malmstein
Copy link
Copy Markdown
Contributor

@malmstein malmstein commented Mar 4, 2026

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

Description

Enables the toggle experience for users who skip onboarding

Steps to test this PR

Toggle enabled

  • Fresh install
  • Skip Onboarding -> I’ve been here before + Start Browsing
  • Verify Toggle is enabled

Toggle disabled

  • Fresh install
  • Go through onboarding
  • Don’t select the toggle
  • Verify Toggle is disabled

Note

Low Risk
Low risk behavior change limited to the skip-onboarding path, setting a single DuckChat preference and adding a unit test to prevent regressions.

Overview
Users who choose Skip onboarding now have the DuckChat input screen explicitly enabled by default via duckChat.setInputScreenUserSetting(true) when confirming the skip.

Adds a focused unit test in WelcomePageViewModelTest to assert the preference is set when the skip flow primary CTA is clicked.

Written by Cursor Bugbot for commit add16ae. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown
Contributor Author

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

@malmstein malmstein marked this pull request as ready for review March 4, 2026 15:08
Copy link
Copy Markdown
Contributor

@joshliebe joshliebe left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@malmstein malmstein force-pushed the feature/david/03-04-enable_toggle_by_default_if_user_skips_onboarding branch from 6eee63b to add16ae Compare March 4, 2026 20:17
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.

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Setting persisted after navigation command risks cancellation
    • Moved duckChat.setInputScreenUserSetting(true) before _commands.send(OnboardingSkipped) so the setting is persisted before the navigation command can trigger ViewModel cancellation, matching the pattern used in the INPUT_SCREEN handler.

Create PR

Or push these changes by commenting:

@cursor push c90b97ea55
Preview (c90b97ea55)
diff --git a/app/src/main/java/com/duckduckgo/app/onboarding/ui/page/WelcomePageViewModel.kt b/app/src/main/java/com/duckduckgo/app/onboarding/ui/page/WelcomePageViewModel.kt
--- a/app/src/main/java/com/duckduckgo/app/onboarding/ui/page/WelcomePageViewModel.kt
+++ b/app/src/main/java/com/duckduckgo/app/onboarding/ui/page/WelcomePageViewModel.kt
@@ -177,9 +177,9 @@
 
             SKIP_ONBOARDING_OPTION -> {
                 viewModelScope.launch {
+                    duckChat.setInputScreenUserSetting(true)
+                    pixel.fire(PREONBOARDING_CONFIRM_SKIP_ONBOARDING_PRESSED)
                     _commands.send(OnboardingSkipped)
-                    pixel.fire(PREONBOARDING_CONFIRM_SKIP_ONBOARDING_PRESSED)
-                    duckChat.setInputScreenUserSetting(true)
                 }
             }

viewModelScope.launch {
_commands.send(OnboardingSkipped)
pixel.fire(PREONBOARDING_CONFIRM_SKIP_ONBOARDING_PRESSED)
duckChat.setInputScreenUserSetting(true)
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.

Setting persisted after navigation command risks cancellation

Medium Severity

duckChat.setInputScreenUserSetting(true) is called after _commands.send(OnboardingSkipped). Since setInputScreenUserSetting is a suspend function, it yields the main thread when switching to IO, allowing the UI to process OnboardingSkipped and potentially cancel viewModelScope before the write completes. The INPUT_SCREEN handler correctly persists data before sending Finish. The same ordering pattern would be safer here — call setInputScreenUserSetting(true) before _commands.send(OnboardingSkipped).


Please tell me if this was useful or not with a 👍 or 👎.

Additional Locations (1)

Fix in Cursor Fix in Web

@malmstein malmstein merged commit ab1d05d into develop Mar 6, 2026
15 checks passed
@malmstein malmstein deleted the feature/david/03-04-enable_toggle_by_default_if_user_skips_onboarding branch March 6, 2026 19:51
aitorvs pushed a commit that referenced this pull request Mar 12, 2026
Task/Issue URL:
https://app.asana.com/1/137249556945/project/1211654189969294/task/1213539375189609?focus=true

### Description
Enables the toggle experience for users who skip onboarding

### Steps to test this PR

_Toggle enabled_
- [x] Fresh install
- [x] Skip Onboarding -> I’ve been here before + Start Browsing
- [x] Verify Toggle is enabled

_Toggle disabled_
- [x] Fresh install
- [x] Go through onboarding
- [x] Don’t select the toggle
- [x] Verify Toggle is disabled

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk behavior change limited to the skip-onboarding path, setting
a single DuckChat preference and adding a unit test to prevent
regressions.
> 
> **Overview**
> Users who choose **Skip onboarding** now have the DuckChat input
screen explicitly enabled by default via
`duckChat.setInputScreenUserSetting(true)` when confirming the skip.
> 
> Adds a focused unit test in `WelcomePageViewModelTest` to assert the
preference is set when the skip flow primary CTA is clicked.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
add16ae. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

2 participants