Skip to content

Me onboarding banner#21760

Merged
nbradbury merged 70 commits intotrunkfrom
issue/verify-email
Mar 21, 2025
Merged

Me onboarding banner#21760
nbradbury merged 70 commits intotrunkfrom
issue/verify-email

Conversation

@nbradbury
Copy link
Copy Markdown
Contributor

@nbradbury nbradbury commented Mar 14, 2025

This PR adds a banner to the Me screen asking users to verify their email address if they haven't already done so. Before testing, I recommend viewing the compose previews in EmailVerificationBanner to see the various states. Note that if the previews are dimmed just ignore it - this appears to be a recent Android Studio issue.

@crazytonyli I'm not expecting you to review this, I just wanted you to see the Android implementation in case you have suggestions.

@ParaskP7 And I'm not expecting you to test this, I simply thought it would be good to have another Android dev look at the code, especially the ViewModel.

android-flow.mp4

To test success:

  • Create a new account in the app (tip: GMail plus addressing can simplify this)
  • Switch to the Me tab
  • Note that you see a banner asking to verify your email
  • Tap "Send verification link"
  • Note the banner shows a progress spinner and is then replaced by a message saying the link was sent
  • Go to your inbox and click the verification link
  • Return to the app and notice that it eventually detects the email has been verified and the banner disappears

To test failure:

  • Set the initial verification state to UNVERIFIED here
  • Sign in using an account that has already been verified
  • Note the verification banner appears on the Me tab
  • Tap "Send verification link"
  • Note that you soon see an error saying the email has already been verified
  • Tap to retry and note the same thing occurs

Some notes about this PR:

  • I tried to keep as much logic out of the Me screen as possible, making it easier to reuse the banner on the "No Sites" screen (this will be in a separate PR: TMPFRG-631-linear-issue)
  • The Me screen is an XML-based UI, but I wanted to use Compose for the banner UI. So the main UI for the banner is Compose-based, and I used an XML-based ComposeView in the Me screen to host it.
  • I'm not thrilled with the design here and am certainly open to suggestions, but my goal was to match the existing Gravatar banner that appears at the bottom of the Me screen:

Related iOS PR

@nbradbury nbradbury added the /Me label Mar 14, 2025
@dangermattic
Copy link
Copy Markdown
Collaborator

dangermattic commented Mar 14, 2025

5 Warnings
⚠️ strings.xml files should only be updated on release branches, when the translations are downloaded by our automation.
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ Class EmailVerificationViewModel is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ Class VerificationState is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Mar 14, 2025

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr21760-fa7d27e
Commitfa7d27e
Direct Downloadwordpress-prototype-build-pr21760-fa7d27e.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Mar 14, 2025

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr21760-fa7d27e
Commitfa7d27e
Direct Downloadjetpack-prototype-build-pr21760-fa7d27e.apk
Note: Google Login is not supported on these builds.

@nbradbury nbradbury marked this pull request as draft March 20, 2025 15:34
@nbradbury nbradbury marked this pull request as ready for review March 20, 2025 18:07
text = stringResource(
R.string.me_email_verification_sent_description,
emailAddress
),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I noticed in the video that the full text was "Check your inbox at for the confirmation ...". Maybe the emailAddress can be an empty string? In that case, we should not use the string format ... at %s ....

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@crazytonyli Thanks for catching that, it was the result of a recent change. Fixed in 940a469.

email

Copy link
Copy Markdown
Member

@dcalhoun dcalhoun left a comment

Choose a reason for hiding this comment

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

The testing plan succeeded for me. I left a few suggestions to consider. Please feel free to await further feedback, if desired.

@sonarqubecloud
Copy link
Copy Markdown

@nbradbury
Copy link
Copy Markdown
Contributor Author

@ParaskP7 This PR has been approved so I'll go ahead and merge it to avoid it "hanging around." However, my next task (TMPFRG-631-linear-issue) involves this same code, so if you still want to look at this PR feel free to share any concerns you find and I'll address them in the next PR.

@nbradbury nbradbury merged commit 92664d4 into trunk Mar 21, 2025
24 checks passed
@nbradbury nbradbury deleted the issue/verify-email branch March 21, 2025 20:15
@ParaskP7
Copy link
Copy Markdown
Contributor

👋 @nbradbury and once again thanks for the ping!

@ParaskP7 This PR has been approved so I'll go ahead and merge it to avoid it "hanging around." However, my next task (TMPFRG-631-linear-issue) involves this same code, so if you still want to look at this PR feel free to share any concerns you find and I'll address them in the next PR.

Although I understand you are just trying to get another pair of eyes on that, please don't get blocked by me on such UI related PRs. I usually won't be able to be much of help to you unless I put effort to catch-up with the ins-and-out on the requirement(s), brush up my knowledge on advanced coroutine use-cases (etc), it not being something I do as part of my Core Android role for a while now.

FYI: Other product teams wouldn't ask us for such reviews and as such we haven't done that for a while, nor it is expected from us. I do understand the situation with JP/WPAndroid might be a bit different, fewer resources and all. I just wanted to set clear expectations, nothing more, nothing less. 🙏

Having said that, I did do a skim review on the ViewModel side of things. Again, could help you much, without me investing more time on it. The only suggestion for me would be to add an associated view model test suite so that to help any readers understand any or all the use cases involved without needing to have it trigger this whole flow via manual UI testing. This will also help keeping this view model class be more maintainable in the long run. 🤔

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.

6 participants