[PM-38966] feat: Add fill assist opt-in setting and privacy gate - #7075
Conversation
…assist-data-layer
…emoved unnecessary deserialization tests
…assist-data-layer
…ow updates Updating code to schema with required values
…assist-data-layer
…l-assist-option-settings # Conflicts: # app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/parser/AutofillParserImpl.kt
…l-assist-option-settings # Conflicts: # app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/parser/AutofillParserImpl.kt # app/src/test/kotlin/com/x8bit/bitwarden/data/autofill/manager/FillAssistManagerTest.kt
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7075 +/- ##
==========================================
+ Coverage 86.02% 86.09% +0.06%
==========================================
Files 927 885 -42
Lines 66227 64733 -1494
Branches 9670 9638 -32
==========================================
- Hits 56974 55729 -1245
+ Misses 5788 5547 -241
+ Partials 3465 3457 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
# Conflicts: # app/src/test/kotlin/com/x8bit/bitwarden/data/autofill/parser/AutofillParserTests.kt
…l-assist-option-settings
…l-assist-option-settings
| if (!syncJob.isCompleted) return | ||
| if (clock.millis() - lastFetch < UPDATE_INTERVAL_MS || | ||
| !syncJob.isCompleted | ||
| ) { |
There was a problem hiding this comment.
Is this identical functionality?
Why change this?
There was a problem hiding this comment.
I guess this has changed since this PR was created. Will revert the change as it does not make sense anymore
| ?.takeUnless { it.startsWith("androidapp://") } | ||
| ?.toUri() | ||
| ?.host | ||
| ?.takeIf { featureFlagManager.getFeatureFlag(FlagKey.FillAssistTargetingRules) } |
| val firstTimeState = firstTimeActionManager.currentOrDefaultUserFirstTimeState | ||
| AutoFillState( | ||
| showFillAssistOption = featureFlagManager | ||
| .getFeatureFlag(FlagKey.FillAssistTargetingRules), |
There was a problem hiding this comment.
Can we add logic to observe the feature flag state, so it can update in realtime.
# Conflicts: # app/src/main/kotlin/com/x8bit/bitwarden/data/autofill/parser/AutofillParserImpl.kt
|
|
||
| private fun handleFillAssistToggleClick(action: AutoFillAction.FillAssistToggleClick) { | ||
| settingsRepository.isFillAssistEnabled = action.isEnabled | ||
| mutableStateFlow.update { it.copy(isFillAssistEnabled = action.isEnabled) } |
There was a problem hiding this comment.
Can we observe this state directly from the repo as well?
|
|
||
| featureFlagManager | ||
| .getFeatureFlagFlow(FlagKey.FillAssistTargetingRules) | ||
| .map { AutoFillAction.Internal.FillAssistTargetingRulesFlagUpdateReceive(it) } |
| class AutoFillViewModel @Inject constructor( | ||
| authRepository: AuthRepository, | ||
| browserThirdPartyAutofillEnabledManager: BrowserThirdPartyAutofillEnabledManager, | ||
| private val featureFlagManager: FeatureFlagManager, |
There was a problem hiding this comment.
This does not need to be a private val right?
…n AutofillViewModel
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the fill-assist opt-in setting and privacy gate. Changes add a per-user Code Review DetailsNo blocking findings. The implementation follows established codebase conventions: the new Prior reviewer feedback in the existing threads appears addressed: the |
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-38966
📔 Objective
Settings UI
FillAssistTargetingRulesfeature flag is enabledhttps://bitwarden.com/help/fill-assist/Privacy gate
FillAssistManagerImpl.syncIfNecessary()now exits early when the user has not opted in — no background CDN requests while the feature is disabledsyncIfNecessary()call so rules are available without waiting for the next server-config emissionAutofill integration
AutofillParserImplapplies fill-assist rules only when both the feature flag andisFillAssistEnabledare trueData layer
isFillAssistEnabledper-user preference inSettingsDiskSource/SettingsRepository(keyed withappendIdentifier(userId), stored unencrypted)FillAssistService, manifest + forms JSON parsing, 6-hour re-fetch throttle with CID-based deduplicationCSS selector matching
tag#id,[attr='value'], CSS descendant selectors, and Shadow DOM (>>>) notation[placeholder='Email address']) are preservedHtmlInfo.matchesSelectorClause()extracted toHtmlInfoExtensionsfollowing the existingandroid.util.Pairisolation patternTests
FillAssistManagerTest: new case — sync does nothing whenisFillAssistEnabled = falseAutoFillViewModelTest: toggle-on persists setting and callssyncIfNecessary(); toggle-off persists setting and skips sync; info-click emitsNavigateToFillAssistHelpAutoFillScreenTest: switch hidden when flag off, switch visible when flag on, toggle sendsFillAssistToggleClick,NavigateToFillAssistHelpcallsintentManager.launchUriFillAssistViewNodeExtensionsTest: all previously commented-out tests now pass viamockkStatic(HtmlInfo::matchesSelectorClause)📸 Screenshots