Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link Wallet payment method list UI #9691

Merged
merged 14 commits into from
Nov 28, 2024
Merged

Conversation

toluo-stripe
Copy link
Contributor

@toluo-stripe toluo-stripe commented Nov 21, 2024

Summary

Payment methods list on wallet screen

Motivation

JIRA

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Screen.Recording.2024-11-26.at.12.38.15.PM.mov

Changelog

Copy link
Contributor

github-actions bot commented Nov 21, 2024

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 │   3.9 MiB │   3.9 MiB │   +8 KiB │  8.5 MiB │  8.5 MiB │ +21.3 KiB 
     arsc │   2.3 MiB │   2.3 MiB │   +724 B │  2.3 MiB │  2.3 MiB │    +724 B 
 manifest │     5 KiB │     5 KiB │      0 B │ 24.9 KiB │ 24.9 KiB │       0 B 
      res │ 906.3 KiB │ 906.3 KiB │      0 B │  1.4 MiB │  1.4 MiB │       0 B 
   native │   2.6 MiB │   2.6 MiB │      0 B │    6 MiB │    6 MiB │       0 B 
    asset │   1.6 MiB │   1.6 MiB │ -1.4 KiB │  1.6 MiB │  1.6 MiB │  -1.4 KiB 
    other │   1.4 MiB │   1.4 MiB │     -7 B │  1.6 MiB │  1.6 MiB │       0 B 
──────────┼───────────┼───────────┼──────────┼──────────┼──────────┼───────────
    total │  12.7 MiB │  12.7 MiB │ +7.3 KiB │ 21.5 MiB │ 21.5 MiB │ +20.6 KiB 

 DEX     │ old   │ new   │ diff              
─────────┼───────┼───────┼───────────────────
   files │     1 │     1 │   0               
 strings │ 40398 │ 40443 │ +45 (+100 -55)    
   types │ 13936 │ 13957 │ +21 (+74 -53)     
 classes │ 11620 │ 11641 │ +21 (+37 -16)     
 methods │ 59356 │ 59432 │ +76 (+4319 -4243) 
  fields │ 39588 │ 39656 │ +68 (+2887 -2819) 

 ARSC    │ old  │ new  │ diff       
─────────┼──────┼──────┼────────────
 configs │  243 │  243 │  0         
 entries │ 6202 │ 6203 │ +1 (+1 -0)
APK
     compressed      │     uncompressed      │                                
──────────┬──────────┼───────────┬───────────┤                                
 size     │ diff     │ size      │ diff      │ path                           
──────────┼──────────┼───────────┼───────────┼────────────────────────────────
  3.9 MiB │   +8 KiB │   8.5 MiB │ +21.3 KiB │ ∆ classes.dex                  
  6.4 KiB │ -1.4 KiB │   6.3 KiB │  -1.4 KiB │ ∆ assets/dexopt/baseline.prof  
  2.3 MiB │   +724 B │   2.3 MiB │    +724 B │ ∆ resources.arsc               
    989 B │    -10 B │     857 B │     -10 B │ ∆ assets/dexopt/baseline.profm 
 53.4 KiB │     -4 B │ 118.3 KiB │       0 B │ ∆ META-INF/CERT.SF             
  1.2 KiB │     -2 B │   1.2 KiB │       0 B │ ∆ META-INF/CERT.RSA            
 50.1 KiB │     -1 B │ 118.3 KiB │       0 B │ ∆ META-INF/MANIFEST.MF         
──────────┼──────────┼───────────┼───────────┼────────────────────────────────
  6.3 MiB │ +7.3 KiB │  11.1 MiB │ +20.6 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff           
  ───────┼───────┼────────────────
   40398 │ 40443 │ +45 (+100 -55) 
  
  + +multiple_funding_sources@
  + , selectedItem=
  + <a href="https://stripe.com/legal/ach-payments/authorization">
  + LB6/a;
  + LB6/b;
  + LB6/c;
  + LB6/d;
  + LB6/e;
  + LB6/f;
  + LB6/g;
  + LB6/h;
  + LB6/i;
  + LB6/j;
  + LB6/k;
  + LB6/l;
  + LB6/m;
  + LB6/n;
  + LB6/o;
  + LB6/p;
  + LB6/q;
  + LB6/r;
  + LB6/s;
  + LB6/t;
  + LB6/u;
  + LI7/v;
  + LLFJL
  + LM7/z;
  + LN6/S;
  + LQ9/e;
  + LS/F3;
  + La/a;
  + Lg1/p;
  + Lg5/e;
  + Lg9/f;
  + Ln6/F;
  + Lo6/o;
  + Lr6/c;
  + Ls6/n;
  + Lv6/w;
  + Lv6/x;
  + Ly7/q;
  + PaymentMethod
  + VZLZLLI
  + WalletUiState(paymentDetailsList=
  + WalletViewModel Fatal error: 
  + [LD5/n;
  + [LD8/B1;
  + [LD8/J1;
  + [LD8/M1;
  + [LD8/P1;
  + [LD8/W1;
  + [LD8/a2;
  + [LD8/b1;
  + [LD8/c2;
  + [LD8/d1;
  + [LD8/g1;
  + [LD8/j1;
  + [LD8/q1;
  + [LD8/t1;
  + [LD8/x1;
  + [LI7/h;
  + [LM7/l;
  + [LM8/A0;
  + [LM8/N;
  + [LM8/O0;
  + [LM8/O;
  + [LM8/S0;
  + [LM8/S;
  + [LM8/V0;
  + [LM8/g0;
  + [LM8/h0;
  + [LS/l2;
  + [LS/z3;
  + [LS7/v0;
  + [LX8/E;
  + [LX8/x;
  + [Lg5/e;
  + [Lh6/o;
  + [Ln6/A;
  + [Ls0/v;
  + [Lv6/x;
  + [Lz5/d;
  + collapsed_wallet_chevron_icon_tag
  + collapsed_wallet_header_tag
  + collapsed_wallet_payment_details_tag
  + collapsed_wallet_row_tag
  + consumers/payment_details/list
  + linkAccount
  + onExpandedChanged
  + onItemSelected(Lcom/stripe/android/model/ConsumerPaymentDetails_PaymentDetails;)V
  + onMenuButtonClick
  + paymentDetailsList
  + payment_detail_
  + selectedPaymentMethod
  + wallet_add_payment_method_row
  + wallet_payment_detail_item_radio_button
  + wallet_screen_expanded_row_header
  + wallet_screen_loader_tag
  + wallet_screen_payment_methods_list
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"ee2fd02","r8-mode":"full","version":"8.7.14"}
  
  - LD5/W;
  - LD5/X;
  - LD7/m;
  - LD8/d2;
  - LI5/c;
  - LJ5/G;
  - LJ5/H;
  - LL5/t;
  - LM8/E1;
  - LM8/F1;
  - LR/c0;
  - Lb3/i;
  - Lh/V;
  - Lh2/h;
  - Lw5/e;
  - Lz5/y;
  - WalletScreen
  - [LD5/o;
  - [LD8/D1;
  - [LD8/K1;
  - [LD8/N1;
  - [LD8/Q1;
  - [LD8/X1;
  - [LD8/b2;
  - [LD8/c1;
  - [LD8/d2;
  - [LD8/e1;
  - [LD8/h1;
  - [LD8/k1;
  - [LD8/r1;
  - [LD8/v1;
  - [LD8/y1;
  - [LI7/g;
  - [LM7/i;
  - [LM8/C0;
  - [LM8/P;
  - [LM8/Q0;
  - [LM8/Q;
  - [LM8/U0;
  - [LM8/U;
  - [LM8/X0;
  - [LM8/i0;
  - [LM8/j0;
  - [LS/k2;
  - [LS/y3;
  - [LS7/t0;
  - [LX8/D;
  - [LX8/w;
  - [Lg5/d;
  - [Lh6/n;
  - [Ln6/z;
  - [Ls0/u;
  - [Lv6/v;
  - [Lz5/e;
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"beb3390","r8-mode":"full","version":"8.7.14"}
  

TYPES:

   old   │ new   │ diff          
  ───────┼───────┼───────────────
   13936 │ 13957 │ +21 (+74 -53) 
  
  + LB6/a;
  + LB6/b;
  + LB6/c;
  + LB6/d;
  + LB6/e;
  + LB6/f;
  + LB6/g;
  + LB6/h;
  + LB6/i;
  + LB6/j;
  + LB6/k;
  + LB6/l;
  + LB6/m;
  + LB6/n;
  + LB6/o;
  + LB6/p;
  + LB6/q;
  + LB6/r;
  + LB6/s;
  + LB6/t;
  + LB6/u;
  + LI7/v;
  + LM7/z;
  + LN6/S;
  + LQ9/e;
  + LS/F3;
  + La/a;
  + Lg1/p;
  + Lg5/e;
  + Lg9/f;
  + Ln6/F;
  + Lo6/o;
  + Lr6/c;
  + Ls6/n;
  + Lv6/w;
  + Lv6/x;
  + Ly7/q;
  + [LD5/n;
  + [LD8/B1;
  + [LD8/J1;
  + [LD8/M1;
  + [LD8/P1;
  + [LD8/W1;
  + [LD8/a2;
  + [LD8/b1;
  + [LD8/c2;
  + [LD8/d1;
  + [LD8/g1;
  + [LD8/j1;
  + [LD8/q1;
  + [LD8/t1;
  + [LD8/x1;
  + [LI7/h;
  + [LM7/l;
  + [LM8/A0;
  + [LM8/N;
  + [LM8/O0;
  + [LM8/O;
  + [LM8/S0;
  + [LM8/S;
  + [LM8/V0;
  + [LM8/g0;
  + [LM8/h0;
  + [LS/l2;
  + [LS/z3;
  + [LS7/v0;
  + [LX8/E;
  + [LX8/x;
  + [Lg5/e;
  + [Lh6/o;
  + [Ln6/A;
  + [Ls0/v;
  + [Lv6/x;
  + [Lz5/d;
  
  - LD5/W;
  - LD5/X;
  - LD7/m;
  - LD8/d2;
  - LI5/c;
  - LJ5/G;
  - LJ5/H;
  - LL5/t;
  - LM8/E1;
  - LM8/F1;
  - LR/c0;
  - Lb3/i;
  - Lh/V;
  - Lh2/h;
  - Lw5/e;
  - Lz5/y;
  - [LD5/o;
  - [LD8/D1;
  - [LD8/K1;
  - [LD8/N1;
  - [LD8/Q1;
  - [LD8/X1;
  - [LD8/b2;
  - [LD8/c1;
  - [LD8/d2;
  - [LD8/e1;
  - [LD8/h1;
  - [LD8/k1;
  - [LD8/r1;
  - [LD8/v1;
  - [LD8/y1;
  - [LI7/g;
  - [LM7/i;
  - [LM8/C0;
  - [LM8/P;
  - [LM8/Q0;
  - [LM8/Q;
  - [LM8/U0;
  - [LM8/U;
  - [LM8/X0;
  - [LM8/i0;
  - [LM8/j0;
  - [LS/k2;
  - [LS/y3;
  - [LS7/t0;
  - [LX8/D;
  - [LX8/w;
  - [Lg5/d;
  - [Lh6/n;
  - [Ln6/z;
  - [Ls0/u;
  - [Lv6/v;
  - [Lz5/e;
  

METHODS:

   old   │ new   │ diff              
  ───────┼───────┼───────────────────
   59356 │ 59432 │ +76 (
...✂
ARSC
ENTRIES:

   old  │ new  │ diff       
  ──────┼──────┼────────────
   6202 │ 6203 │ +1 (+1 -0) 
  + string/stripe_wallet_expand_accessibility

@toluo-stripe toluo-stripe force-pushed the tolu/link/wallet_list_ui branch 3 times, most recently from a0a90d5 to b59f90a Compare November 26, 2024 06:51
@toluo-stripe toluo-stripe changed the title Tolu/link/wallet list UI Link Wallet payment method list UI Nov 26, 2024
@toluo-stripe toluo-stripe marked this pull request as ready for review November 26, 2024 17:39
@toluo-stripe toluo-stripe requested review from a team as code owners November 26, 2024 17:39

onCollapsedWalletRow().performClick()

onWalletAddPaymentMethodRow().assertIsDisplayed().assertHasClickAction()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you run these tests with shampoo rule and make sure they're not flaky? I've seen test setups like this flake because the compose component is not immediately visible. We could also fix this pre-emptively by adding a composeTestRule.waitUntil call to ensure that the node is visible before asserting anything. You can add these to the helpers themselves (e.g. to the implementation of onWalletAddPaymentMethodRow)

val paymentDetailsList: List<ConsumerPaymentDetails.PaymentDetails>,
val selectedItem: ConsumerPaymentDetails.PaymentDetails?,
val isProcessing: Boolean,
val isExpanded: Boolean
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does isExpanded need to be part of the state that the VM knows about?

Since this seems very specific to the UI and not actually impacted by anything in the VM, I think we could just include it within the composable itself. Just thinking that would be nice for simplicity + division of responsibilities (ie if the VM doesn't need to know about it, we don't need to worry about setting it properly in the VM, etc)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I'll take it out

.animateContentSize()
) {
val selectedItem = state.selectedItem
if (state.isExpanded || selectedItem == null) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that if there is no selected item, then the user won't be able to click the collapse/expand chevron to collapse the PMs list?

That experience sounds potentially annoying -- could we instead just select a PM by default to ensure that the user always has a PM selected to be used in the CollapsedPaymentDetails composable? There are probably other solutions to this too. I feel like we should be able to show the collapsed PM details even if there isn't a selected PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The selectedItem can never be null unless there is no payment method available. In the case where there is no payment method, the user will be redirected the CardCreation screen, but that has not been built yet.

@toluo-stripe toluo-stripe merged commit 5e0bcae into master Nov 28, 2024
16 checks passed
@toluo-stripe toluo-stripe deleted the tolu/link/wallet_list_ui branch November 28, 2024 19:27
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.

3 participants