Skip to content

Commit 4149150

Browse files
New autofill settings screen (#5966)
Task/Issue URL: https://app.asana.com/1/137249556945/project/1203822806345703/task/1209978805262567?focus=true ### Description Introduces new Autofill settings screen Feature Flag: `settingsScreen` ### Steps to test this PR _Feature 1_ - [x] with `settingsScreen` enabled - [x] settings -> passwords - [x] validate new settings are displayed - [x] interact with every option to confirm works as expected - [x] if you add excluded sites, ensure reset exclude sites is shown - [x] if you interact with reset excluded sites and confirm, option disappears _Feature 2_ - [x] with `settingsScreen` enabled - [x] any access outside settings should take you to passwords list - [x] confirm toggle is not shown in the list - [x] every other option stays as usual _Feature 3_ - [x] with `settingsScreen` disabled - [x] experience should be current production - [x] ensure when accessing to passwords from any section, you land in the list mode - [x] ensure toggle is shown _Feature 4_ - [ ] if device unsupported or biometrics not set, ensure error state shows ### UI changes | Before | After | | ------ | ----- | !(Upload before screenshot)|(Upload after screenshot)| --------- Co-authored-by: Dax The Translator <[email protected]>
1 parent a9d8ccd commit 4149150

File tree

82 files changed

+1890
-346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1890
-346
lines changed

app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ import com.duckduckgo.autoconsent.api.AutoconsentCallback
202202
import com.duckduckgo.autofill.api.AutofillCapabilityChecker
203203
import com.duckduckgo.autofill.api.AutofillEventListener
204204
import com.duckduckgo.autofill.api.AutofillFragmentResultsPlugin
205-
import com.duckduckgo.autofill.api.AutofillScreens.AutofillSettingsScreenDirectlyViewCredentialsParams
206-
import com.duckduckgo.autofill.api.AutofillScreens.AutofillSettingsScreenShowSuggestionsForSiteParams
207-
import com.duckduckgo.autofill.api.AutofillSettingsLaunchSource
205+
import com.duckduckgo.autofill.api.AutofillScreenLaunchSource
206+
import com.duckduckgo.autofill.api.AutofillScreens.AutofillPasswordsManagementScreenWithSuggestions
207+
import com.duckduckgo.autofill.api.AutofillScreens.AutofillPasswordsManagementViewCredential
208208
import com.duckduckgo.autofill.api.BrowserAutofill
209209
import com.duckduckgo.autofill.api.Callback
210210
import com.duckduckgo.autofill.api.CredentialAutofillDialogFactory
@@ -3183,9 +3183,9 @@ class BrowserTabFragment :
31833183
if (includeShortcutToViewCredential) {
31843184
snackbar.setAction(R.string.autofillSnackbarAction) {
31853185
context?.let {
3186-
val screen = AutofillSettingsScreenDirectlyViewCredentialsParams(
3186+
val screen = AutofillPasswordsManagementViewCredential(
31873187
loginCredentials = loginCredentials,
3188-
source = AutofillSettingsLaunchSource.BrowserSnackbar,
3188+
source = AutofillScreenLaunchSource.BrowserSnackbar,
31893189
)
31903190
globalActivityStarter.start(it, screen)
31913191
}
@@ -3196,9 +3196,9 @@ class BrowserTabFragment :
31963196
}
31973197

31983198
private fun launchAutofillManagementScreen(privacyProtectionEnabled: Boolean) {
3199-
val screen = AutofillSettingsScreenShowSuggestionsForSiteParams(
3199+
val screen = AutofillPasswordsManagementScreenWithSuggestions(
32003200
currentUrl = webView?.url,
3201-
source = AutofillSettingsLaunchSource.BrowserOverflow,
3201+
source = AutofillScreenLaunchSource.BrowserOverflow,
32023202
privacyProtectionEnabled = privacyProtectionEnabled,
32033203
)
32043204
globalActivityStarter.start(requireContext(), screen)

app/src/main/java/com/duckduckgo/app/global/api/PixelParamRemovalInterceptor.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ object PixelInterceptorPixelsRequiringDataCleaning : PixelParamRemovalPlugin {
9999
AppPixelName.MENU_ACTION_NEW_TAB_PRESSED_FROM_SITE.pixelName to PixelParameter.removeAll(),
100100
AppPixelName.MENU_ACTION_NEW_TAB_PRESSED_FROM_SERP.pixelName to PixelParameter.removeAll(),
101101
AppPixelName.SETTINGS_SYNC_PRESSED.pixelName to PixelParameter.removeAtb(),
102+
AppPixelName.SETTINGS_PASSWORDS_PRESSED.pixelName to PixelParameter.removeAtb(),
102103
AppPixelName.SETTINGS_EMAIL_PROTECTION_PRESSED.pixelName to PixelParameter.removeAtb(),
103104
AppPixelName.ONBOARDING_DAX_CTA_DISMISS_BUTTON.pixelName to PixelParameter.removeAtb(),
104105
AppPixelName.TAB_MANAGER_INFO_PANEL_IMPRESSIONS.pixelName to PixelParameter.removeAll(),

app/src/main/java/com/duckduckgo/app/pixels/AppPixelName.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ enum class AppPixelName(override val pixelName: String) : Pixel.PixelName {
129129
SETTINGS_WEB_TRACKING_PROTECTION_PRESSED("ms_web_tracking_protection_setting_pressed"),
130130
SETTINGS_ACCESSIBILITY_PRESSED("ms_accessibility_setting_pressed"),
131131
SETTINGS_ABOUT_PRESSED("ms_about_setting_pressed"),
132+
SETTINGS_PASSWORDS_PRESSED("ms_passwords_pressed"),
132133
SETTINGS_SYNC_PRESSED("ms_sync_pressed"),
133134
SETTINGS_PERMISSIONS_PRESSED("ms_permissions_setting_pressed"),
134135
SETTINGS_APPEARANCE_PRESSED("ms_appearance_setting_pressed"),

app/src/main/java/com/duckduckgo/app/settings/SettingsActivity.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchAddHomeScreen
4848
import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchAppTPOnboarding
4949
import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchAppTPTrackersScreen
5050
import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchAppearanceScreen
51+
import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchAutofillPasswordsManagement
5152
import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchAutofillSettings
5253
import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchCookiePopupProtectionScreen
5354
import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchDefaultBrowser
@@ -69,8 +70,9 @@ import com.duckduckgo.app.webtrackingprotection.WebTrackingProtectionScreenNoPar
6970
import com.duckduckgo.app.widget.AddWidgetLauncher
7071
import com.duckduckgo.appbuildconfig.api.AppBuildConfig
7172
import com.duckduckgo.autoconsent.impl.ui.AutoconsentSettingsActivity
73+
import com.duckduckgo.autofill.api.AutofillScreenLaunchSource
74+
import com.duckduckgo.autofill.api.AutofillScreens.AutofillPasswordsManagementScreen
7275
import com.duckduckgo.autofill.api.AutofillScreens.AutofillSettingsScreen
73-
import com.duckduckgo.autofill.api.AutofillSettingsLaunchSource
7476
import com.duckduckgo.browser.api.ui.BrowserScreens.SettingsScreenNoParams
7577
import com.duckduckgo.common.ui.DuckDuckGoActivity
7678
import com.duckduckgo.common.ui.view.gone
@@ -325,7 +327,10 @@ class SettingsActivity : DuckDuckGoActivity() {
325327
private fun processCommand(it: Command) {
326328
when (it) {
327329
is LaunchDefaultBrowser -> launchDefaultAppScreen()
328-
is LaunchAutofillSettings -> launchScreen(AutofillSettingsScreen(source = AutofillSettingsLaunchSource.SettingsActivity))
330+
is LaunchAutofillSettings -> launchScreen(AutofillSettingsScreen(source = AutofillScreenLaunchSource.SettingsActivity))
331+
is LaunchAutofillPasswordsManagement -> launchScreen(
332+
AutofillPasswordsManagementScreen(source = AutofillScreenLaunchSource.SettingsActivity),
333+
)
329334
is LaunchAccessibilitySettings -> launchScreen(AccessibilityScreens.Default)
330335
is LaunchAppTPTrackersScreen -> launchScreen(AppTrackerActivityWithEmptyParams)
331336
is LaunchAppTPOnboarding -> launchScreen(AppTrackerOnboardingActivityWithEmptyParamsParams)

app/src/main/java/com/duckduckgo/app/settings/SettingsViewModel.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_GENERAL_PRESSED
3636
import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_NEXT_STEPS_ADDRESS_BAR
3737
import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_NEXT_STEPS_VOICE_SEARCH
3838
import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_OPENED
39+
import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_PASSWORDS_PRESSED
3940
import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_PERMISSIONS_PRESSED
4041
import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_PRIVATE_SEARCH_PRESSED
4142
import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_WEB_TRACKING_PROTECTION_PRESSED
@@ -45,6 +46,7 @@ import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchAddHomeScreen
4546
import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchAppTPOnboarding
4647
import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchAppTPTrackersScreen
4748
import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchAppearanceScreen
49+
import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchAutofillPasswordsManagement
4850
import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchAutofillSettings
4951
import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchCookiePopupProtectionScreen
5052
import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchDefaultBrowser
@@ -63,6 +65,7 @@ import com.duckduckgo.app.settings.SettingsViewModel.Command.LaunchWebTrackingPr
6365
import com.duckduckgo.app.statistics.pixels.Pixel
6466
import com.duckduckgo.autoconsent.api.Autoconsent
6567
import com.duckduckgo.autofill.api.AutofillCapabilityChecker
68+
import com.duckduckgo.autofill.api.AutofillFeature
6669
import com.duckduckgo.autofill.api.email.EmailManager
6770
import com.duckduckgo.common.utils.ConflatedJob
6871
import com.duckduckgo.common.utils.DispatcherProvider
@@ -105,6 +108,7 @@ class SettingsViewModel @Inject constructor(
105108
private val voiceSearchAvailability: VoiceSearchAvailability,
106109
private val privacyProUnifiedFeedback: PrivacyProUnifiedFeedback,
107110
private val settingsPixelDispatcher: SettingsPixelDispatcher,
111+
private val autofillFeature: AutofillFeature,
108112
) : ViewModel(), DefaultLifecycleObserver {
109113

110114
data class ViewState(
@@ -125,6 +129,7 @@ class SettingsViewModel @Inject constructor(
125129
data object LaunchDefaultBrowser : Command()
126130
data class LaunchEmailProtection(val url: String) : Command()
127131
data object LaunchEmailProtectionNotSupported : Command()
132+
data object LaunchAutofillPasswordsManagement : Command()
128133
data object LaunchAutofillSettings : Command()
129134
data object LaunchAccessibilitySettings : Command()
130135
data object LaunchAddHomeScreenWidget : Command()
@@ -253,7 +258,14 @@ class SettingsViewModel @Inject constructor(
253258
}
254259

255260
fun onAutofillSettingsClick() {
256-
viewModelScope.launch { command.send(LaunchAutofillSettings) }
261+
viewModelScope.launch {
262+
if (autofillFeature.settingsScreen().isEnabled()) {
263+
command.send(LaunchAutofillSettings)
264+
} else {
265+
command.send(LaunchAutofillPasswordsManagement)
266+
}
267+
}
268+
pixel.fire(SETTINGS_PASSWORDS_PRESSED)
257269
}
258270

259271
fun onAccessibilitySettingClicked() {

app/src/main/res/values-bg/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
<string name="tabSwitcherGridViewMenu">Изглед в решетка</string>
120120

121121
<!--Tab Switcher Animation-->
122-
<string name="trackersBlockedInTheLast7days" instruction="Placeholder is the number of trackers blocked">&lt;b&gt;%1$s блокирани тракера &lt;/b&gt; през последните 7 дни</string>
122+
<string name="trackersBlockedInTheLast7days" instruction="Placeholder is the number of trackers blocked &gt; 1">&lt;b&gt;%1$s блокирани тракера &lt;/b&gt; през последните 7 дни</string>
123123
<string name="trackersBlocked" instruction="Placeholder is the number of trackers blocked">&lt;b&gt;%1$s блокирани тракера &lt;/b&gt;</string>
124124
<string name="inTheLast7Days">през последните 7 дни</string>
125125

app/src/main/res/values-cs/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<string name="tabSwitcherGridViewMenu">Zobrazení mřížky</string>
122122

123123
<!--Tab Switcher Animation-->
124-
<string name="trackersBlockedInTheLast7days" instruction="Placeholder is the number of trackers blocked">&lt;b&gt;Zablokovaných trackerů: %1$s&lt;/b&gt; za posledních 7 dní</string>
124+
<string name="trackersBlockedInTheLast7days" instruction="Placeholder is the number of trackers blocked &gt; 1">&lt;b&gt;Zablokovaných trackerů: %1$s&lt;/b&gt; za posledních 7 dní</string>
125125
<string name="trackersBlocked" instruction="Placeholder is the number of trackers blocked">&lt;b&gt;Zablokovaných trackerů: %1$s&lt;/b&gt;</string>
126126
<string name="inTheLast7Days">za posledních 7 dní</string>
127127

app/src/main/res/values-da/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
<string name="tabSwitcherGridViewMenu">Gittervisning</string>
120120

121121
<!--Tab Switcher Animation-->
122-
<string name="trackersBlockedInTheLast7days" instruction="Placeholder is the number of trackers blocked">&lt;b&gt;%1$s trackere blokeret &lt;/b&gt; inden for de seneste 7 dage</string>
122+
<string name="trackersBlockedInTheLast7days" instruction="Placeholder is the number of trackers blocked &gt; 1">&lt;b&gt;%1$s trackere blokeret &lt;/b&gt; inden for de seneste 7 dage</string>
123123
<string name="trackersBlocked" instruction="Placeholder is the number of trackers blocked">&lt;b&gt;%1$s tracker blokeret &lt;/b&gt;</string>
124124
<string name="inTheLast7Days">inden for de seneste 7 dage</string>
125125

app/src/main/res/values-de/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
<string name="tabSwitcherGridViewMenu">Gitteransicht</string>
120120

121121
<!--Tab Switcher Animation-->
122-
<string name="trackersBlockedInTheLast7days" instruction="Placeholder is the number of trackers blocked">&lt;b&gt;%1$s Tracker wurden in den letzten 7 Tagen blockiert &lt;/b&gt;</string>
122+
<string name="trackersBlockedInTheLast7days" instruction="Placeholder is the number of trackers blocked &gt; 1">&lt;b&gt;%1$s Tracker wurden in den letzten 7 Tagen blockiert &lt;/b&gt;</string>
123123
<string name="trackersBlocked" instruction="Placeholder is the number of trackers blocked">&lt;b&gt;%1$s Tracker blockiert &lt;/b&gt;</string>
124124
<string name="inTheLast7Days">in den letzten 7 Tagen</string>
125125

app/src/main/res/values-el/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
<string name="tabSwitcherGridViewMenu">Προβολή πλέγματος</string>
120120

121121
<!--Tab Switcher Animation-->
122-
<string name="trackersBlockedInTheLast7days" instruction="Placeholder is the number of trackers blocked">&lt;b&gt;%1$s εφαρμογές παρακολούθησης αποκλείστηκαν &lt;/b&gt; τις τελευταίες 7 ημέρες</string>
122+
<string name="trackersBlockedInTheLast7days" instruction="Placeholder is the number of trackers blocked &gt; 1">&lt;b&gt;%1$s εφαρμογές παρακολούθησης αποκλείστηκαν &lt;/b&gt; τις τελευταίες 7 ημέρες</string>
123123
<string name="trackersBlocked" instruction="Placeholder is the number of trackers blocked">&lt;b&gt;%1$s εφαρμογές παρακολούθησης αποκλείστηκαν &lt;/b&gt;</string>
124124
<string name="inTheLast7Days">τις τελευταίες 7 ημέρες</string>
125125

0 commit comments

Comments
 (0)