Skip to content

Android: Add dismiss option to contextual onboarding #5866

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

anikiki
Copy link
Contributor

@anikiki anikiki commented Apr 4, 2025

Task/Issue URL: https://app.asana.com/0/488551667048375/1209734574040696/f

Description

Added a dismiss button to onboarding context and in-context Dax dialogs. The implementation includes:

  • A new dismiss button in all context and in-context Dax dialogs.
  • A new pixel event ONBOARDING_DAX_CTA_DISMISS_BUTTON to track dismissals
  • Removed the "Skip" button from the "Fire" Dax dialog.

Steps to test this PR

Onboarding DAX Dialogs

  • Install from this branch.
  • Go through the onboarding and verify all context and in-context Dax dialogs show a dismiss button in the top right.
  • Tap the dismiss button and confirm the dialog disappears. Validate against the flow in Figma. Ensure the pixel is sent correctly (cta param and no atb param) .

UI changes (added a dismiss button, removed the skip buttons)

Light Dark
onboarding_dialog_try_a_search onboarding_dialog_try_a_search_dark
Light Dark
onboarding_dialog_ddg_search onboarding_dialog_ddg_search_dark
Light Dark
onboarding_dialog_try_visiting_a_site_in_context onboarding_dialog_try_visiting_a_site_in_context_dark
Light Dark
onboarding_dialog_i_blocked_them onboarding_dialog_i_blocked_them_dark
Light Dark
onboarding_dialog_fire_no_skip onboarding_dialog_fire_no_skip_dark
Light Dark
onboarding_dialog_you_got_this onboarding_dialog_you_got_this_dark
Light Dark
onboarding_dialog_privacy_pro_no_skip onboarding_dialog_privacy_pro_no_skip_dark

Copy link
Contributor Author

anikiki commented Apr 4, 2025

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

@anikiki anikiki marked this pull request as ready for review April 4, 2025 18:45
@anikiki anikiki marked this pull request as draft April 4, 2025 18:45
@anikiki anikiki changed the title Added the option to dismiss context and in-context Dax dialogs. Android: Add dismiss option to contextual onboarding Apr 4, 2025
…longer needed. Removed the use of the skip button in the Privacy Pro CTA. Removed unused test related to removed pixel.

Updated.
@anikiki anikiki force-pushed the feature/ana/android_add_dismiss_option_to_contextual_onboarding branch from 54048f1 to 73e8729 Compare April 7, 2025 14:59
…ed to show the new tab when bubble dismissed.
@anikiki anikiki marked this pull request as ready for review April 8, 2025 11:29
Copy link
Contributor

@nalcalag nalcalag left a comment

Choose a reason for hiding this comment

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

@anikiki this looks great! 💯 I’ve suggested a couple of changes, feel free to correct me if any of my assumptions are off:

  1. When the 'Fire dialog' is dismissed, the expected behavior is to simply close it without showing the 'End dialog'. I’ve pointed out the part of the logic that might need to be removed.
  2. The new pixel should ideally be triggered from the CtaViewModel, in line with how we handle other pixels. This helps keep the code consistent and clean.

Comment on lines 2818 to 2832
fun onUserClickCtaDismissButton(cta: Cta) {
viewModelScope.launch {
onUserDismissedCta(cta)
if (cta is DaxBubbleCta) {
command.value = HideOnboardingDaxBubbleCta(cta)
pixel.fire(ONBOARDING_DAX_CTA_DISMISS_BUTTON, mapOf(PixelParameter.CTA_SHOWN to cta.ctaPixelParam))
} else if (cta is OnboardingDaxDialogCta) {
command.value = HideOnboardingDaxDialog(cta)
pixel.fire(ONBOARDING_DAX_CTA_DISMISS_BUTTON, mapOf(PixelParameter.CTA_SHOWN to cta.ctaPixelParam))
if (cta is OnboardingDaxDialogCta.DaxFireButtonCta) {
val updatedCta = ctaViewModel.getEndStaticDialogCta()
ctaViewState.value = currentCtaViewState().copy(cta = updatedCta)
} else if (cta is OnboardingDaxDialogCta.DaxTrackersBlockedCta) {
ctaViewModel.dismissPulseAnimation()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Pixel firing should be handled on the CtaViewModel. I would follow the same pattern as we already have for shown and ok pixels.

Comment on lines 2828 to 2829
val updatedCta = ctaViewModel.getEndStaticDialogCta()
ctaViewState.value = currentCtaViewState().copy(cta = updatedCta)
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 no longer needed. The expected behavior when a user dismisses the fire dialog is simply to close it and not show the end dialog anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Removed it 👍

Copy link
Contributor

@nalcalag nalcalag left a comment

Choose a reason for hiding this comment

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

Ship it!! 🚀

@anikiki anikiki merged commit f846290 into develop Apr 10, 2025
7 checks passed
@anikiki anikiki deleted the feature/ana/android_add_dismiss_option_to_contextual_onboarding branch April 10, 2025 12:50
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