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

Render FC auth flow in bottom sheet #8443

Merged
merged 1 commit into from May 21, 2024

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented May 9, 2024

Summary

This pull request is a follow-up to #8442. It transitions the Financial Connections auth flow from a full-screen view to a sheet.

Motivation

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screen recording

Recording

sheet.webm

Changelog

@tillh-stripe tillh-stripe force-pushed the tillh/stripe-bottom-sheet-layout branch from 9c2bf0c to 22aa61d Compare May 9, 2024 14:41
@tillh-stripe tillh-stripe force-pushed the tillh/financial-connections-in-bottom-sheet branch from 2988217 to f02ce7c Compare May 9, 2024 14:41
Copy link
Contributor

github-actions bot commented May 9, 2024

Diffuse output:

OLD: identity-example-release-base.apk (signature: V1, V2)
NEW: identity-example-release-pr.apk (signature: V1, V2)

          │          compressed          │         uncompressed         
          ├───────────┬───────────┬──────┼───────────┬───────────┬──────
 APK      │ old       │ new       │ diff │ old       │ new       │ diff 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
      dex │     2 MiB │     2 MiB │  0 B │   4.3 MiB │   4.3 MiB │  0 B 
     arsc │     1 MiB │     1 MiB │  0 B │     1 MiB │     1 MiB │  0 B 
 manifest │   2.3 KiB │   2.3 KiB │  0 B │   8.1 KiB │   8.1 KiB │  0 B 
      res │ 301.5 KiB │ 301.5 KiB │  0 B │   455 KiB │   455 KiB │  0 B 
   native │   7.3 MiB │   7.3 MiB │  0 B │  18.4 MiB │  18.4 MiB │  0 B 
    asset │   1.5 MiB │   1.5 MiB │  0 B │   1.5 MiB │   1.5 MiB │  0 B 
    other │    87 KiB │    87 KiB │ +9 B │ 161.5 KiB │ 161.5 KiB │  0 B 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
    total │  12.2 MiB │  12.2 MiB │ +9 B │  25.8 MiB │  25.8 MiB │  0 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 21688 │ 21688 │ 0 (+0 -0) 
   types │  6869 │  6869 │ 0 (+0 -0) 
 classes │  5634 │  5634 │ 0 (+0 -0) 
 methods │ 31448 │ 31448 │ 0 (+0 -0) 
  fields │ 18315 │ 18315 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  164 │  164 │  0   
 entries │ 3404 │ 3404 │  0
APK
    compressed    │   uncompressed   │                        
──────────┬───────┼───────────┬──────┤                        
 size     │ diff  │ size      │ diff │ path                   
──────────┼───────┼───────────┼──────┼────────────────────────
 29.1 KiB │ +10 B │    64 KiB │  0 B │ ∆ META-INF/CERT.SF     
  1.2 KiB │  -2 B │   1.2 KiB │  0 B │ ∆ META-INF/CERT.RSA    
 25.9 KiB │  +1 B │  63.9 KiB │  0 B │ ∆ META-INF/MANIFEST.MF 
──────────┼───────┼───────────┼──────┼────────────────────────
 56.1 KiB │  +9 B │ 129.1 KiB │  0 B │ (total)

@tillh-stripe tillh-stripe force-pushed the tillh/stripe-bottom-sheet-layout branch 2 times, most recently from 32aa4ea to 356b9f3 Compare May 9, 2024 19:44
@tillh-stripe tillh-stripe force-pushed the tillh/financial-connections-in-bottom-sheet branch from f02ce7c to 13064ba Compare May 9, 2024 19:44
@tillh-stripe tillh-stripe force-pushed the tillh/stripe-bottom-sheet-layout branch from 356b9f3 to 70aa981 Compare May 9, 2024 21:31
@tillh-stripe tillh-stripe force-pushed the tillh/financial-connections-in-bottom-sheet branch from 13064ba to 6301f92 Compare May 9, 2024 21:47
@tillh-stripe tillh-stripe force-pushed the tillh/stripe-bottom-sheet-layout branch from 70aa981 to e7377df Compare May 9, 2024 23:00
@tillh-stripe tillh-stripe force-pushed the tillh/financial-connections-in-bottom-sheet branch 4 times, most recently from 11c31f1 to 5c2b4b9 Compare May 9, 2024 23:11
@tillh-stripe tillh-stripe force-pushed the tillh/stripe-bottom-sheet-layout branch 2 times, most recently from a68be8e to 67a5214 Compare May 10, 2024 15:00
@tillh-stripe tillh-stripe force-pushed the tillh/financial-connections-in-bottom-sheet branch from 5c2b4b9 to 3871dbd Compare May 10, 2024 15:01
@tillh-stripe tillh-stripe force-pushed the tillh/stripe-bottom-sheet-layout branch from 7cc1963 to 2152938 Compare May 10, 2024 16:52
Base automatically changed from tillh/stripe-bottom-sheet-layout to master May 10, 2024 17:10
@tillh-stripe tillh-stripe force-pushed the tillh/financial-connections-in-bottom-sheet branch 2 times, most recently from 4d6e9d6 to 9d78fe8 Compare May 13, 2024 20:10
@tillh-stripe tillh-stripe force-pushed the tillh/financial-connections-in-bottom-sheet branch from 9d78fe8 to 204e240 Compare May 21, 2024 14:50
<item name="colorAccent">@color/stripe_accent_color_default</item>
<item name="colorControlNormal">@color/stripe_control_normal_color_default</item>
<item name="colorPrimary">@color/stripe_toolbar_color_default</item>
<item name="colorPrimaryDark">@color/stripe_toolbar_color_default_dark</item>
<item name="titleTextColor">@color/stripe_title_text_color</item>
<item name="android:textColorSecondary">@color/stripe_text_color_secondary</item>
<item name="android:windowIsTranslucent">true</item>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding these attributes into the base theme, just like PaymentSheet.

/**
* handle state changes here.
*/
private suspend fun handleViewEffect(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved the view effect handling here to allow it to be called from Compose.

@@ -130,7 +130,7 @@ internal class FinancialConnectionsSheetViewModel @Inject constructor(
val manifest = sync.manifest
val isInstantDebits = stateFlow.value.isInstantDebits
val nativeAuthFlowEnabled = nativeRouter.nativeAuthFlowEnabled(manifest, isInstantDebits)
viewModelScope.launch { nativeRouter.logExposure(manifest, isInstantDebits) }
nativeRouter.logExposure(manifest, isInstantDebits)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Drive-by fix: This doesn’t need to be suspending anymore.

initialPane = state.initialPane,
testMode = state.testMode,
val bottomSheetState = rememberStripeBottomSheetState(
initialValue = ModalBottomSheetValue.Expanded,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We launch this expanded, because FinancialConnectionsSheetActivity is already open.

@tillh-stripe tillh-stripe marked this pull request as ready for review May 21, 2024 16:59
@tillh-stripe tillh-stripe requested review from a team as code owners May 21, 2024 16:59
@tillh-stripe tillh-stripe requested review from carlosmuvi-stripe and removed request for samer-stripe May 21, 2024 17:00
Copy link
Collaborator

@carlosmuvi-stripe carlosmuvi-stripe left a comment

Choose a reason for hiding this comment

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

This is amazing! Did a bunch of testing (app2app, web-flow, etc) and 👨‍🍳

@tillh-stripe tillh-stripe merged commit aa26b4e into master May 21, 2024
12 checks passed
@tillh-stripe tillh-stripe deleted the tillh/financial-connections-in-bottom-sheet branch May 21, 2024 20:07
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.

None yet

2 participants