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 Verification Dialog UI #10047

Merged
merged 10 commits into from
Feb 5, 2025
Merged

Link Verification Dialog UI #10047

merged 10 commits into from
Feb 5, 2025

Conversation

toluo-stripe
Copy link
Contributor

@toluo-stripe toluo-stripe commented Jan 31, 2025

Summary

Render verification dialog in LinkActivity when linkViewModel.linkScreenState is VerificationDialog

Motivation

JIRA

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Screen.Recording.2025-01-31.at.12.42.13.AM.mov

Changelog

Copy link
Contributor

github-actions bot commented Jan 31, 2025

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.1 MiB │   4.1 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 KiB │     8 KiB │  0 B 
      res │ 302.6 KiB │ 302.6 KiB │  0 B │ 456.7 KiB │ 456.7 KiB │  0 B 
   native │   6.2 MiB │   6.2 MiB │  0 B │  15.8 MiB │  15.8 MiB │  0 B 
    asset │   7.1 KiB │   7.1 KiB │  0 B │   6.9 KiB │   6.9 KiB │  0 B 
    other │  90.8 KiB │  90.8 KiB │ -3 B │   171 KiB │   171 KiB │  0 B 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
    total │   9.6 MiB │   9.6 MiB │ -3 B │  21.5 MiB │  21.5 MiB │  0 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 19975 │ 19975 │ 0 (+0 -0) 
   types │  6193 │  6193 │ 0 (+0 -0) 
 classes │  4985 │  4985 │ 0 (+0 -0) 
 methods │ 29820 │ 29820 │ 0 (+0 -0) 
  fields │ 17538 │ 17538 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  164 │  164 │  0   
 entries │ 3624 │ 3624 │  0
APK
   compressed    │   uncompressed   │                                           
──────────┬──────┼───────────┬──────┤                                           
 size     │ diff │ size      │ diff │ path                                      
──────────┼──────┼───────────┼──────┼───────────────────────────────────────────
 28.6 KiB │ -4 B │  63.2 KiB │  0 B │ ∆ META-INF/CERT.SF                        
    272 B │ +1 B │     120 B │  0 B │ ∆ META-INF/version-control-info.textproto 
  1.2 KiB │ -1 B │   1.2 KiB │  0 B │ ∆ META-INF/CERT.RSA                       
 25.4 KiB │ +1 B │  63.1 KiB │  0 B │ ∆ META-INF/MANIFEST.MF                    
──────────┼──────┼───────────┼──────┼───────────────────────────────────────────
 55.4 KiB │ -3 B │ 127.6 KiB │  0 B │ (total)

@toluo-stripe toluo-stripe changed the title 2FA dialog UI Link Verification Dialog UI Jan 31, 2025
@toluo-stripe toluo-stripe marked this pull request as ready for review January 31, 2025 20:22
@toluo-stripe toluo-stripe requested review from a team as code owners January 31, 2025 20:22
@toluo-stripe toluo-stripe force-pushed the tolu/link/2fa_screen branch 4 times, most recently from b8f9515 to 89db124 Compare February 4, 2025 06:53
Fix lint

Update paymentsheet.api

Rebase

Update LinkActivityTest.kt

Update LinkActivityTest.kt

Update tests

Update strings.xml

revert string changes

Fix tests

Clean up VM

Fix VM tests
Comment on lines -130 to -132
viewModelScope.launch {
linkAccountManager.logOut()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was causing an auth session error after dismissing the 2fa dialog

linkAccount = linkAccount,
isDialog = true,
onVerificationSucceeded = onVerificationSucceeded,
onChangeEmailClicked = { },
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a way to avoid having to pass in onChangeEmailClicked for the verification dialog? Presumably this is {} because we don't display that button on the verification dialog?

If the solution to this isn't super straightforward (which I'm guessing it isn't), no need to block on this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

this class name looks like it has a typo in it (it currently says Sreen instead of Screen) -- can you rename it?

@@ -151,6 +153,62 @@ internal fun VerificationBody(
}
}

@Composable
private fun TopSection(
Copy link
Collaborator

Choose a reason for hiding this comment

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

could we name this something more idiomatic? e.g. Header?

not blocking

@@ -736,7 +736,7 @@ internal class LinkActivityViewModelTest {
}
}

private class FakeNativeLinkComponent(
internal class FakeNativeLinkComponent(
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you extract this into its own class rather than making it visible here? If we need to use it in another test, then we should pull it out, rather than creating a dependency from one test class onto another

@@ -180,7 +180,7 @@ internal class VerificationViewModel @Inject constructor(
linkAccount: LinkAccount,
isDialog: Boolean,
onVerificationSucceeded: () -> Unit,
onChangeEmailClicked: () -> Unit,
onChangeEmailClicked: () -> Unit = {},
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure this is the right fix here -- we probably don't want to default this to doing nothing. If we were to introduce a new use of VerificationViewModel that did show the change email button, this would be a foot gun for making that button unresponsive.

I was thinking that there might be a way to not require this parameter when we are not going to show the change email button

I'm ok merging this for now and we can figure out a better solution later

@toluo-stripe toluo-stripe merged commit 0add7e1 into master Feb 5, 2025
13 checks passed
@toluo-stripe toluo-stripe deleted the tolu/link/2fa_screen branch February 5, 2025 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants