Skip to content

Show import promo in autofill management #6266

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 20, 2025

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

Description

Includes:

  • logic to show or not import promo in autofill management list
  • store boolean if user has ever imported passwords (to avoid other prompts)
  • heuristics around messaging
  • remote FF
  • support animation in message cta

Steps to test this PR

Showing the promo

  • fresh install
  • Go to passwords list
  • You should not see any promo
  • Add one credential
  • You should see a promo now (with the animated logo)
  • you should see autofill_import_google_passwords_import_button_shown with source = passwords_management_promo
  • Click Open Passwords
  • you should see pixel autofill_import_google_passwords_import_button_tapped_android_phone with source = passwords_management_promo
  • Enter the flow but leave it without completion
  • Go back to the list
  • Ensure promo is there

Dismiss

  • Dismiss the promo
  • Ensure promo goes away
  • Ensure next promo shows up
  • Leave enter the screen
  • No more import promos

Complete import
(To test this better go to RealImportInPasswordsVisibility change MAX_PASSWORDS_TO_SHOW_PROMO to 5k , just a random big number. This is so we make sure we hide the promo because import happened, and not because number of passwords is >25)

  • fresh install
  • Go to passwords list
  • You should not see any promo
  • Add one credential
  • You should see a promo now
  • Import your passwords
  • When it completes, promo is gone

Complete import (different entry point)
(Keep the hardcoded value)

  • fresh install
  • Go to passwords list
  • You should not see any promo
  • Add one credential
  • You should see a promo now
  • From the overflow menu, import your passwords from google
  • Complete the import
  • When it completes, promo should be gone

max 25 passwords
(Remove any hardcoded values)

  • fresh install
  • add more than 25 passwords
  • go to passwords list
  • you should not see the import promo

FF disabled
(Remove any hardcoded values)

  • fresh install
  • go to FF inventory and disable canPromoteImportPasswords
  • go to passwords list
  • add 1 password
  • you should not see the import promo

UI changes

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

@cmonfortep cmonfortep force-pushed the feature/cristian/autofill/promo_import_in_management branch from eab8cdc to f64372f Compare June 20, 2025 13:20
@cmonfortep cmonfortep marked this pull request as ready for review June 20, 2025 13:35
@cmonfortep cmonfortep requested a review from CDRussell June 20, 2025 13:35
@cmonfortep cmonfortep force-pushed the feature/cristian/autofill/promo_import_in_management branch from f64372f to f0558c4 Compare June 20, 2025 13:36
@CDRussell CDRussell requested a review from Copilot June 23, 2025 09:19
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds promotional functionality to the autofill management UI by showing or hiding a promo for importing passwords, along with the related business logic and test updates. Key changes include introducing a Lottie animation view in the message CTA, updating pixel tracking parameters and import launch source references, and implementing the logic and tests for tracking import promo display conditions.

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
common/common-ui/src/main/res/layout/view_remote_message_cta.xml Added LottieAnimationView and adjusted view hierarchy for promo animation.
common/common-ui/src/main/java/com/duckduckgo/common/ui/view/MessageCta.kt Refactored top illustration configuration to incorporate animations.
autofill/* Updated tests, pixel parameter values, and introduced new properties/methods for tracking “hasEverImportedPasswords” and promo dismissal.
autofill-impl/src/main/java/com/duckduckgo/autofill/impl/importing/promo/* Added new classes and view models for managing the import promo visibility and user interactions.
autofill/autofill-impl/build.gradle Added a dependency on the Lottie library.
autofill-api/* Updated the AutofillFeature interface with a new toggle for promoting import passwords.
Comments suppressed due to low confidence (1)

autofill/autofill-impl/src/test/java/com/duckduckgo/autofill/impl/importing/CredentialImporterImplTest.kt:118

  • Verifying property setter calls via assignment (e.g. verify(autofillStore).hasEverImportedPasswords = true) may not be reliably supported by your mocking framework. Consider using an argument captor or directly asserting the state change on the store after the operation.
        verify(autofillStore).hasEverImportedPasswords = true

return canShowImportPasswords
}

companion object {

Choose a reason for hiding this comment

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

Nit: consider making this private, since none of the constants are exposed. This avoids surfacing a public Companion unnecessarily.

@CDRussell CDRussell force-pushed the feature/cristian/autofill/promo_import_in_management branch from f7556c0 to 1347464 Compare June 26, 2025 14:00
Copy link
Contributor

@malmstein malmstein left a comment

Choose a reason for hiding this comment

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

@cmonfortep @CDRussell these changes look good to me from ADS perspective. Just wondering, why not add this functionality to the local message too? Not a blocker, just a question.

@CDRussell CDRussell force-pushed the feature/cristian/autofill/promo_import_in_management branch from 92e9ebd to 75b8e66 Compare July 1, 2025 11:05
Copy link
Member

CDRussell commented Jul 2, 2025

Merge activity

  • Jul 2, 9:09 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 2, 9:09 AM UTC: @CDRussell merged this pull request with Graphite.

@CDRussell CDRussell merged commit 50af46a into develop Jul 2, 2025
7 checks passed
@CDRussell CDRussell deleted the feature/cristian/autofill/promo_import_in_management branch July 2, 2025 09:09
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.

5 participants