"Reveal Password" functionality #84
Conversation
|
Calling out a few different points of interest, mainly about my shaky CSS-fu. |
|
|
||
| import styles from "./input.css"; | ||
|
|
||
| const PASSWORD_DOT = "\u2022"; |
lmorchard
Feb 21, 2019
Author
Contributor
This unicode char "•" more closely matches the Zeplin mock - but the previous value "●" more closely matches the built-in password field dots. This is easy to switch back if we want.
This unicode char "•" more closely matches the Zeplin mock - but the previous value "●" more closely matches the built-in password field dots. This is easy to switch back if we want.
| return ( | ||
| <div {...props} className={classNames([ | ||
| styles.monospace, | ||
| styles.passwordText, |
lmorchard
Feb 21, 2019
Author
Contributor
Two issues I ran into here, trying to handle a "long password" case here:
- How long is long? (e.g. 15 characters?) We could possibly switch a classname on value length
- The whole form is on a shared CSS grid, with the copy buttons aligned. Breaking that alignment calls for a different overall layout for the form, I think? My CSS-fu fails me here.
Two issues I ran into here, trying to handle a "long password" case here:
- How long is long? (e.g. 15 characters?) We could possibly switch a classname on value length
- The whole form is on a shared CSS grid, with the copy buttons aligned. Breaking that alignment calls for a different overall layout for the form, I think? My CSS-fu fails me here.
linuxwolf
Feb 22, 2019
Contributor
@mozilla-lockbox/ux some insights here would be helpful
1. How long is long? (e.g. 15 characters?) We could possibly switch a classname on value length
I would start with 15 or 20 personally, too
2. The whole form is on a shared CSS grid, with the copy buttons aligned. Breaking that alignment calls for a different overall layout for the form, I think? My CSS-fu fails me here.
I think the intent of the designs is for the reveal button to be adjacent to the password text, which means it's position could shift based on how long the value is.
To keep the reveal in a fixed spot, I think you're right that it would require changing the CSS grid column count.
@mozilla-lockbox/ux some insights here would be helpful
1. How long is long? (e.g. 15 characters?) We could possibly switch a classname on value length
I would start with 15 or 20 personally, too
2. The whole form is on a shared CSS grid, with the copy buttons aligned. Breaking that alignment calls for a different overall layout for the form, I think? My CSS-fu fails me here.
I think the intent of the designs is for the reveal button to be adjacent to the password text, which means it's position could shift based on how long the value is.
To keep the reveal in a fixed spot, I think you're right that it would require changing the CSS grid column count.
lmorchard
Feb 22, 2019
Author
Contributor
Well, I've got the reveal button sitting at the end of the text, which seems to match the spec. It's the unaligned copy button and expanding the width of the field that seems a problem
Well, I've got the reveal button sitting at the end of the text, which seems to match the spec. It's the unaligned copy button and expanding the width of the field that seems a problem
linuxwolf
Feb 22, 2019
Contributor
sorry, I was misunderstanding completely! And it looks like the UX questions are worked out.
sorry, I was misunderstanding completely! And it looks like the UX questions are worked out.
| background-repeat: no-repeat; | ||
| background-size: 16px 16px; | ||
| background-position: 0 2px; |
lmorchard
Feb 21, 2019
Author
Contributor
This is kind of arbitrary, but seems to get the show/hide icon better aligned with the dots and midpoint of text. Might be worth yanking out.
This is kind of arbitrary, but seems to get the show/hide icon better aligned with the dots and midpoint of text. Might be worth yanking out.
| } | ||
|
|
||
| .password-text { | ||
| width: 136px; |
lmorchard
Feb 21, 2019
Author
Contributor
I copied a lot of these properties straight from Zeplin - some of it seems redundant and could probably get scrubbed out.
I copied a lot of these properties straight from Zeplin - some of it seems redundant and could probably get scrubbed out.
| <path fill="#6D6D6E" d="M14.0160542,0.675736079 C14.3979633,1.05764518 14.3979633,1.67684218 14.0160542,2.05875128 L2.95193261,13.1228729 C2.5700235,13.504782 1.95082651,13.504782 1.56891741,13.1228729 C1.1870083,12.7409638 1.1870083,12.1217668 1.56891741,11.7398577 L12.633039,0.675736079 C13.0149481,0.293826977 13.6341451,0.293826977 14.0160542,0.675736079 Z"/> | ||
| <path fill="#6D6D6E" d="M9.60800171,4.46955872 C9.1423119,4.17216421 8.59352469,4 8,4 C6.34314575,4 5,5.34314575 5,7 C5,7.5968592 5.1629633,8.14651554 5.46343994,8.61383057 L9.60800171,4.46955872 Z"/> | ||
| </g> | ||
| <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"> |
lmorchard
Feb 21, 2019
Author
Contributor
Could probably run some optimization on these SVGs, but I just copied them out of the Zeplin mock
Could probably run some optimization on these SVGs, but I just copied them out of the Zeplin mock
|
Doh. Broke a handful of unit tests - handling that right now. |
| @@ -65,19 +63,18 @@ export default class CopyToClipboardButton extends React.Component { | |||
| </Localized> | |||
| ); | |||
| } | |||
| return ( | |||
| <Stack stretch selectedIndex={selectedIndex} className={className}> | |||
lmorchard
Feb 21, 2019
Author
Contributor
Oh yeah, and I meant to mention in my earlier comments that I found some of the CSS stuff a bit easier after dropping the Stack component (which was the main cause of the failed unit tests, so that reminded me)
Oh yeah, and I meant to mention in my earlier comments that I found some of the CSS stuff a bit easier after dropping the Stack component (which was the main cause of the failed unit tests, so that reminded me)
- New PasswordText widget with hide/show buttons - Tweak hide/show and copy button alignments - Smaller PASSWORD_DOT - Replace hide / show eye icons Fixes #20
|
After a discussion with @lmorchard regarding following our grid layout with the copy buttons, we have decided to move forward with the copy actions all staying aligned, even when one field is longer than the rest. The designs have been updated to reflect this. |
|
r+ Looks good to me. |
New PasswordText widget with hide/show buttons
Tweak hide/show and copy button alignments
Smaller PASSWORD_DOT
Replace hide / show eye icons
Fixes #20
Testing and Review Notes
To Do