Skip to content

Full initial prototyped implementation of inline address autocomplete behind feature flag#13222

Draft
nidhi-stripe wants to merge 3 commits into
masterfrom
nidhig/address-element-inline-autocomplete-prototype
Draft

Full initial prototyped implementation of inline address autocomplete behind feature flag#13222
nidhi-stripe wants to merge 3 commits into
masterfrom
nidhig/address-element-inline-autocomplete-prototype

Conversation

@nidhi-stripe

@nidhi-stripe nidhi-stripe commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Prototype inline Google Places autocomplete for the Address Element. Instead of opening a full-screen autocomplete screen, users can type in the condensed address field and see suggestions in a dropdown.

Gated behind a Feature Flag: inlineAddressAutocomplete. Production behavior is unchanged, existing full-screen autocomplete still runs when the flag is off.

Motivation

The Address Element currently uses a full-screen autocomplete flow when a Google Places API key is configured. This prototype explores an inline UX, typing directly in the address field with dropdown suggestions to evaluate whether it improves the address collection experience. Because this is a prototype, it is intentionally behind a debug feature flag so we can iterate in the playground without affecting merchants.

Testing

  • Added tests
  • Modified tests
  • Manually verified

Unit tests (InputAddressViewModelTest):

  • Feature flag defaults to off / can be enabled in debug
  • onQueryChanged guard rails (short query, unsupported country, empty autocompleteCountries)
  • onPredictionSelected fetches place details and populates address fields

Manual verification (playground):

  1. Run paymentsheet-example debug build
  2. Enable Address Element: inline autocomplete suggestions feature flag
  3. Enable Autocomplete for addresses and provide a Google Places API key
  4. Open Address Element, type in the address field and confirm inline suggestions appear
  5. Select a suggestion and confirm fields populate; tap Enter address manually to expand the full form
  6. Confirm with flag off, behavior matches master (full-screen autocomplete)

Recording

Recording Link

Changelog

@nidhi-stripe nidhi-stripe requested review from cttsai-stripe and toluo-stripe and removed request for toluo-stripe June 9, 2026 22:08
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: V1, V2)
NEW: paymentsheet-example-release-pr.apk (signature: V1, V2)

          │            compressed             │           uncompressed            
          ├───────────┬───────────┬───────────┼───────────┬───────────┬───────────
 APK      │ old       │ new       │ diff      │ old       │ new       │ diff      
──────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────
      dex │   4.6 MiB │   4.6 MiB │  +5.5 KiB │   9.8 MiB │   9.8 MiB │ +12.4 KiB 
     arsc │   3.8 MiB │   3.8 MiB │  +4.6 KiB │   3.8 MiB │   3.8 MiB │  +4.6 KiB 
 manifest │   5.8 KiB │   5.8 KiB │       0 B │    31 KiB │    31 KiB │       0 B 
      res │     1 MiB │     1 MiB │  +2.2 KiB │   1.7 MiB │   1.7 MiB │  +2.1 KiB 
   native │   2.7 MiB │   2.7 MiB │       0 B │   2.7 MiB │   2.7 MiB │       0 B 
    asset │    25 KiB │    25 KiB │      -7 B │  45.8 KiB │  45.8 KiB │      -7 B 
    other │ 245.4 KiB │ 245.5 KiB │     +69 B │ 505.1 KiB │ 505.2 KiB │    +164 B 
──────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────
    total │  12.3 MiB │  12.3 MiB │ +12.4 KiB │  18.5 MiB │  18.5 MiB │ +19.2 KiB 

 DEX     │ old   │ new   │ diff              
─────────┼───────┼───────┼───────────────────
   files │     1 │     1 │   0               
 strings │ 45413 │ 45435 │ +22 (+91 -69)     
   types │ 14311 │ 14319 │  +8 (+73 -65)     
 classes │ 11623 │ 11631 │  +8 (+25 -17)     
 methods │ 63463 │ 63491 │ +28 (+6529 -6501) 
  fields │ 41324 │ 41360 │ +36 (+4117 -4081) 

 ARSC    │ old  │ new  │ diff       
─────────┼──────┼──────┼────────────
 configs │  319 │  320 │ +1 (+1 -0) 
 entries │ 7479 │ 7483 │ +4 (+4 -0)
APK
      compressed      │     uncompressed      │                                           
──────────┬───────────┼───────────┬───────────┤                                           
 size     │ diff      │ size      │ diff      │ path                                      
──────────┼───────────┼───────────┼───────────┼───────────────────────────────────────────
  4.6 MiB │  +5.5 KiB │   9.8 MiB │ +12.4 KiB │ ∆ classes.dex                             
  3.8 MiB │  +4.6 KiB │   3.8 MiB │  +4.6 KiB │ ∆ resources.arsc                          
  2.2 KiB │  +2.2 KiB │   2.1 KiB │  +2.1 KiB │ + res/cE.png                              
 55.6 KiB │     +36 B │ 130.6 KiB │     +82 B │ ∆ META-INF/MANIFEST.MF                    
 58.9 KiB │     +32 B │ 130.7 KiB │     +82 B │ ∆ META-INF/CERT.SF                        
  8.9 KiB │     -15 B │   8.8 KiB │     -15 B │ ∆ assets/dexopt/baseline.prof             
  1.2 KiB │      +8 B │     1 KiB │      +8 B │ ∆ assets/dexopt/baseline.profm            
    856 B │      +2 B │   1.8 KiB │       0 B │ ∆ res/8Q.xml                              
  1.1 KiB │      +2 B │   3.3 KiB │       0 B │ ∆ res/nn.xml                              
  1.2 KiB │      +2 B │   1.2 KiB │       0 B │ ∆ META-INF/CERT.RSA                       
    270 B │      -1 B │     120 B │       0 B │ ∆ META-INF/version-control-info.textproto 
    786 B │      -1 B │   1.6 KiB │       0 B │ ∆ res/Bh.xml                              
    758 B │      +1 B │   1.7 KiB │       0 B │ ∆ res/IT.xml                              
    652 B │      -1 B │   1.3 KiB │       0 B │ ∆ res/SJ.xml                              
    709 B │      -1 B │   1.3 KiB │       0 B │ ∆ res/UK.xml                              
    351 B │      +1 B │     516 B │       0 B │ ∆ res/xY.xml                              
──────────┼───────────┼───────────┼───────────┼───────────────────────────────────────────
  8.5 MiB │ +12.4 KiB │  13.8 MiB │ +19.2 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff          
  ───────┼───────┼───────────────
   45413 │ 45435 │ +22 (+91 -69) 
  
  + , predictions=
  + , primaryText=
  + , secondaryText=
  + Address Element: inline autocomplete suggestions
  + InlineAddressPrediction(id=
  + JAPANESE
  + Lfm/g5;
  + Lfm/h5;
  + Lfm/i5;
  + Lfm/j5;
  + Lfm/k5;
  + Lfm/l5;
  + Lfm/m5;
  + Lfm/n5;
  + Lfm/o5;
  + Lfm/p5;
  + Lg0/e2;
  + Lij/u5;
  + Lke/p2;
  + Llh/o;
  + Lmi/v0;
  + Lok/v;
  + Lrj/c1;
  + Lrj/d1;
  + Lrj/e1;
  + Lsf/z;
  + Luf/g;
  + Lxe/l1;
  + Lxe/m1;
  + Lxj/z3;
  + Lz0/u5;
  + Results(query=
  + VLLFLLLLI
  + VLLFLLLLLI
  + VLLLLLLLZLLLLLI
  + [Lfm/a2;
  + [Lfm/b2;
  + [Lfm/b4;
  + [Lfm/e4;
  + [Lfm/f2;
  + [Lfm/i4;
  + [Lfm/v2;
  + [Lfm/w2;
  + [Lij/b1;
  + [Lij/n0;
  + [Lij/u0;
  + [Lij/u5;
  + [Lij/y;
  + [Lke/e2;
  + [Llh/h;
  + [Lmg/j;
  + [Lmi/g0;
  + [Lmi/k0;
  + [Lmo/i;
  + [Ln0/a1;
  + [Ln0/i0;
  + [Ln0/m0;
  + [Lrj/b0;
  + [Lrj/g0;
  + [Lrj/p0;
  + [Lrj/v0;
  + [Lrm/v;
  + [Lrm/y;
  + [Lsf/c;
  + [Lsf/s;
  + [Lsf/u;
  + [Lsi/a0;
  + [Lug/a3;
  + [Lug/k2;
  + [Lug/k3;
  + [Lug/r2;
  + [Lug/u2;
  + [Lug/x2;
  + [Lxe/h0;
  + [Lxj/t3;
  + [Lxj/y3;
  + [Ly4/t;
  + [Ly4/w;
  + [Lyk/z0;
  + [Lz0/l1;
  + [Lz0/m5;
  + [Lz0/t2;
  + [Lz0/t3;
  + onClear
  + onEnterManuallyFromInline
  + onEnterManuallyFromInline()V
  + onPredictionSelected
  + onPredictionSelected(Ljava/lang/String;)V
  + predictionId
  + r8-map-id-aeb1804bd67a19cda61cb7fb6b6174b96ba8adf9502db3f0776b74d949e67e6f
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":23,"pg-map-id":"aeb1804bd67a19cda61cb7fb6b6174b96ba8adf9502db3f0776b74d949e67e6f","r8-mode":"full","version":"8.13.19"}
  
  - Lag/d;
  - Lf4/n;
  - Lgd/k;
  - Lio/z;
  - Lkf/r;
  - Llf/r;
  - Lmg/t;
  - Lmo/j;
  - Lom/i;
  - Lse/i0;
  - Lsi/m0;
  - Lsj/t;
  - Lsj/u;
  - Lug/e4;
  - Lxi/f;
  - Ly0/u0;
  - Ly4/z;
  - VIZLI
  - VLLLLLLLZI
  - [Lfm/k2;
  - [Lfm/l2;
  - [Lfm/p1;
  - [Lfm/q3;
  - [Lfm/s1;
  - [Lfm/t1;
  - [Lfm/t3;
  - [Lfm/x3;
  - [Lij/m0;
  - [Lij/s0;
  - [Lij/s5;
  - [Lij/v;
  - [Lij/y0;
  - [Lke/b2;
  - [Llh/g;
  - [Lmg/k;
  - [Lmi/f0;
  - [Lmi/i0;
  - [Lmo/j;
  - [Ln0/g0;
  - [Ln0/l0;
  - [Ln0/z0;
  - [Lrj/e0;
  - [Lrj/n0;
  - [Lrj/u0;
  - [Lrj/y;
  - [Lrm/x;
  - [Lrm/z;
  - [Lsf/b;
  - [Lsf/r;
  - [Lsf/t;
  - [Lsi/b0;
  - [Lug/b3;
  - [Lug/l3;
  - [Lug/q2;
  - [Lug/t2;
  - [Lug/v2;
  - [Lug/z2;
  - [Lxe/g0;
  - [Lxj/s3;
  - [Lxj/v3;
  - [Ly4/u;
  - [Ly4/x;
  - [Lyk/y0;
  - [Lz0/k1;
  - [Lz0/l5;
  - [Lz0/s2;
  - [Lz0/s3;
  - r8-map-id-1a9381d66b36a2c437b2d8f46305491b722beaa37ec6889afd78b05521b9a7fb
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":23,"pg-map-id":"1a9381d66b36a2c437b2d8f46305491b722beaa37ec6889afd78b05521b9a7fb","r8-mode":"full","version":"8.13.19"}
  

TYPES:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   14311 │ 14319 │ +8 (+73 -65) 
  
  + Lfm/g5;
  + Lfm/h5;
  + Lfm/i5;
  + Lfm/j5;
  + Lfm/k5;
  + Lfm/l5;
  + Lfm/m5;
  + Lfm/n5;
  + Lfm/o5;
  + Lfm/p5;
  + Lg0/e2;
  + Lij/u5;
  + Lke/p2;
  + Llh/o;
  + Lmi/v0;
  + Lok/v;
  + Lrj/c1;
  + Lrj/d1;
  + Lrj/e1;
  + Lsf/z;
  + Luf/g;
  + Lxe/l1;
  + Lxe/m1;
  + Lxj/z3;
  + Lz0/u5;
  + [Lfm/a2;
  + [Lfm/b2;
  + [Lfm/b4;
  + [Lfm/e4;
  + [Lfm/f2;
  + [Lfm/i4;
  + [Lfm/v2;
  + [Lfm/w2;
  + [Lij/b1;
  + [Lij/n0;
  + [Lij/u0;
  + [Lij/u5;
  + [Lij/y;
  + [Lke/e2;
  + [Llh/h;
  + [Lmg/j;
  + [Lmi/g0;
  + [Lmi/k0;
  + [Lmo/i;
  + [Ln0/a1;
  + [Ln0/i0;
  + [Ln0/m0;
  + [Lrj/b0;
  + [Lrj/g0;
  + [Lrj/p0;
  + [Lrj/v0;
  + [Lrm/v;
  + [Lrm/y;
  + [Lsf/c;
  + [Lsf/s;
  + [Lsf/u;
  + [Lsi/a0;
  + [Lug/a3;
  + [Lug/k2;
  + [Lug/k3;
  + [Lug/r2;
  + [Lug/u2;
  + [Lug/x2;
  + [Lxe/h0;
  + [Lxj/t3;
  + [Lxj/y3;
  + [Ly4/t;
  + [Ly4/w;
  + [Lyk/z0;
  + [Lz0/l1;
  + [Lz0/m5;
  + [Lz0/t2;
  + [Lz0/t3;
  
  - Lag/d;
  - Lf4/n;
  - Lgd/k;
  - Lio/z;
  - Lkf/r;
  - Llf/r;
  - Lmg/t;
  - Lmo/j;
  - Lom/i;
  - Lse/i0;
  - Lsi/m0;
  - Lsj/t;
  - Lsj/u;
  - Lug/e4;
  - Lxi/f;
  - Ly0/u0;
  - Ly4/z;
  - [Lfm/k2;
  - [Lfm/l2;
  - [Lfm/p1;
  - [Lfm/q3;
  - [Lfm/s1;
  - [Lfm/t1;
  - [Lfm/t3;
  - [Lfm/x3;
  - [Lij/m0;
  - [Lij/s0;
  - [Lij/s5;
  - [Lij/v;
  - [Lij/y0;
  - [Lke/b2;
  - [Llh/g;
  - [Lmg/k;
  - [Lmi/f0;
  - [Lmi/i0;
  - [Lmo/j;
  - [Ln0/g0;
  - [Ln0/l0;
  - [Ln0/z0;
  - [Lrj/e0;
  - [Lrj/n0;
  - [Lrj/u0;
  - [Lrj/y;
  - [Lrm/x;
  - [Lrm/z;
  - [Lsf/b;
  - [Lsf/r;
  - [Lsf/t;
  - [Lsi/b0;
  - [Lug/b3;
  - [Lug/l3;
  - [Lug/q2;
  - [Lug/t2;
  - [Lug/v2;
...✂
ARSC
CONFIGS:

   old │ new │ diff       
  ─────┼─────┼────────────
   319 │ 320 │ +1 (+1 -0) 
  + drawable-nodpi
  

ENTRIES:

   old  │ new  │ diff       
  ──────┼──────┼────────────
   7479 │ 7483 │ +4 (+4 -0) 
  + drawable/stripe_google_maps_logo
  + string/stripe_address_enter_manually
  + string/stripe_address_google_maps
  + string/stripe_address_suggestions

@nidhi-stripe nidhi-stripe force-pushed the nidhig/address-element-inline-autocomplete-prototype branch from 39f3e69 to 123b1ec Compare June 11, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant