Skip to content

[PM-38966] feat: Add fill assist opt-in setting and privacy gate#7075

Draft
aj-rosado wants to merge 1 commit into
PM-37256/apply-fill-assist-rulesfrom
PM-38966/add-fill-assist-option-settings
Draft

[PM-38966] feat: Add fill assist opt-in setting and privacy gate#7075
aj-rosado wants to merge 1 commit into
PM-37256/apply-fill-assist-rulesfrom
PM-38966/add-fill-assist-option-settings

Conversation

@aj-rosado

Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-38966

📔 Objective

Settings UI

  • Adds a "Turn on fill assist" toggle to Settings → Autofill → Additional options, visible only when the FillAssistTargetingRules feature flag is enabled
  • Toggle is off by default (explicit opt-in)
  • Includes an info icon linking to https://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 disabled
  • Toggling the setting on triggers an immediate syncIfNecessary() call so rules are available without waiting for the next server-config emission

Autofill integration

  • AutofillParserImpl applies fill-assist rules only when both the feature flag and isFillAssistEnabled are true
  • When rules match the current host, site-specific field targeting replaces heuristics entirely; unmatched nodes are excluded (no heuristic fallback)

Data layer

  • New isFillAssistEnabled per-user preference in SettingsDiskSource / SettingsRepository (keyed with appendIdentifier(userId), stored unencrypted)
  • Full network stack: FillAssistService, manifest + forms JSON parsing, 6-hour re-fetch throttle with CID-based deduplication

CSS selector matching

  • Parses tag#id, [attr='value'], CSS descendant selectors, and Shadow DOM (>>>) notation
  • Descendant-selector splitting is bracket-aware so attribute values containing spaces (e.g. [placeholder='Email address']) are preserved
  • HtmlInfo.matchesSelectorClause() extracted to HtmlInfoExtensions following the existing android.util.Pair isolation pattern

Tests

  • FillAssistManagerTest: new case — sync does nothing when isFillAssistEnabled = false
  • AutoFillViewModelTest: toggle-on persists setting and calls syncIfNecessary(); toggle-off persists setting and skips sync; info-click emits NavigateToFillAssistHelp
  • AutoFillScreenTest: switch hidden when flag off, switch visible when flag on, toggle sends FillAssistToggleClick, NavigateToFillAssistHelp calls intentManager.launchUri
  • FillAssistViewNodeExtensionsTest: all previously commented-out tests now pass via mockkStatic(HtmlInfo::matchesSelectorClause)

📸 Screenshots

Autofill settings with fill assist option

@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context app:authenticator Bitwarden Authenticator app context t:feature Change Type - Feature Development labels Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:authenticator Bitwarden Authenticator app context app:password-manager Bitwarden Password Manager app context t:feature Change Type - Feature Development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant