[PM-38025] Filter inline autofill menu items as the user types#20836
Open
xrvk wants to merge 2 commits into
Open
[PM-38025] Filter inline autofill menu items as the user types#20836xrvk wants to merge 2 commits into
xrvk wants to merge 2 commits into
Conversation
Keep the inline autofill menu open while the user types in a username/ email/login text field and filter the cipher list using the field's value via SearchService.searchCiphersBasic. The user's own input field acts as the search box — no extra search input is introduced. Behavior is preserved bit-for-bit for password, TOTP, card, and identity fields, which continue to close the menu on type as before (regression-guard tests added). The typed filter is treated as PII: never logged, length-capped, reset on inline-menu close, focus-change to a different field, and full vault refresh. Community request: https://community.bitwarden.com/t/inline-autofill-menu-ability-to-filter-items-by-typing-searching/63417 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
|
Thank you for your contribution! We've added this to our internal tracking system for review. Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process. |
|
Only another user here... but as I saw it... just FYI, someone else opened a similar PR recently: #20543 |
Rename the new message and wire field to match the names already in front of maintainers on PR bitwarden#20543 (filterInlineMenuCiphers / filterValue), so the two PRs use compatible protocols and cherry-picking between them is trivial. - updateAutofillInlineMenuFilter -> filterInlineMenuCiphers (message) - filter -> filterValue (payload field) - inlineMenuFilter -> inlineMenuFilterValue (internal field) No behavior change. All 1766 autofill tests still pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎟️ Tracking
Community feature request (52 replies, ~1.3k views): https://community.bitwarden.com/t/inline-autofill-menu-ability-to-filter-items-by-typing-searching/63417
📔 Objective
When the inline autofill menu is open and the user starts typing in a username/email field, the menu closes today (see
triggerFormFieldInput->closeAutofillInlineMenu). For users with several saved logins on the same site this means scrolling instead of narrowing. This PR keeps the menu open on login text fields and filters the cipher list using the typed text. The focused input field itself acts as the search box, so no new UI is added.Behavior on password, TOTP, card, and identity fields is preserved unchanged (still close-on-type). The filter is reset whenever the inline menu closes, focus moves to a different field, or the vault refreshes, and it is treated as PII (never logged, length-capped).
Changes:
autofill-overlay-content.service.ts:triggerFormFieldInputbranches oninlineMenuFillType. For login text-like fields (CipherType.Login,InlineMenuFillTypes.AccountCreationUsername, excluding password/TOTP) it sends a newupdateAutofillInlineMenuFiltermessage and keeps the menu open. All other field types use the existing close path bit-for-bit.overlay.background.ts: newinlineMenuFilterfield, newupdateAutofillInlineMenuFilterextension-message handler, and filter application via the existingSearchService.searchCiphersBasicbefore cipher projection. The filtered set flows through the existingupdateAutofillInlineMenuListCiphersport message (no new ports).autofill-inline-menu-list.ts: accepts an optionalfilterand, when the resulting cipher list is empty, renders a localized "No matches forinlineMenuNoMatchesin_locales/en/messages.json.main.background.ts: passesSearchServicetoOverlayBackground(already initialized earlier in the DI graph).No new permissions, no manifest changes, no new ports, no new event listeners. The implementation reuses existing plumbing that already works on Chrome, Firefox, and Safari. Ten new unit tests were added covering filter apply, reset on close/focus-change/vault refresh, non-searchable short-circuit, dedup, length cap, the iframe empty state, an XSS guard on the filter text-node insertion, and regression guards confirming password/card/identity still close on type. All 1766 autofill tests pass.
📸 Screenshots
Consolidation with PR #20543
After this PR was opened, we discovered that PR #20543 (
Add filter-as-you-type to autofill inline menu, Gamerhund, opened 2026-05-07) already addresses the same feature and has been forwarded to internal teams byaudreyality. To minimize churn and align with the prior art that is already in front of reviewers, this PR has been updated to:Adopted from #20543 (their wire-protocol naming):
filterInlineMenuCiphers(wasupdateAutofillInlineMenuFilter)filterValue(wasfilter)Retained from this PR (engineering differentials worth keeping):
SearchService.searchCiphersBasicreuse instead of duplicating an inline lowercase-substring match. Picks up URI and notes matching for free and centralizes search logic.triggerFormFieldInput: only login text fields (CipherType.Login,InlineMenuFillTypes.AccountCreationUsername, excluding password/TOTP) stream the filter. Password keystrokes never traverse the message bus. Card and identity fields keep their existing click-to-fill behavior.inlineMenuNoMatches), rendered with text nodes for XSS safety. Preferred over silently closing the menu on zero matches because it tells the user their query simply didn't match — backspacing restores the list without the menu disappearing and re-appearing.Deliberately not adopted from #20543:
If the team prefers #20543 as the basis, the wire-protocol naming now matches verbatim, so cherry-picking the differentials above is a small diff.