Skip to content

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

Open
catalinradoiu wants to merge 36 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 36 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
Touches reinstall onboarding UX, default-browser prompts, widget pinning, and settings persistence; survey gating is a small behavioral change with clear tests.

Overview
This PR completes the reinstaller quick-setup flow in brand-design onboarding: default-browser and home-screen widget switches are wired to system UI, switch state stays aligned with reality, and Start Browsing saves address-bar and search/AI choices.

Quick setup behavior: Toggling default browser shows the role-manager dialog once, then opens system default-app settings; a separate activity result code avoids mixing with the comparison-chart flow. The widget switch launches the pin prompt when on, and a new remove-widget instructions bottom sheet when off; QuickSetupSwitchRow.setCheckedSilently prevents feedback loops when syncing. On resume, switches reflect DefaultBrowserDetector and WidgetCapabilities; rows for default browser / widget are hidden at QUICK_SETUP entry if already satisfied so layout does not jump during ChangeBounds. Start Browsing applies omnibar type and input-screen settings via shared helpers (telemetry suppressed on this path for a follow-up).

Other: Default-browser-changed survey modal evaluation skips until onboarding is complete. Onboarding theming adds quickSetupStepNumberText; bottom sheets get padding/surface tweaks and new copy/assets for remove-widget steps. ViewModel tests cover the new commands and persistence.

Reviewed by Cursor Bugbot for commit c153f48. 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
@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
@catalinradoiu catalinradoiu force-pushed the feature/cradoiu/quick-setup-handle-default-browser-and-widget branch from a52ef1a to d3a3c65 Compare May 25, 2026 12:23
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 3825e65. Configure here.

Comment thread app/src/main/res/layout/bottom_sheet_remove_widget_instructions.xml
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