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

Add email verification screen #6125

Merged
merged 10 commits into from
May 10, 2022
Merged

Conversation

pixlwave
Copy link
Member

@pixlwave pixlwave commented May 5, 2022

This PR adds the views, but it isn't yet part of the flow and the coordinator still requires an implementation of polling for the homeserver to confirm when the link was tapped.

Issue: #5649

Light Address Input Light Waiting Dark Address Input Dark Waiting
Screenshot 2022-05-05 at 12 46 02 pm Screenshot 2022-05-05 at 12 46 10 pm Screenshot 2022-05-05 at 12 46 19 pm Screenshot 2022-05-05 at 12 46 26 pm

@github-actions
Copy link

github-actions bot commented May 5, 2022

📱 Scan the QR code below to install the build for this PR.
🔒 This build is for internal testing purpose. Only devices listed in the ad-hoc provisioning profile can install Element Alpha.

QR code

If you can't scan the QR code you can install the build via this link: https://i.diawi.com/jQNUE3

@pixlwave pixlwave requested review from a team, ismailgulek, aringenbach and Anderas and removed request for a team and ismailgulek May 5, 2022 14:58
override func process(viewAction: AuthenticationVerifyEmailViewAction) {
switch viewAction {
case .send:
Task { await completion?(.send(state.bindings.emailAddress)) }
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that Action will often be a close 1:1 to Result, I wonder if we could avoid this by declaring distinct actions on the view model instead, cutting out one layer of indirection. So instead of callback, we would have sendAction, resendAction and cancelAction, something along the lines of this. What do you think?

Copy link
Member Author

@pixlwave pixlwave May 9, 2022

Choose a reason for hiding this comment

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

Whilst I very much like the idea of this, I'm not sure it's worth changing for this screen as it will

  • break consistency with all other SwiftUI screens which will could make maintaining it harder.
  • remove an easy place to insert a view action that doesn't need to interact with coordinator if one is needed in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

We would still retain Action (some of which don't need to interact with coordinators), only cut out the Result type which only calls some internal function on the coordinator. So in essence the body of that internal method would be assigned directly as actionCallback. But as you say, it is fine to keep for consistency sake and see how it evolved with scale

/// - Parameters:
/// - label: The label to show on the indicator.
/// - isInteractionBlocking: Whether the indicator should block any user interaction.
@MainActor private func startLoading(label: String = VectorL10n.loading, isInteractionBlocking: Bool = true) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't seem to be using nondefault parameters in this class and the method is private, so maybe they are not needed?

Copy link
Member Author

@pixlwave pixlwave May 9, 2022

Choose a reason for hiding this comment

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

Updated. Worth saying that this is how the template generates the function, so most screens will probably have this method left in this format.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm then we might have to re-evaluate how we use the templates. In my understanding templates should both speed up the creation of repeated classes as well as help attain some amount of consistency, but at the end of the day it is the final code that matters, and how self-evident it is when we read it a year from now (when the template origin is long obscured).

@pixlwave pixlwave requested a review from Anderas May 9, 2022 11:07
@pixlwave pixlwave requested a review from aringenbach May 10, 2022 11:05
@pixlwave
Copy link
Member Author

Updated with a readableFrame modifier. Will go through and update other screens once this is merged.

Copy link
Contributor

@aringenbach aringenbach left a comment

Choose a reason for hiding this comment

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

LGTM

@pixlwave pixlwave merged commit 4a9ace0 into develop May 10, 2022
@pixlwave pixlwave deleted the doug/5649_auth_email_verification branch May 10, 2022 13:09
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