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

Split TOTP instruction into two steps #100

Merged
merged 12 commits into from
Apr 13, 2023

Conversation

renintw
Copy link
Contributor

@renintw renintw commented Mar 28, 2023

Fixes #93

This PR

  • Adds Intro component for totp introduction.
  • Fixes the screen height of each step so when switching step, no jitter would happen.
  • Adds AutoTabbingInput component
    • Only number can be submitted
    • Supports Auto Tabbing and 'backspace'
  • Aligns styles with design

Screencast

totp.mp4

TODO

  • Lint after merging.
  • Is there a better place for the Error Notice, or the current layout is acceptable? (screencast 0:40) @jasmussen @iandunn

Update

error

@renintw renintw requested a review from iandunn March 28, 2023 19:09
@renintw renintw self-assigned this Mar 28, 2023
@renintw renintw added enhancement New feature or request ui Related to user interface labels Mar 28, 2023
@renintw renintw requested a review from StevenDufresne March 28, 2023 19:10
@renintw renintw force-pushed the enhance/split-2fa-intruction-into-two-steps branch from 6ee043a to e700642 Compare March 28, 2023 19:38
background: #3858E9 !important;
border-color: #3858E9 !important;
color: $white !important;
margin-right: 0 !important;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably not a good idea to use that many !important, but as I don't want to build a button from scratch here, I just overrode the styles of Button from Gutenberg.

margin-right: 24px;
}
}
}
Copy link
Contributor Author

@renintw renintw Mar 28, 2023

Choose a reason for hiding this comment

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

In this PR, there are still some files that haven't been well formatted yet. I will use the linter to fix them all at once later in a separate commit.

setInputs={setInputs}
/>

<Button variant="link" onClick={ handleClick }>Previous</Button>
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this differ from the "cancel" button under the 6 inputs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, right! Originally, when the cancel was clicked, it would return to the account status screen. Replacing previous for that would make the look better. Thanks!

Copy link
Contributor Author

@renintw renintw Apr 13, 2023

Choose a reason for hiding this comment

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

I found that it makes sense to me to use the Cancel button to clear all 6 inputs and keep the previous button.
Commit added: Let Cancel clear all the inputs

@StevenDufresne
Copy link
Contributor

I don't find the introduction tab does enough for it to warrant it's own tab to be honest. If it did a better job helping the setup, I would be interested in it, but since it just lists a few links, it seems like an extra interaction. I personally like how github does it:

Screenshot 2023-03-29 at 8 51 53 AM

I do very much like the input updates however. Does it make sense to split this up into those two features? One were we just update the code scan inputs and one that includes this extra "step"?

@jasmussen
Copy link
Collaborator

Thanks for the ping, thank you for the video, that's useful as I'm not able to review the checked out branch. Thank you also for the attention to detail.

First off, I think that longer term we should move towards something like this.

Screenshot 2023-03-29 at 10 03 37

That is:

  • A new notice component
  • The new colors, including the blueberry and pomegrade.

For the near term, it looks a bit off to combine the blueberry with the classic WordPress blue. So you can think of the blueberry as a "spot color" — it should always be the spot color of the surrounding template. That surrounding template should eventually be updated to use blueberry, the sooner the better of course. But it's okay to keep the colors the same in the mean time.

Same for the componentry — outside of an updated notice component, it's okay to use the existing notice component. Something like this:

Screenshot 2023-03-29 at 10 05 02

@renintw
Copy link
Contributor Author

renintw commented Mar 29, 2023

I do very much like the input updates however. Does it make sense to split this up into those two features? One were we just update the code scan inputs and one that includes this extra "step"?

It was suggested to splitting this up into two steps in that the original look was considered a bit packed together. I guess the main difference between us and Github is that we try to provide a few explanations and introductions about 2FA for .org here, whereas Github has a whole section dedicated to it. If we can provide more information on the introduction page, then that page may have more value. However, I personally feel that we can also simply provide the feature like Github does, without any introductory text in that maybe 2fa is common enough (maybe?) This way, we can have things on one page.

@jasmussen Do you have any thoughts on what @StevenDufresne brought up ^?
And thanks for the feedback and the clear clarification! I think I'll follow your idea that as the whole website is still in the classic WP style, and a new style may seem a bit abrupt, I'm not going to do extra adjustments going forward. However, I will add a red border when the input is wrong.

Regarding the repositioning of the notice, what's your thought on the things to see when there is no notice?
I'm thinking it may look something like when there's no notice, the QR code and input fields are still kept close together, and once it appears, the input field is pushed down. If this is the case, an animation might be needed to help make this transition smoother.

@jasmussen
Copy link
Collaborator

Do you have any thoughts on what StevenDufresne brought up ^?

If the point is to combine two steps into one, I think that's fine. I'd suggest that also gives an opportunity to do a pass on the text, reduce when there's overlap. Less is always more when it comes to that. Doesn't have to be this PR, just noting.

Regarding the repositioning of the notice, what's your thought on the things to see when there is no notice?
I'm thinking it may look something like when there's no notice, the QR code and input fields are still kept close together, and once it appears, the input field is pushed down. If this is the case, an animation might be needed to help make this transition smoother.

It's fine that the notice pushes content around 👍 👍

But especially if two steps are combined into one, it'd be good to reduce elements (such as text) as much as possible, so we still mostly retain the same footprint and shape of the overall box. If you can try it and add a screenshot, I can give some suggestions on that if helpful.

@renintw renintw force-pushed the enhance/split-2fa-intruction-into-two-steps branch from d806f40 to 78797a6 Compare April 13, 2023 08:38
@renintw renintw mentioned this pull request Apr 13, 2023
@renintw
Copy link
Contributor Author

renintw commented Apr 13, 2023

I'm going to merge this first and #104 (New copy for TOTP), #105 (Notice reposition) were opened to address what we've discussed above.

@renintw renintw force-pushed the enhance/split-2fa-intruction-into-two-steps branch from c4da34c to cba6a73 Compare April 13, 2023 09:33
@renintw renintw merged commit 35d524f into trunk Apr 13, 2023
@renintw renintw deleted the enhance/split-2fa-intruction-into-two-steps branch April 13, 2023 09:48
@iandunn iandunn mentioned this pull request May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ui Related to user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split 2FA instruction into two steps
3 participants