Skip to content

Wire set-default and add-widget switches in quick setup in the brand design onboarding #8626

Open
catalinradoiu wants to merge 30 commits into
developfrom
feature/cradoiu/quick-setup-handle-default-browser-and-widget
Open

Wire set-default and add-widget switches in quick setup in the brand design onboarding #8626
catalinradoiu wants to merge 30 commits into
developfrom
feature/cradoiu/quick-setup-handle-default-browser-and-widget

Conversation

@catalinradoiu
Copy link
Copy Markdown
Contributor

@catalinradoiu catalinradoiu commented May 19, 2026

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

Description

Wires up the "Set DuckDuckGo as default" and "Add home screen widget" switches in the reinstaller quick-setup screen, and persists the user's quick-setup selections on "Start Browsing".

Default browser switch

  • First tap on the screen launches the system role-manager dialog. Subsequent taps (and toggling off) open the system default-apps settings.
  • Switch state syncs with the actual default-browser status on resume and on activity result, so the UI never drifts from reality.
  • onActivityResult uses a distinct request code for the quick-setup flow so the legacy comparison-chart handlers aren't reused.

Add widget switch

  • Toggling on launches the system pin-widget prompt.
  • Toggling off opens a new "How to remove the home screen widget" bottom sheet with instructions; switch state syncs on resume via widgetCapabilities.hasInstalledWidgets.

Row visibility

  • Both rows are hidden when entering the quick-setup screen if DDG is already the default browser / a DDG widget is already installed. Computed once at entry (not on resume), so the screen layout doesn't shuffle while the user is on it.
  • Visibility is applied before ChangeBounds/measure so the dialog animates to the correct final size.

Start Browsing persistence

  • Tapping the primary CTA now persists the user's selections from the address-bar-position and search-options bottom sheets: settingsDataStore.omnibarType, duckChat.setCosmeticInputScreenUserSetting, onboardingStore.storeInputScreenSelection.

Telemetry

  • Pixels and wide events from the quick-setup path are intentionally suppressed for now (fireTelemetry = false). Quick-setup-specific pixels will land in a follow-up branch.

Steps to test this PR

Setup

  • Setup JSON patch to get enrolled in the experiment. Create local-config-patches folder inside privacy config internal. Create this quick-setup-patch.json in that folder and add:
    [ { "op": "add", "path": "/features/onboardingQuickSetup", "value": { "state": "enabled", "features": { "onboardingQuickSetupExperimentMay26": { "state": "enabled", "cohorts": [ { "name": "control", "weight": 0 }, { "name": "treatment", "weight": 1 } ] } } } } ]
  • Create local.properties in privacy config internal and add this line there config_patches=privacy-config/privacy-config-internal/local-config-patches/quick-setup-patch.json
  • Reinstall the app and launch onboarding as a reinstall user and click "I've been here before"

Default browser switch

  • Reach the quick-setup screen (reinstall user + treatment cohort).
  • Tap the default-browser switch; the system role-manager dialog appears.
  • Accept; the switch stays on. Re-tap; system default-apps settings opens.
  • Toggle the switch off; system default-apps settings opens. Unset DDG → return; switch is off. Don't change → return; switch reverts to on.

Add widget switch

  • Tap the add-widget switch; the system pin-widget prompt appears.
  • Accept; the switch stays on (widget appears on home screen).
  • Toggle the switch off; the "How to remove the home screen widget" bottom sheet appears.
  • Dismiss with Done / X / back / swipe and verify the switch reverts to on (widget is still installed).
  • Background the app, remove the widget from the home screen, return; switch is off.

Row visibility

  • Make DDG default before entering the screen → the default-browser row is hidden when QUICK_SETUP loads.
  • Add a DDG widget before entering the screen → the add-widget row is hidden when QUICK_SETUP loads.
  • Verify the dialog measures/animates to the correct height with rows hidden (no flash of full layout).

Start Browsing persistence

  • Pick a non-default address-bar position and search-options selection via the edit bottom sheets.
  • Tap Start Browsing.
  • Reopen the app; verify settingsDataStore.omnibarType reflects the selection and the input-screen setting is applied.

UI changes

Check parent task


Note

Medium Risk
Modifies onboarding quick-setup flow to launch system intents and persist user selections; main risk is UI/state drift around activity results/resume and device-specific settings/widget behaviors.

Overview
Adds functional wiring for the reinstaller Quick Setup switches in brand-design onboarding: the default-browser toggle now launches the role-manager dialog once, then falls back to default-app system settings, and the widget toggle launches the add-widget prompt or shows a new remove-widget instructions bottom sheet.

Quick-setup now syncs switch state on resume/activity result, can hide rows when the device is already configured (default browser / widget installed), and persists selected address-bar position + input-screen preference when tapping Start Browsing (telemetry from quick-setup path is intentionally suppressed). Also gates the default-browser-changed survey to only run after onboarding completes, and includes small theming/layout tweaks (new quickSetupStepNumberText, bottom-sheet padding/dimens, switch-row behavior).

Reviewed by Cursor Bugbot for commit 30a67b2. Bugbot is set up for automated code reviews on this repo. Configure here.

catalinradoiu and others added 15 commits May 15, 2026 16:32
# Conflicts:
#	app/src/main/res/values/donottranslate.xml
Tapping the "Set DuckDuckGo as default" switch opens the system
role-manager dialog the first time on the screen, then the system
default-apps settings on subsequent taps and on toggle-off. Tapping
"Add home screen widget" launches the system pin-widget prompt;
toggling it off shows an instructions bottom sheet explaining how to
remove the widget. Both switches sync back to the actual state on
resume and on activity result so the UI never drifts from reality.

The two switch rows are hidden when entering the screen if DDG is
already the default browser / a DDG widget is already installed,
so the screen only surfaces actions the user can still take.

Tapping Start Browsing now persists the user's address bar position
and input screen selections (settingsDataStore.omnibarType, duckChat,
onboardingStore) so the choices made via the bottom sheets actually
apply. Telemetry from the quick-setup path is suppressed for now —
quick-setup-specific pixels will land in a follow-up branch.

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

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds DefaultBrowserDetector and WidgetCapabilities to the test
constructor (the file no longer compiled against the updated VM)
and covers the new behavior:

- onQuickSetupSetAsDefaultClicked: first-time dialog, second-time
  system settings, null intent fallback, retry after null intent
- onQuickSetupSetAsDefaultUnchecked always opens system settings
- onQuickSetupDefaultBrowser{Set,NotSet} record the result and do
  not advance the dialog
- checkDefaultBrowserState and checkWidgetAddedState emit symmetric
  Sync*Switch commands
- onQuickSetupAdd/RemoveHomescreenWidgetClicked emit the matching
  commands
- QUICK_SETUP entry sets hideSetDefaultBrowserRow / hideAddWidgetRow
  from the detector and widget-capabilities results
- QUICK_SETUP primary CTA persists omnibarType, duckChat, and
  onboardingStore selections

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

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor Author

catalinradoiu commented May 19, 2026

@catalinradoiu catalinradoiu changed the title Create the bottom sheet for removing widget instructions Wire set-default and add-widget switches in quick setup [WIP] May 19, 2026
@catalinradoiu catalinradoiu changed the title Wire set-default and add-widget switches in quick setup [WIP] [WIP] Wire set-default and add-widget switches in quick setup May 19, 2026
…nto feature/cradoiu/quick-setup-handle-default-browser-and-widget

# Conflicts:
#	app/src/main/res/values/donottranslate.xml
@catalinradoiu catalinradoiu changed the title [WIP] Wire set-default and add-widget switches in quick setup Wire set-default and add-widget switches in quick setup in the brand design onboarding May 20, 2026
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.

Fix All in Cursor

❌ 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 f43afcf. Configure here.

@catalinradoiu catalinradoiu requested a review from LukasPaczos May 21, 2026 13:45
Base automatically changed from feature/cradoiu/quick-setup-bottom-sheets to develop May 25, 2026 11:51
…t-browser-and-widget

# Conflicts:
#	app/src/main/java/com/duckduckgo/app/onboarding/ui/page/BrandDesignUpdatePageViewModel.kt
#	app/src/main/java/com/duckduckgo/app/onboarding/ui/page/BrandDesignUpdateWelcomePage.kt
#	app/src/main/res/drawable/rounded_top_corners_onboarding_bottom_sheet_drawable.xml
#	app/src/main/res/layout/bottom_sheet_quick_setup_address_bar_position.xml
#	app/src/main/res/layout/bottom_sheet_quick_setup_search_options.xml
#	app/src/main/res/values/dimens.xml
#	app/src/main/res/values/donottranslate.xml
#	app/src/test/java/com/duckduckgo/app/onboarding/ui/page/BrandDesignUpdatePageViewModelTest.kt
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