Skip to content

Don't show preimport dialog when launching from password import promo #6278

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

CDRussell
Copy link
Member

@CDRussell CDRussell commented Jun 23, 2025

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

Description

Skips showing the "preimport" dialog for Google Import Passwords flow if launched from the import promo.

Screenshot 2025-06-23 at 16 28 28

For context, this is the preimport dialog

Steps to test this PR

  • Fresh install
  • Visit password management screen
  • Manually add a password
  • Tap on promo's Open Google Passwords button to import passwords
  • Verify you do not see the "preimport" dialog and that the web flow launches ok
  • Cancel the flow; verify you do not see the preimport dialog and that you do get returned to the password list
  • Tap on promo's Open Google Passwords button again to import passwords
  • Complete the flow; verify that you do see the summary bottom sheet showing how many passwords imported
  • Delete all passwords
  • Tap on the blue Import Passwords From Google button
  • Verify that you do see the "preimport" dialog

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

Implements a flag to skip the introductory import prompt when launching from a promo, and updates the dialog, its ViewModel, call sites, and tests to support a “determining first view” state.

  • Introduce showInitialInstructionalPrompt parameter in ImportFromGooglePasswordsDialog and pass it through ViewModel commands
  • Add DeterminingFirstView and FlowTerminated states, update UI logic, and adjust existing tests while adding new ones for initial view
  • Migrate all call sites to use the new LaunchImportGooglePasswords(showImportInstructions: Boolean) command

Reviewed Changes

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

Show a summary per file
File Description
ImportFromGooglePasswordsDialogViewModel.kt Default viewMode to DeterminingFirstView, add shouldShowInitialInstructionalPrompt and FlowTerminated logic
ImportFromGooglePasswordsDialog.kt Add showInitialInstructionalPrompt argument, handle DeterminingFirstView/FlowTerminated, move pixel tracking, adjust dialog lifecycle
AutofillSettingsActivity.kt & ListMode classes Update call sites to pass showInitialInstructionalPrompt into dialog instance
AutofillPasswordsManagementViewModel.kt Rename command, emit LaunchImportGooglePasswords(showImportInstructions) instead of old command
Test files Update imports and assertions for new command, add tests for initial view behavior
Comments suppressed due to low confidence (1)

autofill/autofill-impl/src/test/java/com/duckduckgo/autofill/impl/ui/credential/management/importpassword/google/ImportFromGooglePasswordsDialogViewModelTest.kt:115

  • Add a test verifying that calling onImportFlowCancelledByUser(stage, canShowPreImportDialog = false) transitions the view state to FlowTerminated so that this branch is covered.
    @Test

@CDRussell CDRussell force-pushed the feature/craig/autofill/promo_import_skip_preimport_screen branch from daa0ec7 to 3763867 Compare June 23, 2025 15:32
@CDRussell CDRussell marked this pull request as ready for review June 23, 2025 15:39
@CDRussell CDRussell force-pushed the feature/craig/autofill/promo_import_skip_preimport_screen branch from 3763867 to 2f66be7 Compare June 24, 2025 16:00
@CDRussell CDRussell force-pushed the feature/cristian/autofill/promo_import_in_management branch from 4a20d39 to 6328d9a Compare June 24, 2025 16:00
@cmonfortep cmonfortep force-pushed the feature/cristian/autofill/promo_import_in_management branch from 6328d9a to f7556c0 Compare June 25, 2025 11:02
Copy link
Contributor

@cmonfortep cmonfortep left a comment

Choose a reason for hiding this comment

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

LGTM

I pushed a change into the previous PR and I see conflicts here now. I assume restacking them should solve it.

@CDRussell CDRussell force-pushed the feature/craig/autofill/promo_import_skip_preimport_screen branch from 2f66be7 to ee5d7b2 Compare June 25, 2025 11:21
@CDRussell CDRussell force-pushed the feature/craig/autofill/promo_import_skip_preimport_screen branch from ee5d7b2 to 839a426 Compare June 26, 2025 14:00
@CDRussell CDRussell force-pushed the feature/cristian/autofill/promo_import_in_management branch from f7556c0 to 1347464 Compare June 26, 2025 14:00
@CDRussell CDRussell force-pushed the feature/cristian/autofill/promo_import_in_management branch from 1347464 to 92e9ebd Compare June 27, 2025 13:07
@CDRussell CDRussell force-pushed the feature/craig/autofill/promo_import_skip_preimport_screen branch from 839a426 to ebc6508 Compare June 27, 2025 13:07
@CDRussell CDRussell force-pushed the feature/craig/autofill/promo_import_skip_preimport_screen branch from ebc6508 to 40c2bee Compare July 1, 2025 11:05
@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 Author

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:11 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 2, 9:25 AM UTC: @CDRussell merged this pull request with Graphite.

@CDRussell CDRussell changed the base branch from feature/cristian/autofill/promo_import_in_management to graphite-base/6278 July 2, 2025 09:09
@CDRussell CDRussell changed the base branch from graphite-base/6278 to develop July 2, 2025 09:09
@CDRussell CDRussell force-pushed the feature/craig/autofill/promo_import_skip_preimport_screen branch from 40c2bee to 6b9d462 Compare July 2, 2025 09:10
@CDRussell CDRussell merged commit f4f6f37 into develop Jul 2, 2025
7 checks passed
@CDRussell CDRussell deleted the feature/craig/autofill/promo_import_skip_preimport_screen branch July 2, 2025 09:25
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