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

Move show password checkbox under password field #8027

Merged
merged 6 commits into from
Jun 11, 2020

Conversation

sanjaysiddhanti
Copy link
Contributor

@sanjaysiddhanti sanjaysiddhanti commented Jun 2, 2020

@di

This PR implements #6722.

Screenshot before:

Screen Shot 2020-06-01 at 10 47 17 PM

Screenshot after:

Screen Shot 2020-06-01 at 10 50 33 PM

Let me know if you'd like any additional changes.

Fixes #6722.

@sanjaysiddhanti
Copy link
Contributor Author

sanjaysiddhanti commented Jun 2, 2020

I could also move "show password" down to be horizontally aligned with "Log in" and "forgot password." I wasn't sure where exactly you wanted it. This does meet the ticket's request of making password one tab away from username.

@di
Copy link
Member

di commented Jun 2, 2020

I could also move "show password" down to be horizontally aligned with "Log in" and "forgot password."

Yes, please do that! I think that can be done with the split-layout class. We should also remove the split-layout class where it's no longer being used, like #6722 (comment) describes.

@sanjaysiddhanti
Copy link
Contributor Author

sanjaysiddhanti commented Jun 2, 2020

Ok, I removed the split-layout where it is no longer used. When I apply the rest of the diff from #6722 (comment), it basically looks like my screenshot above, without horizontal alignment.

How does d845979 look? I did the following:

  • Moved "show password" into the form group that has the log in and forgot password buttons
  • This broke the "show password" functionality. Looks like clicking on "show password" triggers some JS code, but it needs to be in a block that connects it to the Password Controller (and be in the same block as the target element?). So, I moved the entire form group into the <div data-controller="password" class="form-group"> block. Is there a better solution?

New screenshot below

image

@sanjaysiddhanti
Copy link
Contributor Author

will cause them to both be moved to the right side, but stacked on top of each other

Ah, I didn't realize that was the goal. Your suggested diff doesn't quite do it, since label and span are both inline (see below).

Screen Shot 2020-06-02 at 5 56 23 PM

But when I wrap the label in a div in b98f393, I think it looks right

Screen Shot 2020-06-02 at 5 58 04 PM

@sanjaysiddhanti sanjaysiddhanti requested a review from di June 3, 2020 01:02
@di di requested review from nlhkabu and removed request for di June 3, 2020 04:00
@sanjaysiddhanti
Copy link
Contributor Author

@nlhkabu No rush, but just a friendly ping on this one in case it got lost.

@nlhkabu
Copy link
Contributor

nlhkabu commented Jun 10, 2020

Hi @sanjaysiddhanti thank you for your pull request. I think it's beginning to feel a bit crowded down at the bottom right. Maybe a layout like this would be better:

Screenshot from 2020-06-10 21-25-49

You can use split-layout to position the button and checkbox and margin helpers to ensure the spacing between elements is correct.

@di I am going to remove myself as a reviewer here (lack of bandwidth) - please merge once @sanjaysiddhanti has addressed my feedback and you are happy to go ahead. Thanks 🙏

@nlhkabu nlhkabu removed their request for review June 10, 2020 20:42
<div>
<input type="submit" value="{% trans %}Log in{% endtrans %}" class="button button--primary">
<div class="form-group">
<div class="split-layout margin-top--large margin-bottom--large">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed split-layout--table, as it causes elements to be vertically centered in the container, whereas Nicole's screenshot shows "Show password" aligned to the top of the div

@sanjaysiddhanti
Copy link
Contributor Author

Thanks for the feedback! Here is an updated version:

image

The only difference I see is that Nicole's version has double the margin between "Log in" and "Show password." I tried to achieve this with the following, but the margins were getting collapsed with the sibling element:

            <span class="display-block margin-top--large">
              <a href="{{request.route_url('accounts.request-password-reset')}}">{% trans %}Forgot password?{% endtrans %}</a>
            </span>

I also tried wrapping the span in a div class="margin-top--large"

@di did you have an idea of how to get this extra margin and does it matter to you?

@sanjaysiddhanti sanjaysiddhanti requested a review from di June 11, 2020 07:28
@patelneel55
Copy link
Contributor

Since there's now a new feature request regarding a "Keep me signed in" button at #8033, would it be beneficial to switch to a 👁️ icon, as mentioned by @bittner at #6722, to prevent a clutter of text fields under the password field?

Any thoughts? @di @sanjaysiddhanti

Copy link
Member

@di di left a comment

Choose a reason for hiding this comment

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

I think this is good as-is!

@di di merged commit 6721a8a into pypi:master Jun 11, 2020
@bittner
Copy link

bittner commented Jun 12, 2020

Nice! This change fully addresses the usability issue that was there before. Adding an 👁️ icon now only will be a cosmetic enhancement. This can certainly be done "any time". 👍

Thanks for this important improvement! 🥇

@bittner
Copy link

bittner commented Jun 12, 2020

Nice, this change is already rolled out. Is the pipeline that does this public? It doesn't seem to be the GitHub Actions of this repository. 🤔

@brainwane
Copy link
Contributor

Hi @sanjaysiddhanti! Congrats on landing your first pull request in PyPA projects. Could I ask you to take a look at #5222 and comment there if you can work on it?

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.

Move "show password" checkbox on login form
6 participants