Skip to content

Fix inline autofill suggestions never rendering/tappable (size spec mismatch + WRAP_CONTENT collapse) - #850

Open
lexuschris wants to merge 1 commit into
urikdev:mainfrom
lexuschris:fix/inline-autofill-suggestions-not-visible
Open

Fix inline autofill suggestions never rendering/tappable (size spec mismatch + WRAP_CONTENT collapse)#850
lexuschris wants to merge 1 commit into
urikdev:mainfrom
lexuschris:fix/inline-autofill-suggestions-not-visible

Conversation

@lexuschris

Copy link
Copy Markdown

Summary

Fixes #849 — inline autofill suggestions (e.g. from 1Password) would signal availability (indicator icon shown) but never render visibly or tappably in the suggestion bar.

Two independent bugs, both in the inline-suggestions pipeline introduced for password-manager autofill support:

  • inflateSuggestionView() requested a single hardcoded 150dp × 40dp size for every suggestion via suggestion.inflate(), ignoring that onCreateInlineSuggestionsRequest() declares per-suggestion size bounds (regular chips: 80–400dp wide; a trailing icon-only spec: 32–48dp wide). Requesting a size outside a suggestion's own InlinePresentationSpec bounds causes the system to silently fail to inflate it.
  • Even after that's fixed, suggestions that do inflate successfully were added to the suggestion bar with LinearLayout.LayoutParams(WRAP_CONTENT, MATCH_PARENT). The returned view is an InlineContentView hosting cross-process rendered content (via SurfaceControlViewHost) and does not reliably self-report a measured size to a WRAP_CONTENT parent, so it can collapse to an invisible/untappable 0-width view even though the underlying content rendered correctly on the system side.

Changes

  • UrikInputMethodService.kt: inflateSuggestionView() now reads suggestion.info.inlinePresentationSpec and clamps the requested inflate size into that suggestion's own minSize/maxSize, and returns Pair<View, Size> so the exact size used travels with the view.
  • CandidateBarController.kt / SwipeKeyboardView.kt: updateInlineAutofillSuggestions() now takes List<Pair<View, Size>> and applies each view's exact size as explicit LinearLayout.LayoutParams instead of WRAP_CONTENT.
  • CandidateBarControllerTest.kt: updated to the new signature.

Root cause discovery

Found by decompiling the actual android-36 platform jar to confirm the real InlineSuggestionInfo API surface (getInlinePresentationSpec(), not the initially-assumed getPresentationSpec()), and by capturing on-device logcat during reproduction, which showed InlineSuggestionRenderService successfully creating and measuring suggestion content (measuredSize=525x140) with no exceptions in the app's own error log — proving the content was fine and the bug was in how the returned view was being laid out client-side, not in suggestion delivery itself.

Test plan

  • ./gradlew compileDebugKotlin / compileDebugUnitTestKotlin — clean build
  • ./gradlew assembleDebug — builds
  • Verified live on a Pixel 6 Pro (GrapheneOS) with 1Password as the Autofill service:
    • Before fix: key indicator icon shown, no suggestion content visible/tappable
    • After fix: suggestion chip renders and is tappable, correctly triggers 1Password's fill flow
  • Reproduced and verified across both the primary (Owner) profile and a secondary user profile
  • Existing unit test suite (./gradlew test) — not re-run after this change, recommend running before merge

Two independent bugs in the inline-suggestions pipeline:

1. inflateSuggestionView() requested a single hardcoded 150dp x 40dp
   size for every suggestion via suggestion.inflate(), ignoring that
   onCreateInlineSuggestionsRequest() declares per-suggestion size
   bounds (regular chips: 80-400dp wide; a trailing icon-only spec:
   32-48dp wide). Requesting a size outside a suggestion's own
   InlinePresentationSpec bounds causes it to silently fail to inflate.

2. Successfully-inflated suggestions were added to the suggestion bar
   with LinearLayout.LayoutParams(WRAP_CONTENT, MATCH_PARENT). The
   returned view is an InlineContentView hosting cross-process
   rendered content and does not reliably self-report a measured size,
   so WRAP_CONTENT collapsed it to an invisible/untappable 0-width view
   even though the content rendered correctly on the system side.

Fixes both by clamping each suggestion's inflate size to its own
spec's minSize/maxSize, and threading that exact size through as
explicit LayoutParams instead of WRAP_CONTENT.

Verified on a Pixel 6 Pro (GrapheneOS) with 1Password as the Autofill
service, across both the primary and a secondary user profile.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@urikdev

urikdev commented Jul 29, 2026

Copy link
Copy Markdown
Owner

@lexuschris amazing - taking a look now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline autofill suggestions (1Password) never render/tappable, even when active

2 participants