[PM-39612] fix: resolve autofill container-hint redirect to autofillable child#7146
Conversation
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the autofill container-hint redirect fix across Code Review DetailsNo blocking findings. The two existing reviewer threads (the |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7146 +/- ##
==========================================
- Coverage 86.49% 86.44% -0.06%
==========================================
Files 908 912 +4
Lines 65230 65516 +286
Branches 9600 9610 +10
==========================================
+ Hits 56422 56634 +212
- Misses 5365 5437 +72
- Partials 3443 3445 +2
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:
|
| autofillHint = this.supportedAutofillHint, | ||
| autofillHint = hint, | ||
| ) | ||
| return view |
There was a problem hiding this comment.
Why did we add the view property, can we leave it as a return?
| if (view !is AutofillView.Unused) { | ||
| claimedAutofillIds.add(id) | ||
| } | ||
| true |
There was a problem hiding this comment.
What do you think of this?
val id = view.data.autofillId
if (id in claimedAutofillIds) {
false
} else if (view !is AutofillView.Unused) {
claimedAutofillIds.add(id)
true
} else {
true
}|
Thank you @david-livefront |
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-39612
📔 Objective
Some Android apps wrap their login
EditTextfields inside a container view (e.g., MaterialTextInputLayout). The container carries the semantic autofill hint (USERNAME,PASSWORD) but hasautofillType = NONE (0), meaning it cannot receive a fill value. The innerEditTexthasautofillType = TEXT (1)but no hint, so heuristics never classify it. As a result, autofill silently failed — the fill dataset was built against the container'sautofillIdwithautofillType = 0, which the framework dropped at fill time.Changes:
ViewNodeExtensions.kt: When a container node carries a semantic hint but hasautofillType = NONE,findFirstAutofillableChild()locates the first descendant withautofillType = TEXT. The child'sautofillIdandautofillTypeare used inAutofillView.Dataso the fill reaches the actual input field.AutofillParserImpl.kt: AddedclaimedAutofillIdstracking during traversal to prevent a child node from being added a second time after the container has already redirected to it.